ilut.bas 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. Attribute VB_Name = "Module3"
  2. '-----------------------------------------------------------------------------
  3. '
  4. ' ImageLib Utility Toolkit Sources
  5. ' Copyright (C) 2000-2002 by Denton Woods
  6. ' Converted from ilut.h by Rune Kock (rune@vupti.com)
  7. ' based on the earlier conversion by Timo Heister (Timo-Heister@gmx.de)
  8. ' Last modified: 22 June 2002, based on ilut.h dated 06/22/2002
  9. '
  10. ' Filename: ilut.bas
  11. '
  12. ' Description: The main include file for ILUT
  13. '
  14. '-----------------------------------------------------------------------------
  15. ' I've converted the types as follows. I have not dared use user-defined types, as I
  16. ' don't know how VB handles them internally. This means, unfortunately, that the headers
  17. ' are less informative than the original. So refer to ilut.h to see the original types.
  18. ' ILenum long
  19. ' ILboolean byte
  20. ' ILbitfield long
  21. ' ILbyte byte
  22. ' ILshort integer
  23. ' ILint long
  24. ' ILsizei long
  25. ' ILubyte byte
  26. ' ILushort integer
  27. ' ILuint long
  28. ' ILfloat single
  29. ' ILclampf single
  30. ' ILdouble double
  31. ' ILclampd double
  32. ' ILvoid n/a
  33. ' <all Windows handles> integer
  34. Option Explicit
  35. Public Const ILUT_VERSION_1_6_0 = 1
  36. Public Const ILUT_VERSION = 160
  37. ' Attribute Bits
  38. Public Const ILUT_OPENGL_BIT = &H1
  39. Public Const ILUT_D3D_BIT = &H2
  40. Public Const ILUT_ALL_ATTRIB_BITS = &HFFFFF
  41. ' Error Types
  42. Public Const ILUT_INVALID_ENUM = &H501
  43. Public Const ILUT_OUT_OF_MEMORY = &H502
  44. Public Const ILUT_INVALID_VALUE = &H505
  45. Public Const ILUT_ILLEGAL_OPERATION = &H506
  46. Public Const ILUT_INVALID_PARAM = &H509
  47. Public Const ILUT_COULD_NOT_OPEN_FILE = &H50A
  48. Public Const ILUT_STACK_OVERFLOW = &H50E
  49. Public Const ILUT_STACK_UNDERFLOW = &H50F
  50. Public Const ILUT_NOT_SUPPORTED = &H550
  51. ' State Definitions
  52. Public Const ILUT_PALETTE_MODE = &H600
  53. Public Const ILUT_OPENGL_CONV = &H610
  54. Public Const ILUT_D3D_MIPLEVELS = &H620
  55. Public Const ILUT_MAXTEX_WIDTH = &H630
  56. Public Const ILUT_MAXTEX_HEIGHT = &H631
  57. Public Const ILUT_MAXTEX_DEPTH = &H632
  58. Public Const ILUT_GL_USE_S3TC = &H634
  59. Public Const ILUT_D3D_USE_DXTC = &H634
  60. Public Const ILUT_GL_GEN_S3TC = &H635
  61. Public Const ILUT_D3D_GEN_DXTC = &H635
  62. Public Const ILUT_S3TC_FORMAT = &H705
  63. Public Const ILUT_DXTC_FORMAT = &H706
  64. ' Values
  65. Public Const ILUT_VERSION_NUM = &HDE2
  66. ' ImageLib Utility Toolkit Functions
  67. Public Declare Function ilutDisable Lib "ilut" (ByVal Mode As Long) As Byte
  68. Public Declare Function ilutEnable Lib "ilut" (ByVal Mode As Long) As Byte
  69. Public Declare Function ilutGetBoolean Lib "ilut" (ByVal Mode As Long) As Byte
  70. Public Declare Sub ilutGetBooleanv Lib "ilut" (ByVal Mode As Long, ByRef Param As Byte)
  71. Public Declare Function ilutGetInteger Lib "ilut" (ByVal Mode As Long) As Long
  72. Public Declare Sub ilutGetIntegerv Lib "ilut" (ByVal Mode As Long, ByRef Param As Long)
  73. Public Declare Function ilutGetString Lib "ilut" (ByVal StringName As Long) As Long
  74. Public Declare Sub ilutInit Lib "ilut" ()
  75. Public Declare Function ilutIsDisabled Lib "ilut" (ByVal Mode As Long) As Byte
  76. Public Declare Function ilutIsEnabled Lib "ilut" (ByVal Mode As Long) As Byte
  77. Public Declare Sub ilutPopAttrib Lib "ilut" ()
  78. Public Declare Sub ilutPushAttrib Lib "ilut" (ByVal Bits As Long)
  79. Public Declare Sub ilutSetInteger Lib "ilut" (ByVal Mode As Long, ByVal Param As Long)
  80. Public Const ILUT_USE_ALLEGRO = False
  81. Public Const ILUT_USE_WIN32 = True
  82. Public Const ILUT_USE_OPENGL = True
  83. ' The different rendering api's...more to be added later?
  84. Public Const ILUT_OPENGL = 0
  85. Public Const ILUT_ALLEGRO = 1
  86. Public Const ILUT_WIN32 = 2
  87. Public Declare Function ilutRenderer Lib "ilut" (ByVal Renderer As Long) As Byte
  88. ' ImageLib Utility Toolkit's OpenGL Functions
  89. Public Declare Function ilutGLBindTexImage Lib "ilut" () As Long
  90. Public Declare Function ilutGLBindMipmaps Lib "ilut" () As Long
  91. Public Declare Function ilutGLBuildMipmaps Lib "ilut" () As Byte
  92. Public Declare Function ilutGLLoadImage Lib "ilut" (ByVal FileName As String) As Long
  93. Public Declare Function ilutGLScreen Lib "ilut" () As Byte
  94. Public Declare Function ilutGLScreenie Lib "ilut" () As Byte
  95. Public Declare Function ilutGLSaveImage Lib "ilut" (ByVal FileName As String, ByVal TexID As Long) As Byte
  96. Public Declare Function ilutGLSetTex Lib "ilut" (ByVal TexID As Long) As Byte
  97. Public Declare Function ilutGLTexImage Lib "ilut" (ByVal Level As Long) As Byte
  98. ' Allegro and BeOS are probably irrelevant for VB, so they are left out...
  99. ' ImageLib Utility Toolkit's Win32 (DirectX/GDI) Functions
  100. Public Declare Function ilutConvertToHBitmap Lib "ilut" (ByVal hDC As Integer) As Integer
  101. ' Public Declare Sub ilutGetBmpInfo Lib "ilut" (ByRef Info As BITMAPINFO)
  102. ' (The BITMAPINFO structure can probably not be ported to VB).
  103. Public Declare Function ilutGetHPal Lib "ilut" () As Integer
  104. Public Declare Function ilutGetPaddedData Lib "ilut" () As Long
  105. Public Declare Function ilutGetWinClipboard Lib "ilut" () As Byte
  106. Public Declare Function ilutLoadResource Lib "ilut" (ByVal hInst As Integer, ByVal ID As Long, ByVal ResourceType As String, ByVal IType As Long) As Byte
  107. Public Declare Function ilutSetHBitmap Lib "ilut" (ByVal Bitmap As Integer) As Byte
  108. Public Declare Function ilutSetHPal Lib "ilut" (ByVal Pal As Integer) As Byte
  109. Public Declare Function ilutSetWinClipboard Lib "ilut" () As Byte
  110. Public Declare Function ilutWinLoadImage Lib "ilut" (ByVal FileName As String, ByVal hDC As Integer) As Integer
  111. Public Declare Function ilutWinLoadUrl Lib "ilut" (ByVal Url As String) As Byte
  112. Public Declare Function ilutWinSaveImage Lib "ilut" (ByVal FileName As String, ByVal Bitmap As Integer) As Byte
  113. ' The DirectX 8 functions below might not be compiled into the DLL, so I've not
  114. ' bothered figuring out whether VB can be fooled into handling all those pointers.
  115. ' ILAPI ILvoid ILAPIENTRY ilutD3D8MipFunc(ILuint NumLevels);
  116. ' ILAPI IDirect3DTexture8* ILAPIENTRY ilutD3D8Texture(IDirect3DDevice8 *Device);
  117. ' ILAPI IDirect3DVolumeTexture8* ILAPIENTRY ilutD3D8VolumeTexture(IDirect3DDevice8 *Device);
  118. ' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFile(IDirect3DDevice8 *Device, char *FileName, IDirect3DTexture8 **Texture);
  119. ' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFile(IDirect3DDevice8 *Device, char *FileName, IDirect3DVolumeTexture8 **Texture);
  120. ' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileInMemory(IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, IDirect3DTexture8 **Texture);
  121. ' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileInMemory(IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, IDirect3DVolumeTexture8 **Texture);
  122. ' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileHandle(IDirect3DDevice8 *Device, ILHANDLE File, IDirect3DTexture8 **Texture);
  123. ' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileHandle(IDirect3DDevice8 *Device, ILHANDLE File, IDirect3DVolumeTexture8 **Texture);
  124. ' // These two are not tested yet.
  125. ' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromResource(IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, IDirect3DTexture8 **Texture);
  126. ' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromResource(IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, IDirect3DVolumeTexture8 **Texture);
  127. '
  128. ' ILAPI ILboolean ILAPIENTRY ilutD3D8LoadSurface(IDirect3DDevice8 *Device, IDirect3DSurface8 *Surface);