* remove win32 constraint so it compiles on win64 and possibly others later too

git-svn-id: trunk@6876 -
This commit is contained in:
Almindor 2007-03-16 10:30:19 +00:00
parent 9aebd665a9
commit a56aa776bb
11 changed files with 2075 additions and 2074 deletions

View File

@ -119,7 +119,7 @@
{$ELSE}
{$DEFINE __OS_DOS__}
{$ENDIF}
{$IFDEF WIN32}
{$IFDEF windows}
{$DEFINE UseWin}
{$ENDIF}
@ -129,13 +129,13 @@
{$DEFINE OS_BigMem}
{$ENDIF OS2}
{$IFDEF Win32}
{$IFDEF windows}
{$DEFINE OS_BigMem}
{$ELSE Win32}
{$ELSE windows}
{$IFDEF ver70}
{$DEFINE assembler}
{$ENDIF} { use 16-bit assembler! }
{$ENDIF Win32}
{$ENDIF windows}
{ ************************** dos/dos-like platforms **************}
{$IFDEF Windows}

View File

@ -59,7 +59,7 @@ interface
// each OS gets its own IFDEFed complete code block to make reading easier
{$IFDEF WIN32}
{$IFDEF windows}
uses
Windows;

View File

@ -244,7 +244,7 @@ unit sdl;
interface
uses
{$IFDEF WIN32}
{$IFDEF windows}
Windows;
{$ENDIF}
@ -265,7 +265,7 @@ uses
{$ENDIF}
const
{$IFDEF WIN32}
{$IFDEF windows}
SDLLibName = 'SDL.dll';
{$ENDIF}
@ -1660,7 +1660,7 @@ type
{$ENDIF}
// The windows custom event structure
{$IFDEF Win32}
{$IFDEF windows}
PSDL_SysWMmsg = ^TSDL_SysWMmsg;
TSDL_SysWMmsg = record
version: TSDL_version;
@ -1695,7 +1695,7 @@ type
{$ENDIF}
// The Windows custom window manager information structure
{$IFDEF Win32}
{$IFDEF windows}
PSDL_SysWMinfo = ^TSDL_SysWMinfo;
TSDL_SysWMinfo = record
version : TSDL_version;
@ -1824,7 +1824,7 @@ type
alpha: UInt8; // Alpha value information (per-surface alpha)
end;
{$IFDEF WIN32}
{$IFDEF windows}
{PPrivate_hwdata = ^TPrivate_hwdata;
TPrivate_hwdata = record
dd_surface : IDIRECTDRAWSURFACE3;
@ -1972,7 +1972,7 @@ type
// SDL_mutex.h types
{$IFDEF WIN32}
{$IFDEF windows}
PSDL_Mutex = ^TSDL_Mutex;
TSDL_Mutex = record
id: THANDLE;
@ -1997,8 +1997,8 @@ type
{$ENDIF}
PSDL_semaphore = ^TSDL_semaphore;
{$IFDEF WIN32}
// Win32 or Machintosh
{$IFDEF windows}
// windows or Machintosh
TSDL_semaphore = record
id: THANDLE;
count: UInt32;
@ -2050,7 +2050,7 @@ PSDL_semaphore = ^TSDL_semaphore;
end;
// SDL_thread.h types
{$IFDEF WIN32}
{$IFDEF windows}
TSYS_ThreadHandle = THandle;
{$ENDIF}
@ -2140,7 +2140,7 @@ procedure SDL_Quit;
cdecl; external {$IFDEF __GPC__}name 'SDL_Quit'{$ELSE} SDLLibName{$ENDIF __GPC__};
{$EXTERNALSYM SDL_Quit}
{$IFDEF WIN32}
{$IFDEF windows}
// This should be called from your WinMain() function, if any
function SDL_RegisterApp(name: PChar; style: UInt32; h_Inst: Pointer): Integer;
cdecl; external {$IFDEF __GPC__}name 'SDL_RegisterApp'{$ELSE} SDLLibName{$ENDIF __GPC__};
@ -2177,7 +2177,7 @@ procedure SDL_ClearError;
cdecl; external {$IFDEF __GPC__}name 'SDL_ClearError'{$ELSE} SDLLibName{$ENDIF __GPC__};
{$EXTERNALSYM SDL_ClearError}
{$IFNDEF WIN32}
{$IFNDEF windows}
procedure SDL_Error(Code: TSDL_errorcode);
cdecl; external {$IFDEF __GPC__}name 'SDL_Error'{$ELSE} SDLLibName{$ENDIF __GPC__};
{$EXTERNALSYM SDL_Error}
@ -2766,7 +2766,7 @@ cdecl; external {$IFDEF __GPC__}name 'SDL_Linked_Version'{$ELSE} SDLLibName{$END
Note that event handling is activated by this routine.
If you use both sound and video in your application, you need to call
SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
SDL_Init() before opening the sound device, otherwise under windows DirectX,
you won't be able to set full-screen display modes. }
function SDL_VideoInit(driver_name: PChar; flags: UInt32): Integer;
@ -3739,7 +3739,7 @@ cdecl; external {$IFDEF __GPC__}name 'SDL_KillThread'{$ELSE} SDLLibName{$ENDIF _
{------------------------------------------------------------------------------}
{ Get Environment Routines }
{------------------------------------------------------------------------------}
{$IFDEF WIN32}
{$IFDEF windows}
function _putenv( const variable : Pchar ): integer;
cdecl;
{$ENDIF}
@ -3761,7 +3761,7 @@ function SDL_putenv(const variable: PChar): integer;
//function putenv(const variable: PChar): integer;
//{$EXTERNALSYM putenv}
{$IFDEF WIN32}
{$IFDEF windows}
{$IFNDEF __GPC__}
function getenv( const name : Pchar ): PChar; cdecl;
{$ENDIF}
@ -3850,7 +3850,7 @@ end;
procedure SDL_OutOfMemory;
begin
{$IFNDEF WIN32}
{$IFNDEF windows}
SDL_Error(SDL_ENOMEM);
{$ENDIF}
end;
@ -4016,7 +4016,7 @@ begin
Result := SDL_mutexV(mutex);
end;
{$IFDEF WIN32}
{$IFDEF windows}
function _putenv( const variable : Pchar ): Integer;
cdecl; external {$IFDEF __GPC__}name '_putenv'{$ELSE} 'MSVCRT.DLL'{$ENDIF __GPC__};
{$ENDIF}
@ -4024,7 +4024,7 @@ cdecl; external {$IFDEF __GPC__}name '_putenv'{$ELSE} 'MSVCRT.DLL'{$ENDIF __GPC_
function SDL_putenv(const variable: PChar): Integer;
begin
{$IFDEF WIN32}
{$IFDEF windows}
Result := _putenv(variable);
{$ENDIF}
@ -4037,7 +4037,7 @@ begin
{$ENDIF}
end;
{$IFDEF WIN32}
{$IFDEF windows}
{$IFNDEF __GPC__}
function getenv( const name : Pchar ): PChar;
cdecl; external {$IFDEF __GPC__}name 'getenv'{$ELSE} 'MSVCRT.DLL'{$ENDIF};
@ -4046,7 +4046,7 @@ cdecl; external {$IFDEF __GPC__}name 'getenv'{$ELSE} 'MSVCRT.DLL'{$ENDIF};
function SDL_getenv(const name: PChar): PChar;
begin
{$IFDEF WIN32}
{$IFDEF windows}
{$IFDEF __GPC__}
Result := getenv( string( name ) );

File diff suppressed because it is too large Load Diff

View File

@ -1,284 +1,285 @@
unit sdl_image;
{
$Id: sdl_image.pas,v 1.7 2005/01/01 02:03:12 savage Exp $
}
{******************************************************************************}
{ }
{ Borland Delphi SDL_Image - An example image loading library for use }
{ with SDL }
{ Conversion of the Simple DirectMedia Layer Image Headers }
{ }
{ Portions created by Sam Lantinga <slouken@devolution.com> are }
{ Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga }
{ 5635-34 Springhouse Dr. }
{ Pleasanton, CA 94588 (USA) }
{ }
{ All Rights Reserved. }
{ }
{ The original files are : SDL_image.h }
{ }
{ The initial developer of this Pascal code was : }
{ Matthias Thoma <ma.thoma@gmx.de> }
{ }
{ Portions created by Matthias Thoma are }
{ Copyright (C) 2000 - 2001 Matthias Thoma. }
{ }
{ }
{ Contributor(s) }
{ -------------- }
{ Dominique Louis <Dominique@SavageSoftware.com.au> }
{ }
{ Obtained through: }
{ Joint Endeavour of Delphi Innovators ( Project JEDI ) }
{ }
{ You may retrieve the latest version of this file at the Project }
{ JEDI home page, located at http://delphi-jedi.org }
{ }
{ The contents of this file are used with permission, subject to }
{ the Mozilla Public License Version 1.1 (the "License"); you may }
{ not use this file except in compliance with the License. You may }
{ obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an }
{ "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or }
{ implied. See the License for the specific language governing }
{ rights and limitations under the License. }
{ }
{ Description }
{ ----------- }
{ A simple library to load images of various formats as SDL surfaces }
{ }
{ Requires }
{ -------- }
{ SDL.pas in your search path. }
{ }
{ Programming Notes }
{ ----------------- }
{ See the Aliens Demo on how to make use of this libaray }
{ }
{ Revision History }
{ ---------------- }
{ April 02 2001 - MT : Initial Translation }
{ }
{ May 08 2001 - DL : Added ExternalSym derectives and copyright header }
{ }
{ April 03 2003 - DL : Added jedi-sdl.inc include file to support more }
{ Pascal compilers. Initial support is now included }
{ for GnuPascal, VirtualPascal, TMT and obviously }
{ continue support for Delphi Kylix and FreePascal. }
{ }
{ April 08 2003 - MK : Aka Mr Kroket - Added Better FPC support }
{ }
{ April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added}
{ better TMT Pascal support and under instruction }
{ from Prof. Abimbola Olowofoyeku (The African Chief),}
{ I have added better Gnu Pascal support }
{ }
{ April 30 2003 - DL : under instruction from David Mears AKA }
{ Jason Siletto, I have added FPC Linux support. }
{ This was compiled with fpc 1.1, so remember to set }
{ include file path. ie. -Fi/usr/share/fpcsrc/rtl/* }
{ }
{
$Log: sdl_image.pas,v $
Revision 1.7 2005/01/01 02:03:12 savage
Updated to v1.2.4
Revision 1.6 2004/08/14 22:54:30 savage
Updated so that Library name defines are correctly defined for MacOS X.
Revision 1.5 2004/05/10 14:10:04 savage
Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
Revision 1.4 2004/04/13 09:32:08 savage
Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
Revision 1.3 2004/04/01 20:53:23 savage
Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
Revision 1.2 2004/03/30 20:23:28 savage
Tidied up use of UNIX compiler directive.
Revision 1.1 2004/02/14 23:35:42 savage
version 1 of sdl_image, sdl_mixer and smpeg.
}
{******************************************************************************}
{$I jedi-sdl.inc}
interface
uses
{$IFDEF __GPC__}
gpc,
{$ENDIF}
sdl;
const
{$IFDEF WIN32}
SDL_ImageLibName = 'SDL_Image.dll';
{$ENDIF}
{$IFDEF UNIX}
{$IFDEF DARWIN}
SDL_ImageLibName = 'libSDL_image.dylib';
{$ELSE}
SDL_ImageLibName = 'libSDL_image.so';
{$ENDIF}
{$ENDIF}
{$IFDEF MACOS}
SDL_ImageLibName = 'SDL_image';
{$ENDIF}
// Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
SDL_IMAGE_MAJOR_VERSION = 1;
{$EXTERNALSYM SDL_IMAGE_MAJOR_VERSION}
SDL_IMAGE_MINOR_VERSION = 2;
{$EXTERNALSYM SDL_IMAGE_MINOR_VERSION}
SDL_IMAGE_PATCHLEVEL = 4;
{$EXTERNALSYM SDL_IMAGE_PATCHLEVEL}
{ This macro can be used to fill a version structure with the compile-time
version of the SDL_image library. }
procedure SDL_IMAGE_VERSION( var X : TSDL_Version );
{$EXTERNALSYM SDL_IMAGE_VERSION}
{ This function gets the version of the dynamically linked SDL_image library.
it should NOT be used to fill a version structure, instead you should
use the SDL_IMAGE_VERSION() macro.
}
function IMG_Linked_Version : PSDL_version;
external {$IFDEF __GPC__}name 'IMG_Linked_Version'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_Linked_Version}
{ Load an image from an SDL data source.
The 'type' may be one of: "BMP", "GIF", "PNG", etc.
If the image format supports a transparent pixel, SDL will set the
colorkey for the surface. You can enable RLE acceleration on the
surface afterwards by calling:
SDL_SetColorKey(image, SDL_RLEACCEL, image.format.colorkey);
}
function IMG_LoadTyped_RW(src: PSDL_RWops; freesrc: Integer; _type: PChar): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadTyped_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadTyped_RW}
{ Convenience functions }
function IMG_Load(const _file: PChar): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_Load'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_Load}
function IMG_Load_RW(src: PSDL_RWops; freesrc: Integer): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_Load_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_Load_RW}
{ Invert the alpha of a surface for use with OpenGL
This function is now a no-op, and only provided for backwards compatibility. }
function IMG_InvertAlpha(_on: Integer): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_InvertAlpha'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_InvertAlpha}
{ Functions to detect a file type, given a seekable source }
function IMG_isBMP(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isBMP'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isBMP}
function IMG_isPNM(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isPNM'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isPNM}
function IMG_isXPM(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isXPM'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isXPM}
function IMG_isXCF(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isXCF'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isXCF}
function IMG_isPCX(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isPCX'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isPCX}
function IMG_isGIF(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isGIF'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isGIF}
function IMG_isJPG(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isJPG'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isJPG}
function IMG_isTIF(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isTIF'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isTIF}
function IMG_isPNG(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isPNG'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isPNG}
function IMG_isLBM(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isLBM'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isLBM}
{ Individual loading functions }
function IMG_LoadBMP_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadBMP_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadBMP_RW}
function IMG_LoadPNM_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadPNM_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadPNM_RW}
function IMG_LoadXPM_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadXPM_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadXPM_RW}
function IMG_LoadXCF_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadXCF_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadXCF_RW}
function IMG_LoadPCX_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadPCX_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadPCX_RW}
function IMG_LoadGIF_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadGIF_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadGIF_RW}
function IMG_LoadJPG_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadJPG_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadJPG_RW}
function IMG_LoadTIF_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadTIF_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadTIF_RW}
function IMG_LoadPNG_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadPNG_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadPNG_RW}
function IMG_LoadTGA_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadTGA_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadTGA_RW}
function IMG_LoadLBM_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadLBM_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadLBM_RW}
{ used internally, NOT an exported function }
//function IMG_string_equals( const str1 : PChar; const str2 : PChar ) : integer;
//cdecl; external {$IFDEF __GPC__}name 'IMG_string_equals'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
//{ $ EXTERNALSYM IMG_string_equals}
{ Error Macros }
{ We'll use SDL for reporting errors }
procedure IMG_SetError( fmt : PChar );
function IMG_GetError : PChar;
implementation
{$IFDEF __GPC__}
{$L 'sdl_image'} { link sdl_image.dll.a or libsdl_image.so or libsdl_image.a }
{$ENDIF}
procedure SDL_IMAGE_VERSION( var X : TSDL_Version );
begin
X.major := SDL_IMAGE_MAJOR_VERSION;
X.minor := SDL_IMAGE_MINOR_VERSION;
X.patch := SDL_IMAGE_PATCHLEVEL;
end;
procedure IMG_SetError( fmt : PChar );
begin
SDL_SetError( fmt );
end;
function IMG_GetError : PChar;
begin
result := SDL_GetError;
end;
end.
unit sdl_image;
{
$Id: sdl_image.pas,v 1.7 2005/01/01 02:03:12 savage Exp $
}
{******************************************************************************}
{ }
{ Borland Delphi SDL_Image - An example image loading library for use }
{ with SDL }
{ Conversion of the Simple DirectMedia Layer Image Headers }
{ }
{ Portions created by Sam Lantinga <slouken@devolution.com> are }
{ Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga }
{ 5635-34 Springhouse Dr. }
{ Pleasanton, CA 94588 (USA) }
{ }
{ All Rights Reserved. }
{ }
{ The original files are : SDL_image.h }
{ }
{ The initial developer of this Pascal code was : }
{ Matthias Thoma <ma.thoma@gmx.de> }
{ }
{ Portions created by Matthias Thoma are }
{ Copyright (C) 2000 - 2001 Matthias Thoma. }
{ }
{ }
{ Contributor(s) }
{ -------------- }
{ Dominique Louis <Dominique@SavageSoftware.com.au> }
{ }
{ Obtained through: }
{ Joint Endeavour of Delphi Innovators ( Project JEDI ) }
{ }
{ You may retrieve the latest version of this file at the Project }
{ JEDI home page, located at http://delphi-jedi.org }
{ }
{ The contents of this file are used with permission, subject to }
{ the Mozilla Public License Version 1.1 (the "License"); you may }
{ not use this file except in compliance with the License. You may }
{ obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an }
{ "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or }
{ implied. See the License for the specific language governing }
{ rights and limitations under the License. }
{ }
{ Description }
{ ----------- }
{ A simple library to load images of various formats as SDL surfaces }
{ }
{ Requires }
{ -------- }
{ SDL.pas in your search path. }
{ }
{ Programming Notes }
{ ----------------- }
{ See the Aliens Demo on how to make use of this libaray }
{ }
{ Revision History }
{ ---------------- }
{ April 02 2001 - MT : Initial Translation }
{ }
{ May 08 2001 - DL : Added ExternalSym derectives and copyright header }
{ }
{ April 03 2003 - DL : Added jedi-sdl.inc include file to support more }
{ Pascal compilers. Initial support is now included }
{ for GnuPascal, VirtualPascal, TMT and obviously }
{ continue support for Delphi Kylix and FreePascal. }
{ }
{ April 08 2003 - MK : Aka Mr Kroket - Added Better FPC support }
{ }
{ April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added}
{ better TMT Pascal support and under instruction }
{ from Prof. Abimbola Olowofoyeku (The African Chief),}
{ I have added better Gnu Pascal support }
{ }
{ April 30 2003 - DL : under instruction from David Mears AKA }
{ Jason Siletto, I have added FPC Linux support. }
{ This was compiled with fpc 1.1, so remember to set }
{ include file path. ie. -Fi/usr/share/fpcsrc/rtl/* }
{ }
{
$Log: sdl_image.pas,v $
Revision 1.7 2005/01/01 02:03:12 savage
Updated to v1.2.4
Revision 1.6 2004/08/14 22:54:30 savage
Updated so that Library name defines are correctly defined for MacOS X.
Revision 1.5 2004/05/10 14:10:04 savage
Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
Revision 1.4 2004/04/13 09:32:08 savage
Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
Revision 1.3 2004/04/01 20:53:23 savage
Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
Revision 1.2 2004/03/30 20:23:28 savage
Tidied up use of UNIX compiler directive.
Revision 1.1 2004/02/14 23:35:42 savage
version 1 of sdl_image, sdl_mixer and smpeg.
}
{******************************************************************************}
{$I jedi-sdl.inc}
interface
uses
{$IFDEF __GPC__}
gpc,
{$ENDIF}
sdl;
const
{$IFDEF windows}
SDL_ImageLibName = 'SDL_Image.dll';
{$ENDIF}
{$IFDEF UNIX}
{$IFDEF DARWIN}
SDL_ImageLibName = 'libSDL_image.dylib';
{$ELSE}
SDL_ImageLibName = 'libSDL_image.so';
{$ENDIF}
{$ENDIF}
{$IFDEF MACOS}
SDL_ImageLibName = 'SDL_image';
{$ENDIF}
// Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
SDL_IMAGE_MAJOR_VERSION = 1;
{$EXTERNALSYM SDL_IMAGE_MAJOR_VERSION}
SDL_IMAGE_MINOR_VERSION = 2;
{$EXTERNALSYM SDL_IMAGE_MINOR_VERSION}
SDL_IMAGE_PATCHLEVEL = 4;
{$EXTERNALSYM SDL_IMAGE_PATCHLEVEL}
{ This macro can be used to fill a version structure with the compile-time
version of the SDL_image library. }
procedure SDL_IMAGE_VERSION( var X : TSDL_Version );
{$EXTERNALSYM SDL_IMAGE_VERSION}
{ This function gets the version of the dynamically linked SDL_image library.
it should NOT be used to fill a version structure, instead you should
use the SDL_IMAGE_VERSION() macro.
}
function IMG_Linked_Version : PSDL_version;
external {$IFDEF __GPC__}name 'IMG_Linked_Version'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_Linked_Version}
{ Load an image from an SDL data source.
The 'type' may be one of: "BMP", "GIF", "PNG", etc.
If the image format supports a transparent pixel, SDL will set the
colorkey for the surface. You can enable RLE acceleration on the
surface afterwards by calling:
SDL_SetColorKey(image, SDL_RLEACCEL, image.format.colorkey);
}
function IMG_LoadTyped_RW(src: PSDL_RWops; freesrc: Integer; _type: PChar): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadTyped_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadTyped_RW}
{ Convenience functions }
function IMG_Load(const _file: PChar): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_Load'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_Load}
function IMG_Load_RW(src: PSDL_RWops; freesrc: Integer): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_Load_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_Load_RW}
{ Invert the alpha of a surface for use with OpenGL
This function is now a no-op, and only provided for backwards compatibility. }
function IMG_InvertAlpha(_on: Integer): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_InvertAlpha'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_InvertAlpha}
{ Functions to detect a file type, given a seekable source }
function IMG_isBMP(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isBMP'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isBMP}
function IMG_isPNM(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isPNM'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isPNM}
function IMG_isXPM(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isXPM'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isXPM}
function IMG_isXCF(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isXCF'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isXCF}
function IMG_isPCX(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isPCX'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isPCX}
function IMG_isGIF(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isGIF'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isGIF}
function IMG_isJPG(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isJPG'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isJPG}
function IMG_isTIF(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isTIF'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isTIF}
function IMG_isPNG(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isPNG'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isPNG}
function IMG_isLBM(src: PSDL_RWops): Integer;
cdecl; external {$IFDEF __GPC__}name 'IMG_isLBM'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_isLBM}
{ Individual loading functions }
function IMG_LoadBMP_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadBMP_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadBMP_RW}
function IMG_LoadPNM_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadPNM_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadPNM_RW}
function IMG_LoadXPM_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadXPM_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadXPM_RW}
function IMG_LoadXCF_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadXCF_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadXCF_RW}
function IMG_LoadPCX_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadPCX_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadPCX_RW}
function IMG_LoadGIF_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadGIF_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadGIF_RW}
function IMG_LoadJPG_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadJPG_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadJPG_RW}
function IMG_LoadTIF_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadTIF_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadTIF_RW}
function IMG_LoadPNG_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadPNG_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadPNG_RW}
function IMG_LoadTGA_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadTGA_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadTGA_RW}
function IMG_LoadLBM_RW(src: PSDL_RWops): PSDL_Surface;
cdecl; external {$IFDEF __GPC__}name 'IMG_LoadLBM_RW'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
{$EXTERNALSYM IMG_LoadLBM_RW}
{ used internally, NOT an exported function }
//function IMG_string_equals( const str1 : PChar; const str2 : PChar ) : integer;
//cdecl; external {$IFDEF __GPC__}name 'IMG_string_equals'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
//{ $ EXTERNALSYM IMG_string_equals}
{ Error Macros }
{ We'll use SDL for reporting errors }
procedure IMG_SetError( fmt : PChar );
function IMG_GetError : PChar;
implementation
{$IFDEF __GPC__}
{$L 'sdl_image'} { link sdl_image.dll.a or libsdl_image.so or libsdl_image.a }
{$ENDIF}
procedure SDL_IMAGE_VERSION( var X : TSDL_Version );
begin
X.major := SDL_IMAGE_MAJOR_VERSION;
X.minor := SDL_IMAGE_MINOR_VERSION;
X.patch := SDL_IMAGE_PATCHLEVEL;
end;
procedure IMG_SetError( fmt : PChar );
begin
SDL_SetError( fmt );
end;
function IMG_GetError : PChar;
begin
result := SDL_GetError;
end;
end.

File diff suppressed because it is too large Load Diff

View File

@ -120,7 +120,7 @@ uses
gpc,
{$ENDIF}
{$IFDEF WIN32}
{$IFDEF windows}
{$IFNDEF __GPC__}
Windows,
{$ENDIF}
@ -128,7 +128,7 @@ uses
sdl;
const
{$IFDEF WIN32}
{$IFDEF windows}
SDLNetLibName = 'SDL_net.dll';
{$ENDIF}
@ -192,7 +192,7 @@ type
PTCPSocket = ^TTCPSocket;
TTCPSocket = record
ready : integer;
{$IFDEF WIN32}
{$IFDEF windows}
channel : integer;
{$ENDIF}
{$IFDEF UNIX}
@ -215,7 +215,7 @@ type
PUDPSocket = ^TUDPSocket;
TUDPSocket = record
ready : integer;
{$IFDEF WIN32}
{$IFDEF windows}
channel : integer;
{$ENDIF}
{$IFDEF UNIX}
@ -242,7 +242,7 @@ type
PSDLNet_Socket = ^TSDLNet_Socket;
TSDLNet_Socket = record
ready : integer;
{$IFDEF WIN32}
{$IFDEF windows}
channel : integer;
{$ENDIF}
{$IFDEF UNIX}

View File

@ -91,13 +91,13 @@ unit sdl_sound;
interface
uses
{$IFDEF WIN32}
{$IFDEF windows}
Windows,
{$ENDIF}
sdl;
const
{$IFDEF WIN32}
{$IFDEF windows}
SDLSoundLibName = 'SDL_sound.dll';
{$ENDIF}

View File

@ -127,13 +127,13 @@ unit sdl_ttf;
interface
uses
{$IFDEF WIN32}
{$IFDEF windows}
Windows,
{$ENDIF}
sdl;
const
{$IFDEF WIN32}
{$IFDEF windows}
SDLttfLibName = 'SDL_ttf.dll';
{$ENDIF}

View File

@ -39,7 +39,7 @@ unit sdlsprites;
interface
uses
{$IFDEF WIN32}
{$IFDEF windows}
Windows,
{$ENDIF}
Classes,

View File

@ -138,7 +138,7 @@ uses
sdl;
const
{$IFDEF WIN32}
{$IFDEF windows}
SmpegLibName = 'smpeg.dll';
{$ENDIF}