179 if prevFocusState xor cHasFocus then |
179 if prevFocusState xor cHasFocus then |
180 onFocusStateChanged() |
180 onFocusStateChanged() |
181 end; |
181 end; |
182 SDL_VIDEORESIZE: begin |
182 SDL_VIDEORESIZE: begin |
183 // using lower values causes widget overlap and video issues |
183 // using lower values causes widget overlap and video issues |
184 cScreenWidth:= max(event.resize.w, cMinScreenWidth); |
184 cNewScreenWidth:= max(event.resize.w, cMinScreenWidth); |
185 cScreenHeight:= max(event.resize.h, cMinScreenHeight); |
185 cNewScreenHeight:= max(event.resize.h, cMinScreenHeight); |
186 |
186 cScreenResizeDelay:= RealTicks+500; |
187 ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true); |
|
188 WriteLnToConsole('window resize'); |
|
189 InitCameraBorders(); |
|
190 end; |
187 end; |
191 {$ENDIF} |
188 {$ENDIF} |
192 SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
189 SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
193 SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
190 SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
194 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
191 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
195 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
192 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
196 SDL_QUITEV: isTerminated:= true |
193 SDL_QUITEV: isTerminated:= true |
197 end; //end case event.type_ of |
194 end; //end case event.type_ of |
198 end; //end while SDL_PollEvent(@event) <> 0 do |
195 end; //end while SDL_PollEvent(@event) <> 0 do |
|
196 if (cScreenResizeDelay <> 0) and (cScreenResizeDelay < RealTicks) and ((cNewScreenWidth <> cScreenWidth) or (cNewScreenHeight <> cScreenHeight)) then |
|
197 begin |
|
198 cScreenResizeDelay:= 0; |
|
199 cScreenWidth:= cNewScreenWidth; |
|
200 cScreenHeight:= cNewScreenHeight; |
|
201 |
|
202 ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true); |
|
203 WriteLnToConsole('window resize'); |
|
204 InitCameraBorders() |
|
205 end; |
199 |
206 |
200 if isTerminated = false then |
207 if isTerminated = false then |
201 begin |
208 begin |
202 CurrTime:= SDL_GetTicks; |
209 CurrTime:= SDL_GetTicks; |
203 if PrevTime + longword(cTimerInterval) <= CurrTime then |
210 if PrevTime + longword(cTimerInterval) <= CurrTime then |