diff options
-rw-r--r-- | src/graphics/texture.c | 2 | ||||
-rw-r--r-- | src/window/window.c | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/graphics/texture.c b/src/graphics/texture.c index 0ae21cf..9ea9b12 100644 --- a/src/graphics/texture.c +++ b/src/graphics/texture.c @@ -122,9 +122,7 @@ int mgl_texture_update(mgl_texture *self, const unsigned char *data, int offset_ mgl_context *context = mgl_get_context(); context->gl.glBindTexture(GL_TEXTURE_2D, self->id); const mgl_texture_format texture_format = mgl_image_format_to_mgl_texture_format(format); - context->gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); context->gl.glTexSubImage2D(GL_TEXTURE_2D, 0, offset_x, offset_y, width, height, mgl_texture_format_to_source_opengl_format(texture_format), GL_UNSIGNED_BYTE, data); - context->gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 0); context->gl.glBindTexture(GL_TEXTURE_2D, 0); return 0; } diff --git a/src/window/window.c b/src/window/window.c index 65a2509..3dbb81f 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -326,6 +326,7 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window context->gl.glEnableClientState(GL_VERTEX_ARRAY); context->gl.glEnableClientState(GL_TEXTURE_COORD_ARRAY); context->gl.glEnableClientState(GL_COLOR_ARRAY); + context->gl.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); Window dummy_w; int dummy_i; |