106 {$IFDEF SDL13} |
104 {$IFDEF SDL13} |
107 SDL_RenderPresent(); |
105 SDL_RenderPresent(); |
108 {$ELSE} |
106 {$ELSE} |
109 SDL_GL_SwapBuffers(); |
107 SDL_GL_SwapBuffers(); |
110 {$ENDIF} |
108 {$ENDIF} |
111 {$IFNDEF IPHONEOS} |
|
112 // not going to make captures on the iPhone |
109 // not going to make captures on the iPhone |
113 if flagMakeCapture then |
110 if flagMakeCapture then |
114 begin |
111 begin |
115 flagMakeCapture:= false; |
112 flagMakeCapture:= false; |
116 s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks); |
113 s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks); |
117 WriteLnToConsole('Saving ' + s + '...'); |
114 WriteLnToConsole('Saving ' + s + '...'); |
118 MakeScreenshot(s); |
115 MakeScreenshot(s); |
119 //SDL_SaveBMP_RW(SDLPrimSurface, SDL_RWFromFile(Str2PChar(s), 'wb'), 1) |
116 //SDL_SaveBMP_RW(SDLPrimSurface, SDL_RWFromFile(Str2PChar(s), 'wb'), 1) |
120 end; |
117 end; |
121 {$ENDIF} |
|
122 end; |
118 end; |
123 |
119 |
124 //////////////////// |
120 //////////////////// |
125 procedure OnDestroy; |
121 procedure OnDestroy; |
126 begin |
122 begin |
155 {$IFDEF IPHONEOS} |
151 {$IFDEF IPHONEOS} |
156 // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3 |
152 // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3 |
157 KeyPressChat(event.key.keysym.sym); |
153 KeyPressChat(event.key.keysym.sym); |
158 {$ELSE} |
154 {$ELSE} |
159 KeyPressChat(event.key.keysym.unicode); |
155 KeyPressChat(event.key.keysym.unicode); |
|
156 SDL_MOUSEBUTTONDOWN: if event.button.button = SDL_BUTTON_WHEELDOWN then uKeys.wheelDown:= true; |
|
157 SDL_MOUSEBUTTONUP: if event.button.button = SDL_BUTTON_WHEELUP then uKeys.wheelUp:= true; |
160 {$ENDIF} |
158 {$ENDIF} |
161 {$IFDEF SDL13} |
159 {$IFDEF SDL13} |
162 SDL_WINDOWEVENT: |
160 SDL_WINDOWEVENT: |
163 if event.wevent.event = SDL_WINDOWEVENT_SHOWN then |
161 if event.wevent.event = SDL_WINDOWEVENT_SHOWN then |
164 cHasFocus:= true; |
162 cHasFocus:= true; |
165 {$ELSE} |
163 {$ELSE} |
166 SDL_ACTIVEEVENT: |
164 SDL_ACTIVEEVENT: |
167 if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then |
165 if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then |
168 cHasFocus:= event.active.gain = 1; |
166 cHasFocus:= event.active.gain = 1; |
169 {$ENDIF} |
|
170 {$IFNDEF IPHONEOS} |
|
171 SDL_MOUSEBUTTONDOWN: if event.button.button = SDL_BUTTON_WHEELDOWN then uKeys.wheelDown:= true; |
|
172 SDL_MOUSEBUTTONUP: if event.button.button = SDL_BUTTON_WHEELUP then uKeys.wheelUp:= true; |
|
173 {$ENDIF} |
167 {$ENDIF} |
174 SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
168 SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
175 SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
169 SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
176 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
170 SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
177 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
171 SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |