[191] | 1 | //-----------------------------------------------------------------------------
|
---|
| 2 | //
|
---|
| 3 | // ImageLib Utility Toolkit Sources
|
---|
| 4 | // Copyright (C) 2000-2002 by Denton Woods
|
---|
| 5 | // Last modified: 06/23/2002 <--Y2K Compliant! =]
|
---|
| 6 | //
|
---|
| 7 | // Filename: IL/ilut.h
|
---|
| 8 | //
|
---|
| 9 | // Description: The main include file for ILUT
|
---|
| 10 | //
|
---|
| 11 | //-----------------------------------------------------------------------------
|
---|
| 12 |
|
---|
| 13 |
|
---|
| 14 | #ifndef __ilut_h_
|
---|
| 15 | #ifndef __ILUT_H__
|
---|
| 16 |
|
---|
| 17 | #define __ilut_h_
|
---|
| 18 | #define __ILUT_H__
|
---|
| 19 |
|
---|
| 20 | #include <IL/il.h>
|
---|
| 21 | #include <IL/ilu.h>
|
---|
| 22 |
|
---|
| 23 | #ifdef __cplusplus
|
---|
| 24 | extern "C" {
|
---|
| 25 | #endif
|
---|
| 26 | /*
|
---|
| 27 | #ifdef _WIN32
|
---|
| 28 | #if defined(_MSC_VER) || defined(__BORLANDC__)
|
---|
| 29 | #ifndef IL_STATIC_LIB
|
---|
| 30 | #pragma comment(lib, "DevILU_DLL.lib")
|
---|
| 31 | #ifndef _IL_BUILD_LIBRARY
|
---|
| 32 | #pragma comment(lib, "DevILUT_DLL.lib")
|
---|
| 33 | #endif
|
---|
| 34 | #else
|
---|
| 35 | #ifndef _IL_BUILD_LIBRARY
|
---|
| 36 | #ifdef IL_DEBUG
|
---|
| 37 | #pragma comment(lib, "DevILUT_DBG.lib")
|
---|
| 38 | #else
|
---|
| 39 | #pragma comment(lib, "DevILUT.lib")
|
---|
| 40 | #endif//IL_DEBUG
|
---|
| 41 | #endif
|
---|
| 42 | #endif
|
---|
| 43 | #endif
|
---|
| 44 | #endif
|
---|
| 45 | */
|
---|
| 46 |
|
---|
| 47 | #define ILUT_VERSION_1_6_7 1
|
---|
| 48 | #define ILUT_VERSION 167
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | // Attribute Bits
|
---|
| 52 | #define ILUT_OPENGL_BIT 0x00000001
|
---|
| 53 | #define ILUT_D3D_BIT 0x00000002
|
---|
| 54 | #define ILUT_ALL_ATTRIB_BITS 0x000FFFFF
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | // Error Types
|
---|
| 58 | #define ILUT_INVALID_ENUM 0x0501
|
---|
| 59 | #define ILUT_OUT_OF_MEMORY 0x0502
|
---|
| 60 | #define ILUT_INVALID_VALUE 0x0505
|
---|
| 61 | #define ILUT_ILLEGAL_OPERATION 0x0506
|
---|
| 62 | #define ILUT_INVALID_PARAM 0x0509
|
---|
| 63 | #define ILUT_COULD_NOT_OPEN_FILE 0x050A
|
---|
| 64 | #define ILUT_STACK_OVERFLOW 0x050E
|
---|
| 65 | #define ILUT_STACK_UNDERFLOW 0x050F
|
---|
| 66 | #define ILUT_BAD_DIMENSIONS 0x0511
|
---|
| 67 | #define ILUT_NOT_SUPPORTED 0x0550
|
---|
| 68 |
|
---|
| 69 |
|
---|
| 70 | // State Definitions
|
---|
| 71 | #define ILUT_PALETTE_MODE 0x0600
|
---|
| 72 | #define ILUT_OPENGL_CONV 0x0610
|
---|
| 73 | #define ILUT_D3D_MIPLEVELS 0x0620
|
---|
| 74 | #define ILUT_MAXTEX_WIDTH 0x0630
|
---|
| 75 | #define ILUT_MAXTEX_HEIGHT 0x0631
|
---|
| 76 | #define ILUT_MAXTEX_DEPTH 0x0632
|
---|
| 77 | #define ILUT_GL_USE_S3TC 0x0634
|
---|
| 78 | #define ILUT_D3D_USE_DXTC 0x0634
|
---|
| 79 | #define ILUT_GL_GEN_S3TC 0x0635
|
---|
| 80 | #define ILUT_D3D_GEN_DXTC 0x0635
|
---|
| 81 | #define ILUT_S3TC_FORMAT 0x0705
|
---|
| 82 | #define ILUT_DXTC_FORMAT 0x0705
|
---|
| 83 | #define ILUT_D3D_POOL 0x0706
|
---|
| 84 | #define ILUT_D3D_ALPHA_KEY_COLOR 0x0707
|
---|
| 85 | #define ILUT_D3D_ALPHA_KEY_COLOUR 0x0707
|
---|
| 86 |
|
---|
| 87 | //This new state does automatic texture target detection
|
---|
| 88 | //if enabled. Currently, only cubemap detection is supported.
|
---|
| 89 | //if the current image is no cubemap, the 2d texture is chosen.
|
---|
| 90 | #define ILUT_GL_AUTODETECT_TEXTURE_TARGET 0x0807
|
---|
| 91 |
|
---|
| 92 |
|
---|
| 93 | // Values
|
---|
| 94 | #define ILUT_VERSION_NUM IL_VERSION_NUM
|
---|
| 95 | #define ILUT_VENDOR IL_VENDOR
|
---|
| 96 |
|
---|
| 97 |
|
---|
| 98 | // ImageLib Utility Toolkit Functions
|
---|
| 99 | ILAPI ILboolean ILAPIENTRY ilutDisable(ILenum Mode);
|
---|
| 100 | ILAPI ILboolean ILAPIENTRY ilutEnable(ILenum Mode);
|
---|
| 101 | ILAPI ILboolean ILAPIENTRY ilutGetBoolean(ILenum Mode);
|
---|
| 102 | ILAPI ILvoid ILAPIENTRY ilutGetBooleanv(ILenum Mode, ILboolean *Param);
|
---|
| 103 | ILAPI ILint ILAPIENTRY ilutGetInteger(ILenum Mode);
|
---|
| 104 | ILAPI ILvoid ILAPIENTRY ilutGetIntegerv(ILenum Mode, ILint *Param);
|
---|
| 105 | ILAPI const ILstring ILAPIENTRY ilutGetString(ILenum StringName);
|
---|
| 106 | ILAPI ILvoid ILAPIENTRY ilutInit(ILvoid);
|
---|
| 107 | ILAPI ILboolean ILAPIENTRY ilutIsDisabled(ILenum Mode);
|
---|
| 108 | ILAPI ILboolean ILAPIENTRY ilutIsEnabled(ILenum Mode);
|
---|
| 109 | ILAPI ILvoid ILAPIENTRY ilutPopAttrib(ILvoid);
|
---|
| 110 | ILAPI ILvoid ILAPIENTRY ilutPushAttrib(ILuint Bits);
|
---|
| 111 | ILAPI ILvoid ILAPIENTRY ilutSetInteger(ILenum Mode, ILint Param);
|
---|
| 112 |
|
---|
| 113 |
|
---|
| 114 | // The different rendering api's...more to be added later?
|
---|
| 115 | #define ILUT_OPENGL 0
|
---|
| 116 | #define ILUT_ALLEGRO 1
|
---|
| 117 | #define ILUT_WIN32 2
|
---|
| 118 | #define ILUT_DIRECT3D8 3
|
---|
| 119 | #define ILUT_DIRECT3D9 4
|
---|
| 120 |
|
---|
| 121 |
|
---|
| 122 | ILAPI ILboolean ILAPIENTRY ilutRenderer(ILenum Renderer);
|
---|
| 123 |
|
---|
| 124 | // Includes specific config
|
---|
| 125 | #ifdef DJGPP
|
---|
| 126 | #define ILUT_USE_ALLEGRO
|
---|
| 127 | #elif _WIN32_WCE
|
---|
| 128 | #define ILUT_USE_WIN32
|
---|
| 129 | #elif _WIN32
|
---|
| 130 | //#ifdef __GNUC__ //__CYGWIN32__ (Cygwin seems to not define this with DevIL builds)
|
---|
| 131 | #include "config.h"
|
---|
| 132 |
|
---|
| 133 | /*// Temporary fix for the SDL main() linker bug.
|
---|
| 134 | #ifdef ILUT_USE_SDL
|
---|
| 135 | #undef ILUT_USE_SDL
|
---|
| 136 | #endif//ILUT_USE_SDL*/
|
---|
| 137 |
|
---|
| 138 | /*#else
|
---|
| 139 | #define ILUT_USE_WIN32
|
---|
| 140 | #define ILUT_USE_OPENGL
|
---|
| 141 | #define ILUT_USE_SDL
|
---|
| 142 | #define ILUT_USE_DIRECTX8
|
---|
| 143 | #endif*/
|
---|
| 144 | #elif BEOS // Don't know the #define
|
---|
| 145 | #define ILUT_USE_BEOS
|
---|
| 146 | #define ILUT_USE_OPENGL
|
---|
| 147 | #elif MACOSX
|
---|
| 148 | #define ILUT_USE_OPENGL
|
---|
| 149 | #else
|
---|
| 150 | /*
|
---|
| 151 | * We are surely using a *nix so the configure script
|
---|
| 152 | * may have written the configured config.h header
|
---|
| 153 | */
|
---|
| 154 | #include "config.h"
|
---|
| 155 | #endif
|
---|
| 156 |
|
---|
| 157 | // ImageLib Utility Toolkit's OpenGL Functions
|
---|
| 158 | #ifdef ILUT_USE_OPENGL
|
---|
| 159 | #if defined(_MSC_VER) || defined(_WIN32)
|
---|
| 160 | //#define WIN32_LEAN_AND_MEAN
|
---|
| 161 | #include <windows.h>
|
---|
| 162 | #endif//_MSC_VER
|
---|
| 163 |
|
---|
| 164 | #ifdef __APPLE__
|
---|
| 165 | #include <OpenGL/gl.h>
|
---|
| 166 | #include <OpenGL/glu.h>
|
---|
| 167 | #else
|
---|
| 168 | #include <GL/gl.h>
|
---|
| 169 | #include <GL/glu.h>
|
---|
| 170 | #endif//__APPLE__
|
---|
| 171 |
|
---|
| 172 | ILAPI GLuint ILAPIENTRY ilutGLBindTexImage();
|
---|
| 173 | ILAPI GLuint ILAPIENTRY ilutGLBindMipmaps(ILvoid);
|
---|
| 174 | ILAPI ILboolean ILAPIENTRY ilutGLBuildMipmaps(ILvoid);
|
---|
| 175 | ILAPI GLuint ILAPIENTRY ilutGLLoadImage(const ILstring FileName);
|
---|
| 176 | ILAPI ILboolean ILAPIENTRY ilutGLScreen(ILvoid);
|
---|
| 177 | ILAPI ILboolean ILAPIENTRY ilutGLScreenie(ILvoid);
|
---|
| 178 | ILAPI ILboolean ILAPIENTRY ilutGLSaveImage(const ILstring FileName, GLuint TexID);
|
---|
| 179 | ILAPI ILboolean ILAPIENTRY ilutGLSetTex(GLuint TexID);
|
---|
| 180 | ILAPI ILboolean ILAPIENTRY ilutGLTexImage(GLuint Level);
|
---|
| 181 |
|
---|
| 182 | #endif//ILUT_USE_OPENGL
|
---|
| 183 |
|
---|
| 184 |
|
---|
| 185 | // ImageLib Utility Toolkit's Allegro Functions
|
---|
| 186 | #ifdef ILUT_USE_ALLEGRO
|
---|
| 187 | #include <allegro.h>
|
---|
| 188 | ILAPI BITMAP* ILAPIENTRY ilutAllegLoadImage(const ILstring FileName);
|
---|
| 189 | ILAPI BITMAP* ILAPIENTRY ilutConvertToAlleg(PALETTE Pal);
|
---|
| 190 | #endif//ILUT_USE_ALLEGRO
|
---|
| 191 |
|
---|
| 192 |
|
---|
| 193 | // ImageLib Utility Toolkit's SDL Functions
|
---|
| 194 | #ifdef ILUT_USE_SDL
|
---|
| 195 | #include <SDL.h>
|
---|
| 196 | ILAPI SDL_Surface* ILAPIENTRY ilutConvertToSDLSurface(unsigned int flags);
|
---|
| 197 | ILAPI SDL_Surface* ILAPIENTRY ilutSDLSurfaceLoadImage(const ILstring FileName);
|
---|
| 198 | ILAPI ILboolean ILAPIENTRY ilutSDLSurfaceFromBitmap(SDL_Surface *Bitmap);
|
---|
| 199 | #endif//ILUT_USE_SDL
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 | // ImageLib Utility Toolkit's BeOS Functions
|
---|
| 203 | #ifdef ILUT_USE_BEOS
|
---|
| 204 | ILAPI BBitmap ILAPIENTRY ilutConvertToBBitmap(ILvoid);
|
---|
| 205 | #endif//ILUT_USE_BEOS
|
---|
| 206 |
|
---|
| 207 |
|
---|
| 208 | // ImageLib Utility Toolkit's Win32 GDI Functions
|
---|
| 209 | #ifdef ILUT_USE_WIN32
|
---|
| 210 | #ifdef _WIN32
|
---|
| 211 | //#define WIN32_LEAN_AND_MEAN
|
---|
| 212 | #include <windows.h>
|
---|
| 213 | ILAPI HBITMAP ILAPIENTRY ilutConvertToHBitmap(HDC hDC);
|
---|
| 214 | ILAPI ILvoid ILAPIENTRY ilutFreePaddedData(ILubyte *Data);
|
---|
| 215 | ILAPI ILvoid ILAPIENTRY ilutGetBmpInfo(BITMAPINFO *Info);
|
---|
| 216 | ILAPI HPALETTE ILAPIENTRY ilutGetHPal(ILvoid);
|
---|
| 217 | ILAPI ILubyte* ILAPIENTRY ilutGetPaddedData(ILvoid);
|
---|
| 218 | ILAPI ILboolean ILAPIENTRY ilutGetWinClipboard(ILvoid);
|
---|
| 219 | ILAPI ILboolean ILAPIENTRY ilutLoadResource(HINSTANCE hInst, ILint ID, const ILstring ResourceType, ILenum Type);
|
---|
| 220 | ILAPI ILboolean ILAPIENTRY ilutSetHBitmap(HBITMAP Bitmap);
|
---|
| 221 | ILAPI ILboolean ILAPIENTRY ilutSetHPal(HPALETTE Pal);
|
---|
| 222 | ILAPI ILboolean ILAPIENTRY ilutSetWinClipboard(ILvoid);
|
---|
| 223 | ILAPI HBITMAP ILAPIENTRY ilutWinLoadImage(const ILstring FileName, HDC hDC);
|
---|
| 224 | ILAPI ILboolean ILAPIENTRY ilutWinLoadUrl(const ILstring Url);
|
---|
| 225 | ILAPI ILboolean ILAPIENTRY ilutWinPrint(ILuint XPos, ILuint YPos, ILuint Width, ILuint Height, HDC hDC);
|
---|
| 226 | ILAPI ILboolean ILAPIENTRY ilutWinSaveImage(const ILstring FileName, HBITMAP Bitmap);
|
---|
| 227 |
|
---|
| 228 | #endif//_WIN32
|
---|
| 229 | #endif//ILUT_USE_WIN32
|
---|
| 230 |
|
---|
| 231 |
|
---|
| 232 | #ifdef ILUT_USE_DIRECTX9
|
---|
| 233 | #ifdef _WIN32
|
---|
| 234 | // #include <d3d9.h>
|
---|
| 235 | // ILAPI ILvoid ILAPIENTRY ilutD3D9MipFunc(ILuint NumLevels);
|
---|
| 236 | ILAPI struct IDirect3DTexture9* ILAPIENTRY ilutD3D9Texture(struct IDirect3DDevice9 *Device);
|
---|
| 237 | ILAPI struct IDirect3DVolumeTexture9* ILAPIENTRY ilutD3D9VolumeTexture(struct IDirect3DDevice9 *Device);
|
---|
| 238 | ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DTexture9 **Texture);
|
---|
| 239 | ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DVolumeTexture9 **Texture);
|
---|
| 240 | ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DTexture9 **Texture);
|
---|
| 241 | ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DVolumeTexture9 **Texture);
|
---|
| 242 | ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DTexture9 **Texture);
|
---|
| 243 | ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DVolumeTexture9 **Texture);
|
---|
| 244 | // These two are not tested yet.
|
---|
| 245 | ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DTexture9 **Texture);
|
---|
| 246 | ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DVolumeTexture9 **Texture);
|
---|
| 247 |
|
---|
| 248 | ILAPI ILboolean ILAPIENTRY ilutD3D9LoadSurface(struct IDirect3DDevice9 *Device, struct IDirect3DSurface9 *Surface);
|
---|
| 249 | #endif//_WIN32
|
---|
| 250 | #endif//ILUT_USE_DIRECTX9
|
---|
| 251 |
|
---|
| 252 | // ImageLib Utility Toolkit's DirectX 8 Functions
|
---|
| 253 | #ifdef ILUT_USE_DIRECTX8
|
---|
| 254 | #ifdef _WIN32
|
---|
| 255 | // #ifndef _D3D8_H_
|
---|
| 256 | // #include <d3d8.h>
|
---|
| 257 | // #endif
|
---|
| 258 | // ILAPI ILvoid ILAPIENTRY ilutD3D8MipFunc(ILuint NumLevels);
|
---|
| 259 | ILAPI struct IDirect3DTexture8* ILAPIENTRY ilutD3D8Texture(struct IDirect3DDevice8 *Device);
|
---|
| 260 | ILAPI struct IDirect3DVolumeTexture8* ILAPIENTRY ilutD3D8VolumeTexture(struct IDirect3DDevice8 *Device);
|
---|
| 261 | ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DTexture8 **Texture);
|
---|
| 262 | ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DVolumeTexture8 **Texture);
|
---|
| 263 | ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileInMemory(struct IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DTexture8 **Texture);
|
---|
| 264 | ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileInMemory(struct IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DVolumeTexture8 **Texture);
|
---|
| 265 | ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DTexture8 **Texture);
|
---|
| 266 | ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DVolumeTexture8 **Texture);
|
---|
| 267 | // These two are not tested yet.
|
---|
| 268 | ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DTexture8 **Texture);
|
---|
| 269 | ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DVolumeTexture8 **Texture);
|
---|
| 270 |
|
---|
| 271 | ILAPI ILboolean ILAPIENTRY ilutD3D8LoadSurface(struct IDirect3DDevice8 *Device, struct IDirect3DSurface8 *Surface);
|
---|
| 272 | #endif//_WIN32
|
---|
| 273 | #endif//ILUT_USE_DIRECTX8
|
---|
| 274 |
|
---|
| 275 |
|
---|
| 276 | #ifdef __cplusplus
|
---|
| 277 | }
|
---|
| 278 | #endif
|
---|
| 279 |
|
---|
| 280 | #endif // __ILUT_H__
|
---|
| 281 | #endif // __ilut_h_
|
---|