simplify quitting
This commit is contained in:
@@ -516,8 +516,7 @@ static void HandleInputEvents(float fDeltaTime)
|
|||||||
|
|
||||||
void GameLoop()
|
void GameLoop()
|
||||||
{
|
{
|
||||||
bool do_exit = false;
|
while(1)
|
||||||
while(!do_exit)
|
|
||||||
{
|
{
|
||||||
// process all queued events
|
// process all queued events
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
@@ -526,8 +525,7 @@ void GameLoop()
|
|||||||
switch(event.type)
|
switch(event.type)
|
||||||
{
|
{
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
do_exit = 1;
|
return; /* exit the main loop */
|
||||||
break;
|
|
||||||
case SDL_VIDEORESIZE:
|
case SDL_VIDEORESIZE:
|
||||||
PREFSMAN->m_iDisplayWidth = event.resize.w;
|
PREFSMAN->m_iDisplayWidth = event.resize.w;
|
||||||
PREFSMAN->m_iDisplayHeight = event.resize.h;
|
PREFSMAN->m_iDisplayHeight = event.resize.h;
|
||||||
|
|||||||
Reference in New Issue
Block a user