mirror of https://github.com/mgba-emu/mgba.git
SDL: Simplify setting full screen mode with SDL1
This commit is contained in:
parent
3aae19a807
commit
84c010783c
|
@ -51,9 +51,9 @@ void mSDLGLCommonInit(struct mSDLRenderer* renderer) {
|
|||
#else
|
||||
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
|
||||
#ifdef COLOR_16_BIT
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->fullscreen));
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->player.fullscreen));
|
||||
#else
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->fullscreen));
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->player.fullscreen));
|
||||
#endif
|
||||
SDL_WM_SetCaption(projectName, "");
|
||||
#endif
|
||||
|
|
|
@ -131,12 +131,8 @@ int main(int argc, char** argv) {
|
|||
|
||||
renderer.viewportWidth = renderer.core->opts.width;
|
||||
renderer.viewportHeight = renderer.core->opts.height;
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
renderer.player.fullscreen = renderer.core->opts.fullscreen;
|
||||
renderer.player.windowUpdated = 0;
|
||||
#else
|
||||
renderer.fullscreen = renderer.core->opts.fullscreen;
|
||||
#endif
|
||||
|
||||
renderer.lockAspectRatio = renderer.core->opts.lockAspectRatio;
|
||||
renderer.lockIntegerScaling = renderer.core->opts.lockIntegerScaling;
|
||||
|
|
|
@ -54,8 +54,6 @@ struct mSDLRenderer {
|
|||
SDL_Texture* sdlTex;
|
||||
SDL_Renderer* sdlRenderer;
|
||||
SDL_GLContext* glCtx;
|
||||
#else
|
||||
bool fullscreen;
|
||||
#endif
|
||||
|
||||
unsigned width;
|
||||
|
|
|
@ -63,10 +63,10 @@ struct mSDLPlayer {
|
|||
size_t playerId;
|
||||
struct mInputMap* bindings;
|
||||
struct SDL_JoystickCombo* joystick;
|
||||
int fullscreen;
|
||||
int windowUpdated;
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
SDL_Window* window;
|
||||
int fullscreen;
|
||||
|
||||
struct mSDLRumble {
|
||||
struct mRumble d;
|
||||
|
|
|
@ -22,9 +22,9 @@ void mSDLSWCreate(struct mSDLRenderer* renderer) {
|
|||
|
||||
bool mSDLSWInit(struct mSDLRenderer* renderer) {
|
||||
#ifdef COLOR_16_BIT
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->fullscreen));
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->player.fullscreen));
|
||||
#else
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->fullscreen));
|
||||
SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->player.fullscreen));
|
||||
#endif
|
||||
SDL_WM_SetCaption(projectName, "");
|
||||
|
||||
|
|
Loading…
Reference in New Issue