189 PByteArray = ^TByteArray; |
186 PByteArray = ^TByteArray; |
190 TByteArray = array[0..65535] of Byte; |
187 TByteArray = array[0..65535] of Byte; |
191 PLongWordArray = ^TLongWordArray; |
188 PLongWordArray = ^TLongWordArray; |
192 TLongWordArray = array[0..16383] of LongWord; |
189 TLongWordArray = array[0..16383] of LongWord; |
193 |
190 |
194 function SDL_Init(flags: Longword): integer; cdecl; external SDLLibName; |
191 function SDL_Init(flags: Longword): LongInt; cdecl; external SDLLibName; |
195 procedure SDL_Quit; cdecl; external SDLLibName; |
192 procedure SDL_Quit; cdecl; external SDLLibName; |
196 function SDL_VideoDriverName(var namebuf; maxlen: integer): PChar; cdecl; external SDLLibName; |
193 function SDL_VideoDriverName(var namebuf; maxlen: LongInt): PChar; cdecl; external SDLLibName; |
197 procedure SDL_EnableUNICODE(enable: integer); cdecl; external SDLLibName; |
194 procedure SDL_EnableUNICODE(enable: LongInt); cdecl; external SDLLibName; |
198 |
195 |
199 procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName; |
196 procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName; |
200 function SDL_GetTicks: Longword; cdecl; external SDLLibName; |
197 function SDL_GetTicks: Longword; cdecl; external SDLLibName; |
201 |
198 |
202 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
199 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
203 function SDL_LockSurface(Surface: PSDL_Surface): integer; cdecl; external SDLLibName; |
200 function SDL_LockSurface(Surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
204 procedure SDL_UnlockSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
201 procedure SDL_UnlockSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
205 |
202 |
206 function SDL_GetError: PChar; cdecl; external SDLLibName; |
203 function SDL_GetError: PChar; cdecl; external SDLLibName; |
207 |
204 |
208 function SDL_SetVideoMode(width, height, bpp: integer; flags: Longword): PSDL_Surface; cdecl; external SDLLibName; |
205 function SDL_SetVideoMode(width, height, bpp: LongInt; flags: Longword): PSDL_Surface; cdecl; external SDLLibName; |
209 function SDL_CreateRGBSurface(flags: Longword; Width, Height, Depth: integer; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
206 function SDL_CreateRGBSurface(flags: Longword; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
210 function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: integer; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
207 function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
211 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
208 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
212 function SDL_SetColorKey(surface: PSDL_Surface; flag, key: Longword): LongInt; cdecl; external SDLLibName; |
209 function SDL_SetColorKey(surface: PSDL_Surface; flag, key: Longword): LongInt; cdecl; external SDLLibName; |
213 |
210 |
214 function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
211 function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
215 function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: Longword): LongInt; cdecl; external SDLLibName; |
212 function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: Longword): LongInt; cdecl; external SDLLibName; |
216 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: Longword); cdecl; external SDLLibName; |
213 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: Longword); cdecl; external SDLLibName; |
217 function SDL_Flip(Screen: PSDL_Surface): integer; cdecl; external SDLLibName; |
214 function SDL_Flip(Screen: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
218 |
215 |
219 procedure SDL_GetRGB(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; |
216 procedure SDL_GetRGB(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; |
220 function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): Longword; cdecl; external SDLLibName; |
217 function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): Longword; cdecl; external SDLLibName; |
221 |
218 |
222 function SDL_DisplayFormat(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
219 function SDL_DisplayFormat(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
223 function SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
220 function SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
224 |
221 |
225 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
222 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
226 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: integer): integer; cdecl; external SDLLibName; |
223 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName; |
227 |
224 |
228 function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName; |
225 function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName; |
229 function SDL_GetMouseState(x, y: PInteger): Byte; cdecl; external SDLLibName; |
226 function SDL_GetMouseState(x, y: PInteger): Byte; cdecl; external SDLLibName; |
230 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
227 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
231 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
228 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
232 |
229 |
233 function SDL_PollEvent(event: PSDL_Event): integer; cdecl; external SDLLibName; |
230 function SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
234 |
231 |
235 function SDL_ShowCursor(toggle: integer): integer; cdecl; external SDLLibName; |
232 function SDL_ShowCursor(toggle: LongInt): LongInt; cdecl; external SDLLibName; |
236 |
233 |
237 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; |
234 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; |
238 |
235 |
239 (* TTF *) |
236 (* TTF *) |
240 |
237 |
250 |
247 |
251 type PTTF_Font = ^TTTF_font; |
248 type PTTF_Font = ^TTTF_font; |
252 TTTF_Font = record |
249 TTTF_Font = record |
253 end; |
250 end; |
254 |
251 |
255 function TTF_Init: integer; cdecl; external SDL_TTFLibName; |
252 function TTF_Init: LongInt; cdecl; external SDL_TTFLibName; |
256 procedure TTF_Quit; cdecl; external SDL_TTFLibName; |
253 procedure TTF_Quit; cdecl; external SDL_TTFLibName; |
257 |
254 |
258 |
255 |
259 function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; var w, h: integer): integer; cdecl; external SDL_TTFLibName; |
256 function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; var w, h: LongInt): LongInt; cdecl; external SDL_TTFLibName; |
260 (* TSDL_Color -> Longword conversion is workaround over freepascal bug. |
257 (* TSDL_Color -> Longword conversion is workaround over freepascal bug. |
261 See http://www.freepascal.org/mantis/view.php?id=7613 for details *) |
258 See http://www.freepascal.org/mantis/view.php?id=7613 for details *) |
262 function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName; |
259 function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName; |
263 function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName; |
260 function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName; |
264 |
261 |
265 function TTF_OpenFont(const filename: PChar; size: integer): PTTF_Font; cdecl; external SDL_TTFLibName; |
262 function TTF_OpenFont(const filename: PChar; size: LongInt): PTTF_Font; cdecl; external SDL_TTFLibName; |
266 procedure TTF_SetFontStyle(font: PTTF_Font; style: integer); cdecl; external SDL_TTFLibName; |
263 procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName; |
267 |
264 |
268 (* SDL_mixer *) |
265 (* SDL_mixer *) |
269 |
266 |
270 const {$IFDEF WIN32} |
267 const {$IFDEF WIN32} |
271 SDL_MixerLibName = 'SDL_mixer.dll'; |
268 SDL_MixerLibName = 'SDL_mixer.dll'; |