Skip to content

Commit d88764e

Browse files
committed
SDL2: Use full screen window instead of real fullscreen mode
Also, toggle full-screen mode only once if the key combination is kept pressed. Based on sergiou87#40
1 parent fdbce68 commit d88764e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/sdl2/video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void toggleFullscreen()
232232

233233
void setFullscreenMode(uint8_t fullscreen)
234234
{
235-
SDL_SetWindowFullscreen(gWindow, fullscreen ? SDL_WINDOW_FULLSCREEN : 0);
235+
SDL_SetWindowFullscreen(gWindow, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
236236
}
237237

238238
uint8_t getFullscreenMode(void)

src/supaplex.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ uint8_t isJoystickEnabled = 0; // byte_50940
179179
uint8_t isMusicEnabled = 0; // byte_59886
180180
uint8_t isFXEnabled = 0; // byte_59885
181181

182+
uint8_t isFullScreenKeyPressed = 0;
183+
182184
uint8_t gIsFlashingBackgroundModeEnabled = 0; // flashingbackgroundon
183185
const float kSpeedTimeFactors[kNumberOfGameSpeeds] = { 3.5, 3.0, 2.5, 2.0, 1.5, 1.0, 0.75, 2.0 / 3.0, 5.0 / 8.0, 3.0 / 5.0, 1.0 / 70.0 };
184186

@@ -1907,7 +1909,15 @@ void int9handler(uint8_t shouldYieldCpu) // proc far ; DATA XREF: setint9
19071909

19081910
if (gIsLeftAltPressed && gIsEnterPressed)
19091911
{
1910-
toggleFullscreen();
1912+
if (!isFullScreenKeyPressed)
1913+
{
1914+
toggleFullscreen();
1915+
}
1916+
isFullScreenKeyPressed = 1;
1917+
}
1918+
else
1919+
{
1920+
isFullScreenKeyPressed = 0;
19111921
}
19121922

19131923
//storeKey: ; CODE XREF: int9handler+2Bj

0 commit comments

Comments
 (0)