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
|
Attribute VB_Name = "Module3"
'-----------------------------------------------------------------------------
'
' ImageLib Utility Toolkit Sources
' Copyright (C) 2000-2002 by Denton Woods
' Converted from ilut.h by Rune Kock (rune@vupti.com)
' based on the earlier conversion by Timo Heister (Timo-Heister@gmx.de)
' Last modified: 22 June 2002, based on ilut.h dated 06/22/2002
'
' Filename: ilut.bas
'
' Description: The main include file for ILUT
'
'-----------------------------------------------------------------------------
' I've converted the types as follows. I have not dared use user-defined types, as I
' don't know how VB handles them internally. This means, unfortunately, that the headers
' are less informative than the original. So refer to ilut.h to see the original types.
' ILenum long
' ILboolean byte
' ILbitfield long
' ILbyte byte
' ILshort integer
' ILint long
' ILsizei long
' ILubyte byte
' ILushort integer
' ILuint long
' ILfloat single
' ILclampf single
' ILdouble double
' ILclampd double
' ILvoid n/a
' <all Windows handles> integer
Option Explicit
Public Const ILUT_VERSION_1_6_0 = 1
Public Const ILUT_VERSION = 160
' Attribute Bits
Public Const ILUT_OPENGL_BIT = &H1
Public Const ILUT_D3D_BIT = &H2
Public Const ILUT_ALL_ATTRIB_BITS = &HFFFFF
' Error Types
Public Const ILUT_INVALID_ENUM = &H501
Public Const ILUT_OUT_OF_MEMORY = &H502
Public Const ILUT_INVALID_VALUE = &H505
Public Const ILUT_ILLEGAL_OPERATION = &H506
Public Const ILUT_INVALID_PARAM = &H509
Public Const ILUT_COULD_NOT_OPEN_FILE = &H50A
Public Const ILUT_STACK_OVERFLOW = &H50E
Public Const ILUT_STACK_UNDERFLOW = &H50F
Public Const ILUT_NOT_SUPPORTED = &H550
' State Definitions
Public Const ILUT_PALETTE_MODE = &H600
Public Const ILUT_OPENGL_CONV = &H610
Public Const ILUT_D3D_MIPLEVELS = &H620
Public Const ILUT_MAXTEX_WIDTH = &H630
Public Const ILUT_MAXTEX_HEIGHT = &H631
Public Const ILUT_MAXTEX_DEPTH = &H632
Public Const ILUT_GL_USE_S3TC = &H634
Public Const ILUT_D3D_USE_DXTC = &H634
Public Const ILUT_GL_GEN_S3TC = &H635
Public Const ILUT_D3D_GEN_DXTC = &H635
Public Const ILUT_S3TC_FORMAT = &H705
Public Const ILUT_DXTC_FORMAT = &H706
' Values
Public Const ILUT_VERSION_NUM = &HDE2
' ImageLib Utility Toolkit Functions
Public Declare Function ilutDisable Lib "ilut" (ByVal Mode As Long) As Byte
Public Declare Function ilutEnable Lib "ilut" (ByVal Mode As Long) As Byte
Public Declare Function ilutGetBoolean Lib "ilut" (ByVal Mode As Long) As Byte
Public Declare Sub ilutGetBooleanv Lib "ilut" (ByVal Mode As Long, ByRef Param As Byte)
Public Declare Function ilutGetInteger Lib "ilut" (ByVal Mode As Long) As Long
Public Declare Sub ilutGetIntegerv Lib "ilut" (ByVal Mode As Long, ByRef Param As Long)
Public Declare Function ilutGetString Lib "ilut" (ByVal StringName As Long) As Long
Public Declare Sub ilutInit Lib "ilut" ()
Public Declare Function ilutIsDisabled Lib "ilut" (ByVal Mode As Long) As Byte
Public Declare Function ilutIsEnabled Lib "ilut" (ByVal Mode As Long) As Byte
Public Declare Sub ilutPopAttrib Lib "ilut" ()
Public Declare Sub ilutPushAttrib Lib "ilut" (ByVal Bits As Long)
Public Declare Sub ilutSetInteger Lib "ilut" (ByVal Mode As Long, ByVal Param As Long)
Public Const ILUT_USE_ALLEGRO = False
Public Const ILUT_USE_WIN32 = True
Public Const ILUT_USE_OPENGL = True
' The different rendering api's...more to be added later?
Public Const ILUT_OPENGL = 0
Public Const ILUT_ALLEGRO = 1
Public Const ILUT_WIN32 = 2
Public Declare Function ilutRenderer Lib "ilut" (ByVal Renderer As Long) As Byte
' ImageLib Utility Toolkit's OpenGL Functions
Public Declare Function ilutGLBindTexImage Lib "ilut" () As Long
Public Declare Function ilutGLBindMipmaps Lib "ilut" () As Long
Public Declare Function ilutGLBuildMipmaps Lib "ilut" () As Byte
Public Declare Function ilutGLLoadImage Lib "ilut" (ByVal FileName As String) As Long
Public Declare Function ilutGLScreen Lib "ilut" () As Byte
Public Declare Function ilutGLScreenie Lib "ilut" () As Byte
Public Declare Function ilutGLSaveImage Lib "ilut" (ByVal FileName As String, ByVal TexID As Long) As Byte
Public Declare Function ilutGLSetTex Lib "ilut" (ByVal TexID As Long) As Byte
Public Declare Function ilutGLTexImage Lib "ilut" (ByVal Level As Long) As Byte
' Allegro and BeOS are probably irrelevant for VB, so they are left out...
' ImageLib Utility Toolkit's Win32 (DirectX/GDI) Functions
Public Declare Function ilutConvertToHBitmap Lib "ilut" (ByVal hDC As Integer) As Integer
' Public Declare Sub ilutGetBmpInfo Lib "ilut" (ByRef Info As BITMAPINFO)
' (The BITMAPINFO structure can probably not be ported to VB).
Public Declare Function ilutGetHPal Lib "ilut" () As Integer
Public Declare Function ilutGetPaddedData Lib "ilut" () As Long
Public Declare Function ilutGetWinClipboard Lib "ilut" () As Byte
Public Declare Function ilutLoadResource Lib "ilut" (ByVal hInst As Integer, ByVal ID As Long, ByVal ResourceType As String, ByVal IType As Long) As Byte
Public Declare Function ilutSetHBitmap Lib "ilut" (ByVal Bitmap As Integer) As Byte
Public Declare Function ilutSetHPal Lib "ilut" (ByVal Pal As Integer) As Byte
Public Declare Function ilutSetWinClipboard Lib "ilut" () As Byte
Public Declare Function ilutWinLoadImage Lib "ilut" (ByVal FileName As String, ByVal hDC As Integer) As Integer
Public Declare Function ilutWinLoadUrl Lib "ilut" (ByVal Url As String) As Byte
Public Declare Function ilutWinSaveImage Lib "ilut" (ByVal FileName As String, ByVal Bitmap As Integer) As Byte
' The DirectX 8 functions below might not be compiled into the DLL, so I've not
' bothered figuring out whether VB can be fooled into handling all those pointers.
' ILAPI ILvoid ILAPIENTRY ilutD3D8MipFunc(ILuint NumLevels);
' ILAPI IDirect3DTexture8* ILAPIENTRY ilutD3D8Texture(IDirect3DDevice8 *Device);
' ILAPI IDirect3DVolumeTexture8* ILAPIENTRY ilutD3D8VolumeTexture(IDirect3DDevice8 *Device);
' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFile(IDirect3DDevice8 *Device, char *FileName, IDirect3DTexture8 **Texture);
' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFile(IDirect3DDevice8 *Device, char *FileName, IDirect3DVolumeTexture8 **Texture);
' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileInMemory(IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, IDirect3DTexture8 **Texture);
' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileInMemory(IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, IDirect3DVolumeTexture8 **Texture);
' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileHandle(IDirect3DDevice8 *Device, ILHANDLE File, IDirect3DTexture8 **Texture);
' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileHandle(IDirect3DDevice8 *Device, ILHANDLE File, IDirect3DVolumeTexture8 **Texture);
' // These two are not tested yet.
' ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromResource(IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, IDirect3DTexture8 **Texture);
' ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromResource(IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, IDirect3DVolumeTexture8 **Texture);
'
' ILAPI ILboolean ILAPIENTRY ilutD3D8LoadSurface(IDirect3DDevice8 *Device, IDirect3DSurface8 *Surface);
|