diff options
Diffstat (limited to 'src/pixmap_texture.h')
-rw-r--r-- | src/pixmap_texture.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/pixmap_texture.h b/src/pixmap_texture.h new file mode 100644 index 0000000..37f7ec4 --- /dev/null +++ b/src/pixmap_texture.h @@ -0,0 +1,28 @@ +#ifndef NGXC_PIXMAP_TEXTURE_H +#define NGXC_PIXMAP_TEXTURE_H + +#include <stdbool.h> + +#define GLX_GLXEXT_PROTOTYPES +#include <GL/glx.h> +#include <GL/glxext.h> +#include <X11/Xlib.h> + +typedef struct { + Display *display; + Pixmap pixmap; + GLXPixmap glx_pixmap; + GLuint texture_id; + int width; + int height; +} ngxc_pixmap_texture; + +bool ngxc_pixmap_texture_init(ngxc_pixmap_texture *self, Display *display, Pixmap pixmap); +void ngxc_pixmap_texture_deinit(ngxc_pixmap_texture *self); + +/* + This should ONLY be called when the pixmap is resized. +*/ +bool ngxc_pixmap_texture_on_resize(ngxc_pixmap_texture *self); + +#endif /* NGXC_PIXMAP_TEXTURE_H */ |