openilut.pas 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. unit OpenILUT;
  2. //------------------------------------------------------------------------------
  3. //
  4. // ImageLib Utility Toolkit Sources
  5. // Copyright (C) 2000-2002 by Denton Woods
  6. // Last modified: 06/23/2002 <--Y2K Compliant! =]
  7. //
  8. // Filename: il/ilut.h
  9. //
  10. // Description: The main include file for ILUT
  11. //
  12. //------------------------------------------------------------------------------
  13. {******************************************************************************}
  14. { Converted to Delphi by Alexander Blach (alexander@abee.de) }
  15. { Version: ILUT v1.6.1 }
  16. { Last modified: 06/23/2002 }
  17. { }
  18. { You will need the latest OpenGL units for Delphi. I recommend those on }
  19. { http://www.delphi3d.net }
  20. {******************************************************************************}
  21. interface
  22. // Note by ABee: I had to move this here so that I can look it up in "uses"
  23. //{$DEFINE ILUT_USE_ALLEGRO)
  24. {$DEFINE ILUT_USE_WIN32}
  25. {$DEFINE ILUT_USE_OPENGL}
  26. uses
  27. OpenIL,
  28. OpenILU,
  29. {$IFDEF ILUT_USE_OPENGL}
  30. GL,
  31. //OpenGL12,
  32. {$ENDIF}
  33. Windows;
  34. const
  35. ILUT_VERSION_1_5_6 = 1;
  36. ILUT_VERSION = 156;
  37. const
  38. // Attribute Bits
  39. ILUT_OPENGL_BIT = $00000001;
  40. ILUT_D3D_BIT = $00000002;
  41. ILUT_ALL_ATTRIB_BITS = $000FFFFF;
  42. // Error Types
  43. ILUT_INVALID_ENUM = $0501;
  44. ILUT_OUT_OF_MEMORY = $0502;
  45. ILUT_INVALID_VALUE = $0505;
  46. ILUT_ILLEGAL_OPERATION = $0506;
  47. ILUT_INVALID_PARAM = $0509;
  48. ILUT_COULD_NOT_OPEN_FILE = $050A;
  49. ILUT_STACK_OVERFLOW = $050E;
  50. ILUT_STACK_UNDERFLOW = $050F;
  51. ILUT_NOT_SUPPORTED = $0550;
  52. // State Definitions
  53. ILUT_PALETTE_MODE = $0600;
  54. ILUT_OPENGL_CONV = $0610;
  55. ILUT_D3D_MIPLEVELS = $0620;
  56. ILUT_MAXTEX_WIDTH = $0630;
  57. ILUT_MAXTEX_HEIGHT = $0631;
  58. ILUT_MAXTEX_DEPTH = $0632;
  59. ILUT_GL_USE_S3TC = $0634;
  60. ILUT_D3D_USE_DXTC = $0634;
  61. ILUT_GL_GEN_S3TC = $0635;
  62. ILUT_D3D_GEN_DXTC = $0635;
  63. ILUT_S3TC_FORMAT = $0705;
  64. ILUT_DXTC_FORMAT = $0706;
  65. // Values
  66. ILUT_VERSION_NUM = $0DE2;
  67. const
  68. {$IFDEF OPENIL_DEBUG}
  69. ILUTDLL = 'ILUT-d.DLL';
  70. {$ELSE}
  71. ILUTDLL = 'ILUT.DLL';
  72. {$ENDIF}
  73. // ImageLib Utility Toolkit Functions
  74. function ilutDisable(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
  75. function ilutEnable(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
  76. function ilutGetBoolean(Mode: TILenum): TILboolean; stdcall; external
  77. ILUTDLL;
  78. procedure ilutGetBooleanv(Mode: TILenum; Param: PILboolean); stdcall; external
  79. ILUTDLL;
  80. function ilutGetInteger(Mode: TILenum): TILint; stdcall; external
  81. ILUTDLL;
  82. procedure ilutGetIntegerv(Mode: TILenum; Param: PILint); stdcall; external
  83. ILUTDLL;
  84. function ilutGetString(StringName: TILenum): PChar; stdcall; external ILUTDLL;
  85. procedure ilutInit; stdcall; external ILUTDLL;
  86. function ilutIsDisabled(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
  87. function ilutIsEnabled(Mode: TILenum): TILboolean; stdcall; external ILUTDLL;
  88. procedure ilutPopAttrib; stdcall; external ILUTDLL;
  89. procedure ilutPushAttrib(Bits: TILuint); stdcall; external ILUTDLL;
  90. procedure ilutSetInteger(Mode: TILenum; Param: TILint); stdcall; external ILUTDLL;
  91. // The different rendering api's...more to be added later?
  92. const
  93. IL_OPENGL = 0;
  94. IL_ALLEGRO = 1;
  95. IL_WIN32 = 2;
  96. function ilutRenderer(Renderer: TILenum): TILboolean; stdcall; external ILUTDLL;
  97. // ImageLib Utility Toolkit's OpenGL Functions
  98. {$IFDEF ILUT_USE_OPENGL}
  99. function ilutGLBindTexImage: GLuint; stdcall; external ILUTDLL;
  100. function ilutGLBindMipmaps: GLuint; stdcall; external ILUTDLL;
  101. function ilutGLBuildMipmaps: TILboolean; stdcall; external ILUTDLL;
  102. function ilutGLLoadImage(FileName: PChar): GLuint; stdcall; external ILUTDLL;
  103. function ilutGLScreen: TILboolean; stdcall; external ILUTDLL;
  104. function ilutGLScreenie: TILboolean; stdcall; external ILUTDLL;
  105. function ilutGLSaveImage(FileName: PChar; TexID: GLuint): TILboolean;
  106. stdcall; external ILUTDLL;
  107. function ilutGLSetTex(TexID: GLuint): TILboolean; stdcall; external ILUTDLL;
  108. function ilutGLTexImage(Level: GLuint): TILboolean; stdcall; external ILUTDLL;
  109. {$ENDIF}
  110. // note by ABee: no Allegro in Delphi
  111. // ImageLib Utility ToolKit's Allegro Functions
  112. {$IFDEF ILUT_USE_ALLEGRO}
  113. //function ilutConvertToAlleg(var Pal: PALETTE): PBitmap; stdcall; external
  114. //ILUTDLL;
  115. {$ENDIF}
  116. // ImageLib Utility Toolkit's Win32 (DirectX/GDI) Functions
  117. {$IFDEF ILUT_USE_WIN32}
  118. function ilutConvertToHBitmap(DC: HDC): HBITMAP; stdcall; external ILUTDLL;
  119. procedure ilutGetBmpInfo(Info: PBitmapInfo); stdcall; external ILUTDLL;
  120. function ilutGetHPal: HPalette; stdcall; external ILUTDLL;
  121. function ilutGetPaddedData: PILubyte; stdcall; external ILUTDLL;
  122. function ilutGetWinClipboard: TILboolean; stdcall; external ILUTDLL;
  123. function ilutLoadResource(hInst: LongWord; ID: TILint; ResourceType: PChar;
  124. _Type: TILenum): TILboolean; stdcall; external ILUTDLL;
  125. function ilutSetHBitmap(Bitmap: HBITMAP): TILboolean; stdcall; external ILUTDLL;
  126. function ilutSetHPal(Pal: HPALETTE): TILboolean; stdcall; external ILUTDLL;
  127. function ilutSetWinClipboard: TILboolean; stdcall; external ILUTDLL;
  128. function ilutWinLoadImage(FileName: PChar; DC: HDC): HBITMAP; stdcall;
  129. external ILUTDLL;
  130. function ilutWinLoadUrl(Url: PChar): TILboolean; stdcall; external ILUTDLL;
  131. function ilutWinSaveImage(FileName: PChar; Bitmap: HBITMAP): TILboolean;
  132. stdcall; external ILUTDLL;
  133. {
  134. //#ifdef ILUT_USE_DIRECTX7
  135. // LPDIRECTDRAWSURFACE7 ILAPIENTRY ilutDX7Surface(char *FileName, LPDIRECTDRAW7 DDraw);
  136. //#endif//ILUT_USE_DIRECTX7
  137. }
  138. {$ENDIF}
  139. implementation
  140. end.