SDL: Support fullscreen in SDL 1.2

This commit is contained in:
Jeffrey Pfau 2015-08-27 19:24:14 -07:00
parent 11f3a6e43d
commit 147852898c
4 changed files with 7 additions and 2 deletions

View File

@ -11,6 +11,7 @@ Misc:
- GBA Memory: Use a dynamically sized mask for ROM memory
- Qt: Remove useless help icons in dialogs
- ARM7: Combine shifter-immediate and shifter-register functions to reduce binary size
- SDL: Support fullscreen in SDL 1.2
0.3.0: (2015-08-16)
Features:

View File

@ -39,9 +39,9 @@ void GBASDLGLCommonInit(struct SDLSoftwareRenderer* renderer) {
#else
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
#ifdef COLOR_16_BIT
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_OPENGL);
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_OPENGL | (SDL_FULLSCREEN * renderer->fullscreen));
#else
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_OPENGL);
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_OPENGL | (SDL_FULLSCREEN * renderer->fullscreen));
#endif
#endif
}

View File

@ -75,6 +75,8 @@ int main(int argc, char** argv) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
renderer.player.fullscreen = opts.fullscreen;
renderer.player.windowUpdated = 0;
#else
renderer.fullscreen = opts.fullscreen;
#endif
renderer.ratio = graphicsOpts.multiplier;
if (renderer.ratio == 0) {

View File

@ -49,6 +49,8 @@ struct SDLSoftwareRenderer {
SDL_Texture* sdlTex;
SDL_Renderer* sdlRenderer;
SDL_GLContext* glCtx;
#else
bool fullscreen;
#endif
int viewportWidth;