|
From: <c99...@us...> - 2006-11-25 20:54:00
|
Revision: 384
http://svn.sourceforge.net/cadcdev/?rev=384&view=rev
Author: c99koder
Date: 2006-11-25 12:53:55 -0800 (Sat, 25 Nov 2006)
Log Message:
-----------
Tiki: win32: don't close window until process actually ends (like Mac OS X), make sure main thread terminates when GameThread does so the process actually quits on win32
Modified Paths:
--------------
tiki/win32/src/platgl.cpp
Modified: tiki/win32/src/platgl.cpp
===================================================================
--- tiki/win32/src/platgl.cpp 2006-11-24 17:38:32 UTC (rev 383)
+++ tiki/win32/src/platgl.cpp 2006-11-25 20:53:55 UTC (rev 384)
@@ -103,7 +103,7 @@
m_hThread = CreateThread(NULL, 0, GameThread, lpCmdLine, 0, &m_dwThreadID);
- while(GetMessage(&msg, NULL, 0, 0))
+ while(m_hThread != NULL && GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
@@ -131,9 +131,11 @@
case WM_RBUTTONUP:
Tiki::RecvEvent(iMsg, wParam, lParam);
break;
-
+ case WM_CLOSE:
+ Tiki::RecvQuit();
+ return 0;
+ break;
case WM_DESTROY:
- Tiki::RecvQuit();
DestroyApplication();
PostQuitMessage(0);
break;
@@ -224,6 +226,7 @@
if(!CloseHandle(m_hThread))
ErrorBox("Couldn't terminate game thread.");
+ m_hThread = NULL;
Tiki::shutdown();
return TRUE;
@@ -275,7 +278,7 @@
wglDeleteContext(m_hThreadRc);
ReleaseDC(m_hWndMain, m_hThreadDc);
m_hThreadDc = NULL;
-
+ m_hThread = NULL;
Debug::printf( "GameThread exiting\n" );
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|