cli: add fullscreen toggle with alt-enter
This commit is contained in:
parent
9868c00fca
commit
09506c9a19
|
@ -497,6 +497,7 @@ int main(int argc, char ** argv) {
|
||||||
fprintf( stderr, "Window creation failed: %s\n", SDL_GetError( ) );
|
fprintf( stderr, "Window creation failed: %s\n", SDL_GetError( ) );
|
||||||
exit( -1);
|
exit( -1);
|
||||||
}
|
}
|
||||||
|
ctrls_cfg.window = window;
|
||||||
|
|
||||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ u16 keyboard_cfg[NB_KEYS];
|
||||||
u16 joypad_cfg[NB_KEYS];
|
u16 joypad_cfg[NB_KEYS];
|
||||||
u16 nbr_joy;
|
u16 nbr_joy;
|
||||||
mouse_status mouse;
|
mouse_status mouse;
|
||||||
|
static int fullscreen;
|
||||||
|
|
||||||
static SDL_Joystick **open_joysticks = NULL;
|
static SDL_Joystick **open_joysticks = NULL;
|
||||||
|
|
||||||
|
@ -500,6 +501,12 @@ process_ctrls_event( SDL_Event& event,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_KEYDOWN:
|
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){
|
switch(event.key.keysym.sym){
|
||||||
case SDLK_LSHIFT:
|
case SDLK_LSHIFT:
|
||||||
shift_pressed |= 1;
|
shift_pressed |= 1;
|
||||||
|
|
|
@ -91,13 +91,9 @@ struct ctrls_event_config {
|
||||||
int sdl_quit;
|
int sdl_quit;
|
||||||
int boost;
|
int boost;
|
||||||
int fake_mic;
|
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 *screen_texture;
|
||||||
void (*resize_cb)(u16 width, u16 height, void *screen_texture);
|
void (*resize_cb)(u16 width, u16 height, void *screen_texture);
|
||||||
#endif
|
SDL_Window *window;
|
||||||
};
|
};
|
||||||
|
|
||||||
void load_default_config(const u32 kbCfg[]);
|
void load_default_config(const u32 kbCfg[]);
|
||||||
|
|
Loading…
Reference in New Issue