From 1a73c45a089a221f503b9efa706bad74da57f73e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 8 Jan 2022 13:34:49 -0800 Subject: [PATCH] Fixed incorrect color in the OpenGL driver --- src/render/opengl/SDL_render_gl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 3b3d739f6..dd34b2744 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1026,7 +1026,8 @@ GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te /* Not really a float, but it is still 4 bytes and will be cast to the right type in the graphics driver. */ - *(verts++) = *(float*)((char*)color + j * color_stride); + SDL_memcpy(verts, ((char*)color + j * color_stride), sizeof(*color)); + ++verts; if (texture) { float *uv_ = (float *)((char*)uv + j * uv_stride);