mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 23:35:20 +00:00
Wait until window is exposed before getting surface. (Initial screen
draw could be incomplete without this.)
This commit is contained in:
@@ -159,6 +159,7 @@ int _get_displaynum(void)
|
||||
|
||||
int PDC_scr_open(void)
|
||||
{
|
||||
SDL_Event event;
|
||||
int displaynum = 0;
|
||||
|
||||
PDC_LOG(("PDC_scr_open() - called\n"));
|
||||
@@ -293,6 +294,13 @@ int PDC_scr_open(void)
|
||||
|
||||
SDL_PumpEvents();
|
||||
|
||||
/* Wait until window is exposed before getting surface */
|
||||
|
||||
while (SDL_PollEvent(&event))
|
||||
if (SDL_WINDOWEVENT == event.type &&
|
||||
SDL_WINDOWEVENT_EXPOSED == event.window.event)
|
||||
break;
|
||||
|
||||
if (!pdc_screen)
|
||||
{
|
||||
pdc_screen = SDL_GetWindowSurface(pdc_window);
|
||||
|
||||
Reference in New Issue
Block a user