Hi all,
I have this piece of code in the handler to a menu:
CGapiDisplay gd_Display;
CGapiSurface gd_Backbuffer;
CGapiSurface gd_S1;
cRes = gd_Display.OpenDisplay(hWnd, GDOPENDISPLAY_FULLSCREEN);
cRes = gd_Display.GetBackBuffer(&gd;_Backbuffer);
cRes = gd_S1.CreateSurface(g_hInst,IDB_BITMAP1);
< do stuff >
delete &gd;_S1;
delete &gd;_Backbuffer;
delete &gd;_Display;
The first time I click on the menu the program works as it should. However, the second time the OpenDisplay function returns error: GDERR_PRIMARYSURFACEALREADYEXISTS.
Do I need to close the display somehow? Note that I removed sanity checks and the body of the function.
Thanks!
I have this piece of code in the handler to a menu:
CGapiDisplay gd_Display;
CGapiSurface gd_Backbuffer;
CGapiSurface gd_S1;
cRes = gd_Display.OpenDisplay(hWnd, GDOPENDISPLAY_FULLSCREEN);
cRes = gd_Display.GetBackBuffer(&gd;_Backbuffer);
cRes = gd_S1.CreateSurface(g_hInst,IDB_BITMAP1);
< do stuff >
delete &gd;_S1;
delete &gd;_Backbuffer;
delete &gd;_Display;
The first time I click on the menu the program works as it should. However, the second time the OpenDisplay function returns error: GDERR_PRIMARYSURFACEALREADYEXISTS.
Do I need to close the display somehow? Note that I removed sanity checks and the body of the function.
Thanks!