From Jeremy Moles, "This extra call to SDL_VideoSetMode() prevents my viewport from getting

all wonky when I resize the SDL window. I'm not sure if this bug has
always existed or not, but according to the SDL documentation this
operation should be safe regardless, and doesn't not introduce the need
for extra memory management (that is: there is no need to "cleanup" the
old screen variable, that is all handled by SDL for us).
"
This commit is contained in:
Robert Osfield 2007-12-08 15:04:47 +00:00
parent 13e8af6305
commit 0120bae9f7

View File

@ -146,6 +146,7 @@ int main( int argc, char **argv )
switch (event.type) { switch (event.type) {
case SDL_VIDEORESIZE: case SDL_VIDEORESIZE:
SDL_SetVideoMode(event.resize.w, event.resize.h, bitDepth, SDL_OPENGL | SDL_RESIZABLE);
gw->resized(0, 0, event.resize.w, event.resize.h ); gw->resized(0, 0, event.resize.w, event.resize.h );
break; break;