- mainSurface = SDL_SetVideoMode(tom_width, tom_height, 32, mainSurfaceFlags);
+ if (vjs.useOpenGL)
+ {
+ // When OpenGL is used, we're going to use a standard resolution of 640x480.
+ // This way we have good scaling functionality and when the screen is resized
+ // because of the NTSC <-> PAL resize, we only have to re-create the texture
+ // instead of initializing the entire OpenGL texture en screens.
+ mainSurface = SDL_SetVideoMode(640, 480, 32, mainSurfaceFlags);//*/
+
+ // Reset viewport, etc.
+ glViewport(0, 0, mainSurface->w, mainSurface->h);
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glOrtho(0.0, (GLdouble)mainSurface->w, (GLdouble)mainSurface->h, 0.0, 0.0, 1.0);
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+ }
+ else
+ mainSurface = SDL_SetVideoMode(VIRTUAL_SCREEN_WIDTH,
+ (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL),
+ 32, mainSurfaceFlags);