| ... | ... |
@@ -56,7 +56,7 @@ static SDL_Thread *stdin_thread; |
| 56 | 56 |
/* devices */ |
| 57 | 57 |
|
| 58 | 58 |
static int window_created = 0; |
| 59 |
-static int fullscreen = 0; |
|
| 59 |
+static int fullscreen = 0, borderless = 0; |
|
| 60 | 60 |
static Uint32 stdin_event, audio0_event, zoom = 1; |
| 61 | 61 |
static Uint64 exec_deadline, deadline_interval, ms_interval; |
| 62 | 62 |
|
| ... | ... |
@@ -189,9 +189,9 @@ set_zoom(Uint8 z, int win) |
| 189 | 189 |
} |
| 190 | 190 |
|
| 191 | 191 |
static void |
| 192 |
-set_fullscreen(int new_fullscreen, int win) |
|
| 192 |
+set_fullscreen(int value, int win) |
|
| 193 | 193 |
{
|
| 194 |
- fullscreen = new_fullscreen; |
|
| 194 |
+ fullscreen = value; |
|
| 195 | 195 |
Uint32 flags = 0; /* windowed mode; SDL2 has no constant for this */ |
| 196 | 196 |
if(fullscreen) {
|
| 197 | 197 |
flags = SDL_WINDOW_FULLSCREEN_DESKTOP; |
| ... | ... |
@@ -200,6 +200,13 @@ set_fullscreen(int new_fullscreen, int win) |
| 200 | 200 |
SDL_SetWindowFullscreen(emu_window, flags); |
| 201 | 201 |
} |
| 202 | 202 |
|
| 203 |
+static void |
|
| 204 |
+set_borderless(int value) |
|
| 205 |
+{
|
|
| 206 |
+ borderless = value; |
|
| 207 |
+ SDL_SetWindowBordered(emu_window, !value); |
|
| 208 |
+} |
|
| 209 |
+ |
|
| 203 | 210 |
/* emulator primitives */ |
| 204 | 211 |
|
| 205 | 212 |
int |
| ... | ... |
@@ -405,6 +412,8 @@ handle_events(Uxn *u) |
| 405 | 412 |
emu_restart(u, boot_rom, 1); |
| 406 | 413 |
else if(event.key.keysym.sym == SDLK_F11) |
| 407 | 414 |
set_fullscreen(!fullscreen, 1); |
| 415 |
+ else if(event.key.keysym.sym == SDLK_F12) |
|
| 416 |
+ set_borderless(!borderless); |
|
| 408 | 417 |
ksym = event.key.keysym.sym; |
| 409 | 418 |
if(SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYUP, SDL_KEYUP) == 1 && ksym == event.key.keysym.sym) |
| 410 | 419 |
return 1; |