[win32, canvas] Fix random crash by correctly setting wgl_surface deselect function pointer to mg_wgl_deselect(). Forgot to do it in 18c793db, dumb me.

This commit is contained in:
martinfouilleul 2023-07-06 11:29:57 +02:00
parent 1e34c3406f
commit 806f00417e
1 changed files with 2 additions and 0 deletions

View File

@ -193,6 +193,7 @@ mg_surface_data* mg_wgl_surface_create_for_window(mp_window window)
surface = malloc_type(mg_wgl_surface);
if(surface)
{
memset(surface, 0, sizeof(mg_wgl_surface));
mg_surface_init_for_window((mg_surface_data*)surface, windowData);
surface->interface.api = MG_GL;
@ -200,6 +201,7 @@ mg_surface_data* mg_wgl_surface_create_for_window(mp_window window)
surface->interface.prepare = mg_wgl_surface_prepare;
surface->interface.present = mg_wgl_surface_present;
surface->interface.swapInterval = mg_wgl_surface_swap_interval;
surface->interface.deselect = mg_wgl_surface_deselect;
surface->hDC = GetDC(surface->interface.layer.hWnd);