197 TByteArray = array[0..32767] of Byte; |
197 TByteArray = array[0..32767] of Byte; |
198 |
198 |
199 PSDL_Thread = Pointer; |
199 PSDL_Thread = Pointer; |
200 PSDL_mutex = Pointer; |
200 PSDL_mutex = Pointer; |
201 |
201 |
202 function SDL_Init(flags: Longword): Integer; cdecl; external SDLLibName; |
202 function SDL_Init(flags: Longword): LongInt; cdecl; external SDLLibName; |
203 procedure SDL_Quit; cdecl; external SDLLibName; |
203 procedure SDL_Quit; cdecl; external SDLLibName; |
204 |
204 |
205 procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName; |
205 procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName; |
206 function SDL_GetTicks: Longword; cdecl; external SDLLibName; |
206 function SDL_GetTicks: Longword; cdecl; external SDLLibName; |
207 |
207 |
208 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
208 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
209 function SDL_LockSurface(Surface: PSDL_Surface): Integer; cdecl; external SDLLibName; |
209 function SDL_LockSurface(Surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
210 procedure SDL_UnlockSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
210 procedure SDL_UnlockSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
211 |
211 |
212 function SDL_GetError: PChar; cdecl; external SDLLibName; |
212 function SDL_GetError: PChar; cdecl; external SDLLibName; |
213 |
213 |
214 function SDL_SetVideoMode(width, height, bpp: Integer; flags: Longword): PSDL_Surface; cdecl; external SDLLibName; |
214 function SDL_SetVideoMode(width, height, bpp: LongInt; flags: Longword): PSDL_Surface; cdecl; external SDLLibName; |
215 function SDL_CreateRGBSurface(flags: Longword; Width, Height, Depth: Integer; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
215 function SDL_CreateRGBSurface(flags: Longword; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
216 function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: Integer; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
216 function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
217 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
217 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
218 function SDL_SetColorKey(surface: PSDL_Surface; flag, key: Longword): Integer; cdecl; external SDLLibName; |
218 function SDL_SetColorKey(surface: PSDL_Surface; flag, key: Longword): LongInt; cdecl; external SDLLibName; |
219 |
219 |
220 function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): Integer; cdecl; external SDLLibName; |
220 function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
221 function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: Longword): Integer; cdecl; external SDLLibName; |
221 function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: Longword): LongInt; cdecl; external SDLLibName; |
222 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: Integer; w, h: Longword); cdecl; external SDLLibName; |
222 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: Longword); cdecl; external SDLLibName; |
223 function SDL_Flip(Screen: PSDL_Surface): Integer; cdecl; external SDLLibName; |
223 function SDL_Flip(Screen: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
224 |
224 |
225 procedure SDL_GetRGB(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; |
225 procedure SDL_GetRGB(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; |
226 function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): Integer; cdecl; external SDLLibName; |
226 function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): LongInt; cdecl; external SDLLibName; |
227 |
227 |
228 function SDL_DisplayFormat(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
228 function SDL_DisplayFormat(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
229 function SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
229 function SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
230 |
230 |
231 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
231 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
232 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: Integer): Integer; cdecl; external SDLLibName; |
232 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName; |
233 |
233 |
234 function SDL_GetKeyState(numkeys: PInteger): PByteArray; cdecl; external SDLLibName; |
234 function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName; |
235 function SDL_GetMouseState(x, y: PInteger): Byte; cdecl; external SDLLibName; |
235 function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
236 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
236 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
237 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
237 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
238 |
238 |
239 function SDL_PollEvent(event: PSDL_Event): Integer; cdecl; external SDLLibName; |
239 function SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
240 |
240 |
241 function SDL_ShowCursor(toggle: Integer): Integer; cdecl; external SDLLibName; |
241 function SDL_ShowCursor(toggle: LongInt): LongInt; cdecl; external SDLLibName; |
242 |
242 |
243 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; |
243 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; |
244 |
244 |
245 function SDL_CreateThread(fn: pointer; data: pointer): PSDL_Thread; cdecl; external SDLLibName; |
245 function SDL_CreateThread(fn: pointer; data: pointer): PSDL_Thread; cdecl; external SDLLibName; |
246 procedure SDL_WaitThread(thread: PSDL_Thread; status: PInteger); cdecl; external SDLLibName; |
246 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName; |
247 function SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName; |
247 function SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName; |
248 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName; |
248 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName; |
249 function SDL_LockMutex(mutex: PSDL_mutex): integer; cdecl; external SDLLibName name 'SDL_mutexP'; |
249 function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; |
250 function SDL_UnlockMutex(mutex: PSDL_mutex): integer; cdecl; external SDLLibName name 'SDL_mutexV'; |
250 function SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV'; |
251 |
251 |
252 (* TTF *) |
252 (* TTF *) |
253 |
253 |
254 const {$IFDEF WIN32} |
254 const {$IFDEF WIN32} |
255 SDL_TTFLibName = 'SDL_ttf.dll'; |
255 SDL_TTFLibName = 'SDL_ttf.dll'; |
308 data : TMusicUnion; |
308 data : TMusicUnion; |
309 fading : TMix_Fading; |
309 fading : TMix_Fading; |
310 fade_volume, |
310 fade_volume, |
311 fade_step, |
311 fade_step, |
312 fade_steps, |
312 fade_steps, |
313 error : integer; |
313 error : LongInt; |
314 end; |
314 end; |
315 |
315 |
316 function Mix_OpenAudio(frequency: integer; format: Word; channels: integer; chunksize: integer): integer; cdecl; external SDL_MixerLibName; |
316 function Mix_OpenAudio(frequency: LongInt; format: Word; channels: LongInt; chunksize: LongInt): LongInt; cdecl; external SDL_MixerLibName; |
317 procedure Mix_CloseAudio; cdecl; external SDL_MixerLibName; |
317 procedure Mix_CloseAudio; cdecl; external SDL_MixerLibName; |
318 |
318 |
319 function Mix_VolumeMusic(volume: integer): integer; cdecl; external SDL_MixerLibName; |
319 function Mix_VolumeMusic(volume: LongInt): LongInt; cdecl; external SDL_MixerLibName; |
320 |
320 |
321 function Mix_AllocateChannels(numchans: integer): integer; cdecl; external SDL_MixerLibName; |
321 function Mix_AllocateChannels(numchans: LongInt): LongInt; cdecl; external SDL_MixerLibName; |
322 procedure Mix_FreeChunk(chunk: PMixChunk); cdecl; external SDL_MixerLibName; |
322 procedure Mix_FreeChunk(chunk: PMixChunk); cdecl; external SDL_MixerLibName; |
323 procedure Mix_FreeMusic(music: PMixMusic); cdecl; external SDL_MixerLibName; |
323 procedure Mix_FreeMusic(music: PMixMusic); cdecl; external SDL_MixerLibName; |
324 |
324 |
325 function Mix_LoadWAV_RW(src: PSDL_RWops; freesrc: integer): PMixChunk; cdecl; external SDL_MixerLibName; |
325 function Mix_LoadWAV_RW(src: PSDL_RWops; freesrc: LongInt): PMixChunk; cdecl; external SDL_MixerLibName; |
326 function Mix_LoadMUS(const filename: PChar): PMixMusic; cdecl; external SDL_MixerLibName; |
326 function Mix_LoadMUS(const filename: PChar): PMixMusic; cdecl; external SDL_MixerLibName; |
327 |
327 |
328 function Mix_Playing(channel: integer): integer; cdecl; external SDL_MixerLibName; |
328 function Mix_Playing(channel: LongInt): LongInt; cdecl; external SDL_MixerLibName; |
329 function Mix_PlayingMusic: integer; cdecl; external SDL_MixerLibName; |
329 function Mix_PlayingMusic: LongInt; cdecl; external SDL_MixerLibName; |
330 |
330 |
331 function Mix_PlayChannelTimed(channel: integer; chunk: PMixChunk; loops: integer; ticks: integer): integer; cdecl; external SDL_MixerLibName; |
331 function Mix_PlayChannelTimed(channel: LongInt; chunk: PMixChunk; loops: LongInt; ticks: LongInt): LongInt; cdecl; external SDL_MixerLibName; |
332 function Mix_PlayMusic(music: PMixMusic; loops: integer): integer; cdecl; external SDL_MixerLibName; |
332 function Mix_PlayMusic(music: PMixMusic; loops: LongInt): LongInt; cdecl; external SDL_MixerLibName; |
333 function Mix_HaltChannel(channel: integer): integer; cdecl; external SDL_MixerLibName; |
333 function Mix_HaltChannel(channel: LongInt): LongInt; cdecl; external SDL_MixerLibName; |
334 |
334 |
335 (* SDL_image *) |
335 (* SDL_image *) |
336 |
336 |
337 const {$IFDEF WIN32} |
337 const {$IFDEF WIN32} |
338 SDL_ImageLibName = 'SDL_image.dll'; |
338 SDL_ImageLibName = 'SDL_image.dll'; |
358 end; |
358 end; |
359 |
359 |
360 PTCPSocket = ^TTCPSocket; |
360 PTCPSocket = ^TTCPSocket; |
361 TTCPSocket = record |
361 TTCPSocket = record |
362 ready, |
362 ready, |
363 channel: integer; |
363 channel: LongInt; |
364 remoteAddress, |
364 remoteAddress, |
365 localAddress: TIPaddress; |
365 localAddress: TIPaddress; |
366 sflag: integer; |
366 sflag: LongInt; |
367 end; |
367 end; |
368 PSDLNet_SocketSet = ^TSDLNet_SocketSet; |
368 PSDLNet_SocketSet = ^TSDLNet_SocketSet; |
369 TSDLNet_SocketSet = record |
369 TSDLNet_SocketSet = record |
370 numsockets, |
370 numsockets, |
371 maxsockets: integer; |
371 maxsockets: LongInt; |
372 sockets: PTCPSocket; |
372 sockets: PTCPSocket; |
373 end; |
373 end; |
374 |
374 |
375 function SDLNet_Init: integer; cdecl; external SDL_NetLibName; |
375 function SDLNet_Init: LongInt; cdecl; external SDL_NetLibName; |
376 procedure SDLNet_Quit; cdecl; external SDL_NetLibName; |
376 procedure SDLNet_Quit; cdecl; external SDL_NetLibName; |
377 |
377 |
378 function SDLNet_AllocSocketSet(maxsockets: integer): PSDLNet_SocketSet; cdecl; external SDL_NetLibName; |
378 function SDLNet_AllocSocketSet(maxsockets: LongInt): PSDLNet_SocketSet; cdecl; external SDL_NetLibName; |
379 function SDLNet_ResolveHost(var address: TIPaddress; host: PCHar; port: Word): integer; cdecl; external SDL_NetLibName; |
379 function SDLNet_ResolveHost(var address: TIPaddress; host: PCHar; port: Word): LongInt; cdecl; external SDL_NetLibName; |
380 function SDLNet_TCP_Accept(server: PTCPsocket): PTCPSocket; cdecl; external SDL_NetLibName; |
380 function SDLNet_TCP_Accept(server: PTCPsocket): PTCPSocket; cdecl; external SDL_NetLibName; |
381 function SDLNet_TCP_Open(var ip: TIPaddress): PTCPSocket; cdecl; external SDL_NetLibName; |
381 function SDLNet_TCP_Open(var ip: TIPaddress): PTCPSocket; cdecl; external SDL_NetLibName; |
382 function SDLNet_TCP_Send(sock: PTCPsocket; data: Pointer; len: integer): integer; cdecl; external SDL_NetLibName; |
382 function SDLNet_TCP_Send(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName; |
383 function SDLNet_TCP_Recv(sock: PTCPsocket; data: Pointer; len: integer): integer; cdecl; external SDL_NetLibName; |
383 function SDLNet_TCP_Recv(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName; |
384 procedure SDLNet_TCP_Close(sock: PTCPsocket); cdecl; external SDL_NetLibName; |
384 procedure SDLNet_TCP_Close(sock: PTCPsocket); cdecl; external SDL_NetLibName; |
385 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName; |
385 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName; |
386 function SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): integer; cdecl; external SDL_NetLibName; |
386 function SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): LongInt; cdecl; external SDL_NetLibName; |
387 function SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: integer): integer; cdecl; external SDL_NetLibName; |
387 function SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName; |
388 |
388 |
389 |
389 |
390 implementation |
390 implementation |
391 |
391 |
392 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
392 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |