[win32] Fix first image not being rendered in win32 canvas renderer

This commit is contained in:
martinfouilleul 2023-07-02 12:49:45 +02:00
parent 23984e8370
commit 36c75a55dd
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@
* @revision: * @revision:
* *
*****************************************************************/ *****************************************************************/
#include<stdio.h>
#include<stdlib.h> #include<stdlib.h>
#include<string.h> #include<string.h>
#include<errno.h> #include<errno.h>
@ -73,7 +74,6 @@ int main()
mg_set_color_rgba(0, 1, 1, 1); mg_set_color_rgba(0, 1, 1, 1);
mg_clear(); mg_clear();
mg_set_color_rgba(1, 1, 1, 1); mg_set_color_rgba(1, 1, 1, 1);
mg_matrix_push((mg_mat2x3){0.707, -0.707, 200, mg_matrix_push((mg_mat2x3){0.707, -0.707, 200,
@ -95,6 +95,8 @@ int main()
mg_image_draw(image2, (mp_rect){300, 200, 300, 300}); mg_image_draw(image2, (mp_rect){300, 200, 300, 300});
mg_render(surface, canvas); mg_render(surface, canvas);
mg_surface_present(surface); mg_surface_present(surface);

View File

@ -1733,8 +1733,8 @@ void mg_gl_canvas_render(mg_canvas_backend* interface,
{ {
mg_image_data* imageData = mg_image_data_from_handle(backend->image); mg_image_data* imageData = mg_image_data_from_handle(backend->image);
mg_gl_canvas_draw_batch(backend, imageData, backend->nextShapeIndex, backend->vertexCount, backend->indexCount); mg_gl_canvas_draw_batch(backend, imageData, backend->nextShapeIndex, backend->vertexCount, backend->indexCount);
backend->image = primitive->attributes.image;
} }
backend->image = primitive->attributes.image;
switch(primitive->cmd) switch(primitive->cmd)
{ {