mirror of
https://github.com/libretro/RetroArch
synced 2025-01-06 10:11:54 +00:00
Can toggle between fullscreen and windowed :)
This commit is contained in:
parent
eed8e2bed2
commit
7c678fc334
8
config.h
8
config.h
@ -16,6 +16,11 @@ struct snes_keybind
|
||||
int joykey;
|
||||
};
|
||||
|
||||
#define SAVE_STATE_KEY GLFW_KEY_F2
|
||||
#define LOAD_STATE_KEY GLFW_KEY_F4
|
||||
|
||||
#define TOGGLE_FULLSCREEN 'F'
|
||||
|
||||
static const bool force_aspect = true; // On resize and fullscreen, rendering area will stay 8:7
|
||||
|
||||
// Windowed
|
||||
@ -23,7 +28,8 @@ static const float xscale = 5.0; // Real x res = 256 * xscale
|
||||
static const float yscale = 5.0; // Real y res = 224 * yscale
|
||||
|
||||
// Fullscreen
|
||||
static const bool fullscreen = false;
|
||||
|
||||
static bool fullscreen = false; // To start in Fullscreen on not
|
||||
static const unsigned fullscreen_x = 1920;
|
||||
static const unsigned fullscreen_y = 1200;
|
||||
|
||||
|
22
ssnes.c
22
ssnes.c
@ -117,6 +117,12 @@ static void init_audio(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void uninit_audio(void)
|
||||
{
|
||||
rsd_stop(rd);
|
||||
rsd_free(rd);
|
||||
}
|
||||
|
||||
static void video_refresh_GL(const uint16_t* data, unsigned width, unsigned height)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
@ -308,10 +314,18 @@ int main(int argc, char *argv[])
|
||||
if ( quitting )
|
||||
break;
|
||||
|
||||
if ( glfwGetKey( GLFW_KEY_F2 ))
|
||||
if ( glfwGetKey( SAVE_STATE_KEY ))
|
||||
snes_serialize(serial_data, serial_size);
|
||||
else if ( glfwGetKey(GLFW_KEY_F4) )
|
||||
else if ( glfwGetKey( LOAD_STATE_KEY ) )
|
||||
snes_unserialize(serial_data, serial_size);
|
||||
else if ( glfwGetKey( TOGGLE_FULLSCREEN ) )
|
||||
{
|
||||
fullscreen = !fullscreen;
|
||||
uninit_gl();
|
||||
init_gl();
|
||||
uninit_audio();
|
||||
init_audio();
|
||||
}
|
||||
|
||||
snes_run();
|
||||
}
|
||||
@ -328,9 +342,7 @@ int main(int argc, char *argv[])
|
||||
snes_term();
|
||||
|
||||
uninit_gl();
|
||||
|
||||
rsd_stop(rd);
|
||||
rsd_free(rd);
|
||||
uninit_audio();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user