diff --git a/desmume/src/frontend/posix/cli/main.cpp b/desmume/src/frontend/posix/cli/main.cpp index 64647e0ca..3d1864ff1 100644 --- a/desmume/src/frontend/posix/cli/main.cpp +++ b/desmume/src/frontend/posix/cli/main.cpp @@ -497,8 +497,9 @@ int main(int argc, char ** argv) { fprintf( stderr, "Window creation failed: %s\n", SDL_GetError( ) ); exit( -1); } + ctrls_cfg.window = window; - renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); uint32_t desmume_pixelformat = SDL_MasksToPixelFormatEnum(16, 0x001F, 0x03E0, 0x7C00, 0); diff --git a/desmume/src/frontend/posix/shared/ctrlssdl.cpp b/desmume/src/frontend/posix/shared/ctrlssdl.cpp index 14ddc9512..2fdfd24c2 100644 --- a/desmume/src/frontend/posix/shared/ctrlssdl.cpp +++ b/desmume/src/frontend/posix/shared/ctrlssdl.cpp @@ -34,6 +34,7 @@ u16 keyboard_cfg[NB_KEYS]; u16 joypad_cfg[NB_KEYS]; u16 nbr_joy; mouse_status mouse; +static int fullscreen; static SDL_Joystick **open_joysticks = NULL; @@ -500,6 +501,12 @@ process_ctrls_event( SDL_Event& event, break; case SDL_KEYDOWN: + if ((event.key.keysym.sym == SDLK_RETURN) && (event.key.keysym.mod & KMOD_ALT)) { + SDL_SetWindowFullscreen(cfg->window, fullscreen ? 0 : SDL_WINDOW_FULLSCREEN); + fullscreen = !fullscreen; + break; + } + switch(event.key.keysym.sym){ case SDLK_LSHIFT: shift_pressed |= 1; diff --git a/desmume/src/frontend/posix/shared/ctrlssdl.h b/desmume/src/frontend/posix/shared/ctrlssdl.h index 1925aa60c..916c4d45e 100644 --- a/desmume/src/frontend/posix/shared/ctrlssdl.h +++ b/desmume/src/frontend/posix/shared/ctrlssdl.h @@ -91,13 +91,9 @@ struct ctrls_event_config { int sdl_quit; int boost; int fake_mic; -#ifdef HAVE_GL_GL_H - GLuint *screen_texture; - void (*resize_cb)(u16 width, u16 height, GLuint *screen_texture); -#else void *screen_texture; void (*resize_cb)(u16 width, u16 height, void *screen_texture); -#endif + SDL_Window *window; }; void load_default_config(const u32 kbCfg[]);