diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index a41c9f44b08ed50dae2524f5a3a1d9c554400233..ef1d362bd77362b5d5045ea3ffcea44b9ed24da7 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
flag: Boolean;
wTitle: PChar = nil;
wNeedTimeReset: Boolean = False;
- wWindowCreated: Boolean = False;
+ //wWindowCreated: Boolean = False;
//wCursorShown: Boolean = False;
wMinimized: Boolean = False;
//wNeedFree: Boolean = True;
e_WriteLog('[DEBUG] WinMsgs: Now restored', MSG_NOTIFY);
end;
end;
-
+
SDL_WINDOWEVENT_FOCUS_GAINED:
+ begin
wActivate := True;
-
+ //e_WriteLog('window gained focus!', MSG_NOTIFY);
+ end;
+
SDL_WINDOWEVENT_FOCUS_LOST:
+ begin
wDeactivate := True;
+ //e_WriteLog('window lost focus!', MSG_NOTIFY);
+ end;
end;
-
+
if wDeactivate then
begin
if gWinActive then
begin
+ e_WriteLog('deactivating window', MSG_NOTIFY);
e_EnableInput := False;
e_ClearInputBuffer();
if gMuteWhenInactive then
+ begin
+ //e_WriteLog('deactivating sounds', MSG_NOTIFY);
e_MuteChannels(True);
+ end;
if g_debug_WinMsgs then
begin
begin
if not gWinActive then
begin
+ //e_WriteLog('activating window', MSG_NOTIFY);
e_EnableInput := True;
if gMuteWhenInactive then
+ begin
+ //e_WriteLog('activating sounds', MSG_NOTIFY);
e_MuteChannels(False);
+ end;
if g_debug_WinMsgs then
begin
if h_GL <> nil then SDL_GL_DeleteContext(h_GL);
h_Wnd := nil;
h_GL := nil;
- wWindowCreated := False;
+ //wWindowCreated := False;
end;
function CreateGLWindow(Title: PChar): Boolean;
h_Gl := SDL_GL_CreateContext(h_Wnd);
if h_Gl = nil then Exit;
-
- wWindowCreated := True;
+
+ //wWindowCreated := True;
e_ResizeWindow(gScreenWidth, gScreenHeight);
e_InitGL();