aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UMain.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-26 07:00:58 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-26 07:00:58 +0000
commita265788184832a725213c0fc87372c7df42146d1 (patch)
tree6ef43b4cc71b0c6f247732f3d1d0e87a9e558118 /Game/Code/Classes/UMain.pas
parent318eae8dadf86fe5b64697775ebea6ad7f748c96 (diff)
downloadusdx-a265788184832a725213c0fc87372c7df42146d1.tar.gz
usdx-a265788184832a725213c0fc87372c7df42146d1.tar.xz
usdx-a265788184832a725213c0fc87372c7df42146d1.zip
added patch to toggle full screen with F11
( and tried Alt Enter. but not working yet ) also did some investigation into SDL Video modes on linux note this bug : https://bugs.launchpad.net/ubuntu/+source/libsdl1.2/+bug/14044 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@888 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UMain.pas')
-rw-r--r--Game/Code/Classes/UMain.pas23
1 files changed, 21 insertions, 2 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index 6f336c50..12cd783c 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -456,11 +456,30 @@ Begin
// remap the "keypad enter" key to the "standard enter" key
if (Event.key.keysym.sym = SDLK_KP_ENTER) then
Event.key.keysym.sym := SDLK_RETURN;
+
+ if (Event.key.keysym.sym = SDLK_F11 ) (*OR
+ (Event.key.keysym.sym = KMOD_ALT and SDLK_RETURN )*)then // toggle full screen
+ begin
+ writeln( 'Toggle FullScreen' );
+ Ini.FullScreen := integer( not boolean( Ini.FullScreen ) );
+
+ if boolean( Ini.FullScreen ) then
+ begin
+ SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN);
+ SDL_ShowCursor(0);
+ end
+ else
+ begin
+ SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_RESIZABLE);
+ SDL_ShowCursor(1);
+ end;
+
+ glViewPort(0, 0, 1600, 1200);
+ end;
//ScreenShot hack. If Print is pressed-> Make screenshot and Save to Screenshots Path
if (Event.key.keysym.sym = SDLK_SYSREQ) or (Event.key.keysym.sym = SDLK_PRINT) then
- Display.ScreenShot
-
+ Display.ScreenShot
// popup hack... if there is a visible popup then let it handle input instead of underlying screen
// shoud be done in a way to be sure the topmost popup has preference (maybe error, then check)
else if (ScreenPopupError <> NIL) and (ScreenPopupError.Visible) then