- // Setting up the primary SDL display
- surface = new Surface(tom_getVideoModeWidth(), tom_getVideoModeHeight(), format);
+ if (info->blit_hw)
+ mainSurfaceFlags |= SDL_HWACCEL;
+
+ if (fullscreen)
+ mainSurfaceFlags |= SDL_FULLSCREEN;
+
+ // Note: mainSurface is *never* used again!
+ //Not true--had to look at what's what here... It's the primary surface...
+ mainSurface = SDL_SetVideoMode(tom_getVideoModeWidth(), tom_getVideoModeHeight(), 16, mainSurfaceFlags);
+
+ if (mainSurface == NULL)
+ {
+ WriteLog("VJ: SDL is unable to set the video mode: %s\n", SDL_GetError());
+ exit(1);
+ }
+
+ SDL_WM_SetCaption("Virtual Jaguar", "Virtual Jaguar");
+
+ // Create the primary SDL display (16 BPP, 5/5/5 RGB format)
+ surface = SDL_CreateRGBSurface(SDL_SWSURFACE, tom_getVideoModeWidth(),
+ tom_getVideoModeHeight(), 16, 0x7C00, 0x03E0, 0x001F, 0);
+
+ if (surface == NULL)
+ {
+ WriteLog("VJ: Could not create primary SDL surface: %s\n", SDL_GetError());
+ exit(1);
+ }