summaryrefslogtreecommitdiff
path: root/DevIL/bindings/delphi/openilut.pas
blob: 9c6a2a89eda933bd9622c5bd612e40d46548ce1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
unit OpenILUT;

//------------------------------------------------------------------------------
//
// ImageLib Utility Toolkit Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 06/23/2002 <--Y2K Compliant! =]
//
// Filename: il/ilut.h
//
// Description: The main include file for ILUT
//
//------------------------------------------------------------------------------

{******************************************************************************}
{ Converted to Delphi by Alexander Blach (alexander@abee.de)                   }
{   Version:       ILUT v1.6.1                                                 }
{   Last modified: 06/23/2002                                                  }
{                                                                              }
{   You will need the latest OpenGL units for Delphi. I recommend those on     }
{   http://www.delphi3d.net                                                    }
{******************************************************************************}


interface

// Note by ABee: I had to move this here so that I can look it up in "uses"
//{$DEFINE ILUT_USE_ALLEGRO)
{$DEFINE ILUT_USE_WIN32}
{$DEFINE ILUT_USE_OPENGL}

uses
  OpenIL,
  OpenILU,
{$IFDEF ILUT_USE_OPENGL}
  GL,
  //OpenGL12,
{$ENDIF}
  Windows;


const
  ILUT_VERSION_1_5_6 = 1;
  ILUT_VERSION = 156;

const
// Attribute Bits
  ILUT_OPENGL_BIT = $00000001;
  ILUT_D3D_BIT = $00000002;
  ILUT_ALL_ATTRIB_BITS = $000FFFFF;

// Error Types
  ILUT_INVALID_ENUM = $0501;
  ILUT_OUT_OF_MEMORY = $0502;
  ILUT_INVALID_VALUE = $0505;
  ILUT_ILLEGAL_OPERATION = $0506;
  ILUT_INVALID_PARAM = $0509;
  ILUT_COULD_NOT_OPEN_FILE = $050A;
  ILUT_STACK_OVERFLOW = $050E;
  ILUT_STACK_UNDERFLOW = $050F;
  ILUT_NOT_SUPPORTED = $0550;


// State Definitions
  ILUT_PALETTE_MODE = $0600;
  ILUT_OPENGL_CONV = $0610;
  ILUT_D3D_MIPLEVELS = $0620;
  ILUT_MAXTEX_WIDTH = $0630;
  ILUT_MAXTEX_HEIGHT = $0631;
  ILUT_MAXTEX_DEPTH = $0632;
  ILUT_GL_USE_S3TC = $0634;
  ILUT_D3D_USE_DXTC = $0634;
  ILUT_GL_GEN_S3TC = $0635;
  ILUT_D3D_GEN_DXTC = $0635;
  ILUT_S3TC_FORMAT = $0705;
  ILUT_DXTC_FORMAT = $0706;



// Values
  ILUT_VERSION_NUM = $0DE2;


const
{$IFDEF OPENIL_DEBUG}
  ILUTDLL = 'ILUT-d.DLL';
{$ELSE}
  ILUTDLL = 'ILUT.DLL';
{$ENDIF}

// ImageLib Utility Toolkit Functions
function ilutDisable(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
function ilutEnable(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
function ilutGetBoolean(Mode: TILenum): TILboolean; stdcall; external
  ILUTDLL;
procedure ilutGetBooleanv(Mode: TILenum; Param: PILboolean); stdcall; external
  ILUTDLL;
function ilutGetInteger(Mode: TILenum): TILint; stdcall; external
  ILUTDLL;
procedure ilutGetIntegerv(Mode: TILenum; Param: PILint); stdcall; external
  ILUTDLL;
function ilutGetString(StringName: TILenum): PChar; stdcall; external ILUTDLL;
procedure ilutInit; stdcall; external ILUTDLL;
function ilutIsDisabled(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
function ilutIsEnabled(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
procedure ilutPopAttrib; stdcall; external ILUTDLL;
procedure ilutPushAttrib(Bits: TILuint); stdcall; external ILUTDLL;
procedure ilutSetInteger(Mode: TILenum; Param: TILint); stdcall; external ILUTDLL;


// The different rendering api's...more to be added later?
const
  IL_OPENGL = 0;
  IL_ALLEGRO = 1;
  IL_WIN32 = 2;

function ilutRenderer(Renderer: TILenum): TILboolean; stdcall; external ILUTDLL;

// ImageLib Utility Toolkit's OpenGL Functions
{$IFDEF ILUT_USE_OPENGL}
function ilutGLBindTexImage: GLuint; stdcall; external ILUTDLL;
function ilutGLBindMipmaps: GLuint; stdcall; external ILUTDLL;
function ilutGLBuildMipmaps: TILboolean; stdcall; external ILUTDLL;
function ilutGLLoadImage(FileName: PChar): GLuint; stdcall; external ILUTDLL;
function ilutGLScreen: TILboolean; stdcall; external ILUTDLL;
function ilutGLScreenie: TILboolean; stdcall; external ILUTDLL;
function ilutGLSaveImage(FileName: PChar; TexID: GLuint): TILboolean;
 stdcall; external ILUTDLL;
function ilutGLSetTex(TexID: GLuint): TILboolean; stdcall; external ILUTDLL;
function ilutGLTexImage(Level: GLuint): TILboolean; stdcall; external ILUTDLL;
{$ENDIF}

// note by ABee: no Allegro in Delphi
// ImageLib Utility ToolKit's Allegro Functions
{$IFDEF ILUT_USE_ALLEGRO}
//function ilutConvertToAlleg(var Pal: PALETTE): PBitmap; stdcall; external
//ILUTDLL;
{$ENDIF}

// ImageLib Utility Toolkit's Win32 (DirectX/GDI) Functions
{$IFDEF ILUT_USE_WIN32}
function ilutConvertToHBitmap(DC: HDC): HBITMAP; stdcall; external ILUTDLL;
procedure ilutGetBmpInfo(Info: PBitmapInfo); stdcall; external ILUTDLL;
function ilutGetHPal: HPalette; stdcall; external ILUTDLL;
function ilutGetPaddedData: PILubyte; stdcall; external ILUTDLL;
function ilutGetWinClipboard: TILboolean; stdcall; external ILUTDLL;
function ilutLoadResource(hInst: LongWord; ID: TILint; ResourceType: PChar;
  _Type: TILenum): TILboolean; stdcall; external ILUTDLL;
function ilutSetHBitmap(Bitmap: HBITMAP): TILboolean; stdcall; external ILUTDLL;
function ilutSetHPal(Pal: HPALETTE): TILboolean; stdcall; external ILUTDLL;
function ilutSetWinClipboard: TILboolean; stdcall; external ILUTDLL;
function ilutWinLoadImage(FileName: PChar; DC: HDC): HBITMAP; stdcall;
 external ILUTDLL;
function ilutWinLoadUrl(Url: PChar): TILboolean; stdcall; external ILUTDLL;
function ilutWinSaveImage(FileName: PChar; Bitmap: HBITMAP): TILboolean;
 stdcall; external ILUTDLL;
{
		//#ifdef ILUT_USE_DIRECTX7
		//	LPDIRECTDRAWSURFACE7 ILAPIENTRY ilutDX7Surface(char *FileName, LPDIRECTDRAW7 DDraw);
		//#endif//ILUT_USE_DIRECTX7
}
{$ENDIF}

implementation

end.