hedgewars/hwengine.pas
changeset 6598 fa518383563b
parent 6580 6155187bf599
child 6603 ef9ed71e3cf7
equal deleted inserted replaced
6597:814683bbd230 6598:fa518383563b
   165 begin
   165 begin
   166     PrevTime:= SDL_GetTicks;
   166     PrevTime:= SDL_GetTicks;
   167     while isTerminated = false do
   167     while isTerminated = false do
   168     begin
   168     begin
   169         SDL_PumpEvents();
   169         SDL_PumpEvents();
       
   170  
   170         while SDL_PeepEvents(@event, 1, SDL_GETEVENT, {$IFDEF SDL13}SDL_FIRSTEVENT, SDL_LASTEVENT{$ELSE}SDL_ALLEVENTS{$ENDIF}) > 0 do
   171         while SDL_PeepEvents(@event, 1, SDL_GETEVENT, {$IFDEF SDL13}SDL_FIRSTEVENT, SDL_LASTEVENT{$ELSE}SDL_ALLEVENTS{$ENDIF}) > 0 do
   171         begin
   172         begin
   172             case event.type_ of
   173             case event.type_ of
   173 {$IFDEF SDL13}
   174 {$IFDEF SDL13}
   174                 SDL_KEYDOWN:
   175                 SDL_KEYDOWN:
   188                         GameState:= gsSuspend;
   189                         GameState:= gsSuspend;
   189                         end
   190                         end
   190                     else if event.window.event = SDL_WINDOWEVENT_RESTORED then
   191                     else if event.window.event = SDL_WINDOWEVENT_RESTORED then
   191                         begin
   192                         begin
   192                         GameState:= previousGameState;
   193                         GameState:= previousGameState;
       
   194 {$IFDEF ANDROID}        //This call is used to reinitialize the glcontext and reload the textures
       
   195                         ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
       
   196 {$ENDIF}
   193                         end
   197                         end
   194                     else if event.window.event = SDL_WINDOWEVENT_RESIZED then
   198                     else if event.window.event = SDL_WINDOWEVENT_RESIZED then
   195                         begin
   199                         begin
   196                         // way too broken right now
   200                         // way too broken right now
   197                         (*
   201                         (*
   289     s: shortstring;
   293     s: shortstring;
   290     i: LongInt;
   294     i: LongInt;
   291 begin
   295 begin
   292 {$IFDEF HWLIBRARY}
   296 {$IFDEF HWLIBRARY}
   293     cBits:= 32;
   297     cBits:= 32;
   294     cFullScreen:= false;
   298     cFullScreen:= true;
   295     cTimerInterval:= 8;
   299     cTimerInterval:= 8;
   296     cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF};
   300     cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF};
   297     val(gameArgs[0], ipcPort);
   301     val(gameArgs[0], ipcPort);
   298     val(gameArgs[1], cScreenWidth);
   302     val(gameArgs[1], cScreenWidth);
   299     val(gameArgs[2], cScreenHeight);
   303     val(gameArgs[2], cScreenHeight);