diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-06-26 18:23:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 18:23:52 -0400 |
commit | ce471f3371221e56c7352919465f1fc8f5de3956 (patch) | |
tree | 8c40a229d38ed173c8a87e411b01b62055023bef /render/gles2/surface.c | |
parent | f252c5a79214a3d3cd7ab3f239050b234e4ae9e2 (diff) | |
parent | 97213cc00e0a83235ca50b1305ab9ecafd295259 (diff) |
Merge pull request #23 from ascent12/cursor
Software cursor + Hardware cursor improvements
Diffstat (limited to 'render/gles2/surface.c')
-rw-r--r-- | render/gles2/surface.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/render/gles2/surface.c b/render/gles2/surface.c index 278b3dc3..c9be6ac2 100644 --- a/render/gles2/surface.c +++ b/render/gles2/surface.c @@ -2,6 +2,7 @@ #include <stdlib.h> #include <assert.h> #include <GLES2/gl2.h> +#include <GLES2/gl2ext.h> #include <wayland-util.h> #include <wayland-server-protocol.h> #include <wlr/render.h> @@ -10,15 +11,17 @@ #include "render/gles2.h" static bool gles2_surface_attach_pixels(struct wlr_surface_state *surface, - uint32_t format, int width, int height, const unsigned char *pixels) { + uint32_t format, int stride, int width, int height, const unsigned char *pixels) { assert(surface); surface->wlr_surface->width = width; surface->wlr_surface->height = height; surface->wlr_surface->format = format; GL_CALL(glGenTextures(1, &surface->tex_id)); GL_CALL(glBindTexture(GL_TEXTURE_2D, surface->tex_id)); + GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, stride)); GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, pixels)); + GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0)); surface->wlr_surface->valid = true; return true; } |