DevIL: A portable image library in development 0.1.7.8
交叉平台的图形类库,和FreeImage类似,我在用这个做图片转换,DevIL更新很慢,很多在用0.1.6.8版。
新版支持Unicode。我没完全测试。学大虾以前写的,再对着DevIL的h头文件,写这个包装类,没完善,有些方法字段不知道怎么写成C#的
大家看了后,请多测试,指点!
------------------------------使用方法------------------------------------------------------------------------
void DevILConvert(int imageId, string inputFile, string outputFile)
{
//string inputFile = Path.Combine(Path.Combine(filePath, fileDirectory), fileName);
//string outputFile = Path.Combine(Path.Combine(filePath, fileDirectory), "yinyangblue.jpg");
System.Diagnostics.Debug.WriteLine("DevDevILConversionExamples - DevIL simple command line application.");
if (DevILConversion.ilGetInteger(DevILConversion.IL_VERSION_NUM) < DevILConversion.IL_VERSION )
{
System.Diagnostics.Debug.WriteLine("*** Your DevIL native libraries are older than what Tao.DevDevILConversion supports, get the latest DevIL native libraries. ***");
System.Diagnostics.Debug.WriteLine(string .Format ("Your DevIL native IL version: {0}. DevILConversion's IL version: {1}.",DevILConversion.ilGetInteger(DevILConversion.IL_VERSION_NUM), DevILConversion.IL_VERSION));
return;
}
// Initialize DevIL
DevILConversion.ilInit();
// Generate the main image name to use
DevILConversion.ilGenImages(1, out imageId);
// Bind this image name
DevILConversion.ilBindImage(imageId);
/*DevIL can load Bitmap (.bmp), Cut (.cut), Doom flats and textures, Icon (.ico), Jpeg (.jpg, .jpe, .jpeg), Lbm (.lbm), Pcd (.pcd), ZSoft Pcx (.pcx), Pic (.pic), Portable Anymap (.pbm, .pgm, .ppm), Portable Network Graphics (.png), Sgi (.sgi, .bw, .rgb, .rgba), Truevision Targa (.tga) and Tiff (.tif, .tiff) images. */
// Loads the image into the imageId
if (!DevILConversion.ilLoadImage(inputFile))
{
System.Diagnostics.Debug.WriteLine("Could not open file, {0}, exiting.", inputFile);
return;
}
// Display the image's dimensions
System.Diagnostics.Debug.WriteLine(string.Format("Width: {0} Height: {1}, Depth: {2}, Bpp: {3}",
DevILConversion.ilGetInteger(DevILConversion.IL_IMAGE_WIDTH), DevILConversion.ilGetInteger(DevILConversion.IL_IMAGE_HEIGHT),
DevILConversion.ilGetInteger(DevILConversion.IL_IMAGE_DEPTH),
DevILConversion.ilGetInteger(DevILConversion.IL_IMAGE_BITS_PER_PIXEL)));
// Enable overwriting destination file
DevILConversion.ilEnable(DevILConversion.IL_FILE_OVERWRITE);
// Save the image
DevILConversion.ilSaveImage(outputFile);
// Example of Overwriting Files
//ilEnable(IL_FILE_OVERWRITE);
//ilSave("monkey.tga", IL_TGA);
//ilSave("monkey.tga");
// Done with the imageId, so let's delete it
DevILConversion.ilDeleteImages(1, ref imageId);
}
-------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Security;
#region Aliases
using ILHANDLE = System.IntPtr;
//typedef unsigned int ILenum;
using ILenum = System.Int32;
//typedef unsigned char ILboolean;
using ILboolean = System.Boolean;
//typedef unsigned int ILbitfield;
using ILbitfield = System.UInt32;
//typedef char ILbyte;
using ILbyte = System.Byte;
//typedef short ILshort;
using ILshort = System.Int16;
//typedef int ILint;
using ILint = System.Int32;
//typedef int ILsizei;
using ILsizei = System.Int32;
//typedef unsigned char ILubyte;
using ILubyte = System.Byte;
//typedef unsigned short ILushort;
using ILushort = System.UInt16;
//typedef unsigned int ILuint;
using ILuint = System.Int32;
//typedef float ILfloat;
using ILfloat = System.Single;
//typedef float ILclampf;
using ILclampf = System.Single;
//typedef double ILdouble;
using ILdouble = System.Double;
//typedef double ILclampd;
using ILclampd = System.Double;
//typedef void ILvoid;
//using ILvoid = void;
using ILstring = System.String;
#endregion Aliases
namespace WindowsApplication2
{
/// <summary>
/// DevIL.dll v 0.1.7.8 C# Wapper Lib
/// 多媒体图片转换类
/// </summary>
public class DevILConversion
{
/*
Beginner's Step-by-Step Tutorial Last Revised: 11:13 PM 12/20/2000
The task of using DevIL may seem daunting at first, with the multitudes of functions available, but DevIL is actually relatively easy to use. This tutorial will show you how to create a simple DevIL application to load, save and display a variety of images.
Checking Versions
This is a critical first step for any well-written application that utilizes DevIL. With almost all compilers supported, DevIL is generated as a shared library. Even though the function names may all be the same, earlier versions of DevIL may have inconsistencies that render your application unuseable. Bugfixes are constantly introduced to try to make DevIL the best image library ever. The drawback to shared libraries is that a user may inadvertently (or purposefully) replace a newer version of DevIL with an older version than your application was designed for. Luckily, DevIL provides version mechanisms to check versions -- ilGetInteger, iluGetInteger and ilutGetInteger. There are #defines in all three libraries that provide the version number your application was compiled with to check against the version number returned by their respective GetInteger functions: IL_VERSION, ILU_VERSION and ILUT_VERSION.
Example of version checking.
if (ilGetInteger(IL_VERSION_NUM) < IL_VERSION ||
iluGetInteger(ILU_VERSION_NUM) < ILU_VERSION)
ilutGetInteger(ILUT_VERSION_NUM) < ILUT_VERSION) {
printf("DevIL version is different...exiting!/n");
return 1;
}
Initializing the Library
With compilers that support shared libraries, no initialization is required, as DevIL is automatically intialized when it is loaded by an application. Initialization is recommended, though, to ease any porting troubles. Plus, it is only one additional line of source. All that is needed to initialize DevIL is to call ilInit. No parameters are even needed.
Image Names
DevIL's image name system is virtually identical to OpenGL's texture name system. First, you need an image name variable:
ILuint ImageName;
Next, generate an image name to be put in this variable:
ilGenImages(1, &ImageName);
Now bind this image name so that DevIL performs all subsequent operations on this image:
ilBindImage(ImageName);
Creating images is as simple as that. No messy pointers or anything else to mess with. To get an in-depth explanation of image names, read the tutorial on them.
Loading an Image
Loading an image is as simple as it can be with DevIL. For most programs, a simple call to ilLoadImage will suffice. IF the image was not loaded due to any of various reasons, ilLoadImage returns false, else it returns true if the image was successfully loaded.
Code for loading an image.
ilLoadImage("monkey.tga");
Saving an Image
Saving an image is just as easy as loading an image via DevIL. Just call ilSaveImage with the desired filename as the only parameter. If DevIL could not save the image, ilSaveImage returns false, else it returns true. By default, DevIL will refuse to overwrite any images that already exist on the harddrive to prevent from overwriting important data. To change this behaviour to allow overwriting of files, use ilEnable with the IL_FILE_OVERWRITE parameter.
Code for saving an image.
ilEnable(IL_FILE_OVERWRITE);
ilSaveImage("llama.jpg");
Checking for Errors
Occassionally, errors may occur in DevIL, such as an image not being loaded. If an DevIL function returns indicating an error (e.g. returns false from a function that returns an ILboolean), an error code is set internally in DevIL and may be retrieved via ilGetError. Usually, the code is quite specific about what kind of error occurred. DevIL maintains an error stack (usually 32 errors deep) so that if more than one error is set, an error doesn't get "lost". When you call ilGetError, the last error set is popped off of the stack. If no error has occurred, or all the errors have been popped off of the stack, ilGetError returns IL_NO_ERROR.
For a more in-depth discussion of errors, read the tutorial on them.
Code for detecting an error.
ILenum Error;
Error = ilGetError();
Image Information
Of course DevIL would be pretty useless if you could not retrieve information about the image somehow. ilGetInteger serves this purpose very well, allowing you to know pretty much everything about an image. Some useful values to pass as parameters to ilGetInteger are IL_IMAGE_WIDTH, IL_IMAGE_HEIGHT and IL_IMAGE_BPP. All of these and more are defined in DevIL's il.h header.
Code for getting an image's width and height.
ILuint Width, Height;
Width = ilGetInteger(IL_IMAGE_WIDTH);
Height = ilGetInteger(IL_IMAGE_HEIGHT);
Image Data
To get a pointer to the image data for your own use, make a call to ilGetData. ilGetData returns a direct pointer to the image data. Do not try to free this pointer when you are done with it, as it does not point to a copy of the image data but to the actual image data. The image data is freed when you delete the image.
Code for getting the image data.
ILubyte *Data = ilGetData();
Display the Image
DevIL supports several different APIs for displaying an image through ilut. Since ilut is separate from il, you could manually send data to the API just as ilut does, though it would require more code and time from you (same as writing your own image routines =). Right now, we will only focus on OpenGL though, as DevIL is OpenGL's bastard sibling.
For a much more in-depth discussion of using DevIL with OpenGL, read this tutorial.
Before you call any ilut functions dealing with OpenGL and after you have initialized OpenGL, you *must* call ilutRenderer with the ILUT_OPENGL parameter to initialize ilut correctly.
Most applications will then only need to call ilutGLBindTexImage to get a corresponding OpenGL texture from the DevIL image. If you only need to use the OpenGL texture and not the DevIL image after this, it is safe to delete the image.
Example of getting an OpenGL texture.
GLuint Texture;
Texture = ilutGLBindTexImage().
Deleting an Image
To delete an image when you are through with it, call ilDeleteImages. ilDeleteImages frees all data and makes that image name available for use in the future. ilDeleteImages has a syntax exactly like ilGenImages, and the functions are each other's complement.
Example of deleting an image.
ilDeleteImages(1, &ImageName);
*/
#region string DEVIL_NATIVE_LIBRARY
/// <summary>
/// Specifies the DevIL native library used in the bindings
/// </summary>
/// <remarks>
/// The Windows dll is specified here universally - note that
/// under Mono the non-windows native library can be mapped using
/// the ".config" file mechanism. Kudos to the Mono team for this
/// simple yet elegant solution.
/// </remarks>
private const string DEVIL_NATIVE_LIBRARY = "DevIL.dll";
#endregion string DEVIL_NATIVE_LIBRARY
#region CallingConvention CALLING_CONVENTION
/// <summary>
/// Specifies the calling convention.
/// </summary>
/// <remarks>
/// Specifies <see cref="CallingConvention.Winapi" />.
/// </remarks>
private const CallingConvention CALLING_CONVENTION = CallingConvention.Winapi ;
#endregion CallingConvention CALLING_CONVENTION
#region Defines
//#define __il_h_
//#define __IL_H__
//#define CLAMP_HALF 1
public const int CLAMP_HALF = 1;
//#define CLAMP_FLOATS 1
public const int CLAMP_FLOATS = 1;
//#define CLAMP_DOUBLES 1
public const int CLAMP_DOUBLES = 1;
//#define RESTRICT
//#define CONST_RESTRICT const
//#define ILchar char
//#define ILstring char*
//#define ILconst_string char const *
//#define IL_FALSE 0
public const int IL_FALSE = 0;
//#define IL_TRUE 1
public const int IL_TRUE = 1;
//#define IL_COLOUR_INDEX 0x1900
public const int IL_COLOUR_INDEX = 0x1900;
#endregion
#region // Data formats Formats.
//#define IL_COLOR_INDEX 0x1900
public const int IL_COLOR_INDEX = 0x1900;
//#define IL_ALPHA 0x1906
public const int IL_ALPHA = 0x1906;
//#define IL_RGB 0x1907
public const int IL_RGB = 0x1907;
//#define IL_RGBA 0x1908
public const int IL_RGBA = 0x1908;
//#define IL_BGR 0x80E0
public const int IL_BGR = 0x80E0;
//#define IL_BGRA 0x80E1
public const int IL_BGRA = 0x80E1;
//#define IL_LUMINANCE 0x1909
public const int IL_LUMINANCE = 0x1909;
//#define IL_LUMINANCE_ALPHA 0x190A
public const int IL_LUMINANCE_ALPHA = 0x190A;
//#define IL_BYTE 0x1400
public const int IL_BYTE = 0x1400;
#endregion
#region // Data types Types.
// Data types Types.
#region
//#define IL_UNSIGNED_BYTE 0x1401
public const int IL_UNSIGNED_BYTE = 0x1401;
//#define IL_SHORT 0x1402
public const int IL_SHORT = 0x1402;
//#define IL_UNSIGNED_SHORT 0x1403
public const int IL_UNSIGNED_SHORT = 0x1403;
//#define IL_INT 0x1404
public const int IL_INT = 0x1404;
//#define IL_UNSIGNED_INT 0x1405
public const int IL_UNSIGNED_INT = 0x1405;
//#define IL_FLOAT 0x1406
public const int IL_FLOAT = 0x1406;
//#define IL_DOUBLE 0x140A
public const int IL_DOUBLE = 0x140A;
//#define IL_HALF 0x140B
public const int IL_HALF = 0x140B;
#endregion
#region
//#define IL_MAX_BYTE SCHAR_MAX
//#define IL_MAX_UNSIGNED_BYTE UCHAR_MAX
//#define IL_MAX_SHORT SHRT_MAX
//#define IL_MAX_UNSIGNED_SHORT USHRT_MAX
//#define IL_MAX_INT INT_MAX
//#define IL_MAX_UNSIGNED_INT UINT_MAX
//#define IL_LIMIT(x, m, M) (x<m?m:(x>M?M:x))
//#define IL_CLAMP(x) IL_LIMIT(x,0,1)
#endregion
#region
//#define IL_VENDOR 0x1F00
public const int IL_VENDOR = 0x1F00;
//#define IL_LOAD_EXT 0x1F01
public const int IL_LOAD_EXT = 0x1F01;
//#define IL_SAVE_EXT 0x1F02
public const int IL_SAVE_EXT = 0x1F02;
//#define IL_VERSION_1_7_8 1
public const int IL_VERSION_1_7_8 = 1;
//#define IL_VERSION 178
public const int IL_VERSION = 178;
//#define IL_ORIGIN_BIT 0x00000001
public const int IL_ORIGIN_BIT = 0x00000001;
//#define IL_FILE_BIT 0x00000002
public const int IL_FILE_BIT = 0x00000002;
//#define IL_PAL_BIT 0x00000004
public const int IL_PAL_BIT = 0x00000004;
//#define IL_FORMAT_BIT 0x00000008
public const int IL_FORMAT_BIT = 0x00000008;
//#define IL_TYPE_BIT 0x00000010
public const int IL_TYPE_BIT = 0x00000010;
//#define IL_COMPRESS_BIT 0x00000020
public const int IL_COMPRESS_BIT = 0x00000020;
//#define IL_LOADFAIL_BIT 0x00000040
public const int IL_LOADFAIL_BIT = 0x00000040;
//#define IL_FORMAT_SPECIFIC_BIT 0x00000080
public const int IL_FORMAT_SPECIFIC_BIT = 0x00000080;
//#define IL_ALL_ATTRIB_BITS 0x000FFFFF
public const int IL_ALL_ATTRIB_BITS = 0x000FFFFF;
#endregion
#region PAL
//#define IL_PAL_NONE 0x0400
public const int IL_PAL_NONE = 0x0400;
//#define IL_PAL_RGB24 0x0401
public const int IL_PAL_RGB24 = 0x0401;
//#define IL_PAL_RGB32 0x0402
public const int IL_PAL_RGB32 = 0x0402;
//#define IL_PAL_RGBA32 0x0403
public const int IL_PAL_RGBA32 = 0x0403;
//#define IL_PAL_BGR24 0x0404
public const int IL_PAL_BGR24 = 0x0404;
//#define IL_PAL_BGR32 0x0405
public const int IL_PAL_BGR32 = 0x0405;
//#define IL_PAL_BGRA32 0x0406
public const int IL_PAL_BGRA32 = 0x0406;
#endregion
//#define IL_TYPE_UNKNOWN 0x0000
public const int IL_TYPE_UNKNOWN = 0x0000;
#region define image formats values
/// <summary>
/#define IL_BMP 0x0420
/// Microsoft Windows Bitmap - .bmp extension.
/// </summary>
public const int IL_BMP = 0x0420;
/// <summary>
/// #define IL_CUT 0x0421
/// Dr. Halo - .cut extension.
/// </summary>
public const int IL_CUT = 0x0421;
/// <summary>
///#define IL_DOOM 0x0422
/// DooM walls - no specific extension.
/// </summary>
public const int IL_DOOM = 0x0422;
//#define IL_DOOM_FLAT 0x0423
// DooM flats - no specific extension.
public const int IL_DOOM_FLAT = 0x0423;
//#define IL_ICO 0x0424
// Microsoft Windows Icons and Cursors - .ico and .cur extensions.
public const int IL_ICO = 0x0424;
//#define IL_JPG 0x0425
// JPEG - .jpg, .jpe and .jpeg extensions.
public const int IL_JPG = 0x0425;
//#define IL_JFIF 0x0425
public const int IL_JFIF = 0x0425;
//#define IL_ILBM 0x0426
// Amiga IFF (FORM ILBM) - .iff, .ilbm, .lbm extensions.
public const int IL_ILBM = 0x0426;
//#define IL_PCD 0x0427
// Kodak PhotoCD - .pcd extension.
public const int IL_PCD = 0x0427;
//#define IL_PCX 0x0428
// ZSoft PCX - .pcx extension.
public const int IL_PCX = 0x0428;
//#define IL_PIC 0x0429
// PIC - .pic extension.
public const int IL_PIC = 0x0429;
//#define IL_PNG 0x042A
// Portable Network Graphics - .png extension.
public const int IL_PNG = 0x042A;
//#define IL_PNM 0x042B
// Portable Any Map - .pbm, .pgm, .ppm and .pnm extensions.
public const int IL_PNM = 0x042B;
//#define IL_SGI 0x042C
// Silicon Graphics - .sgi, .bw, .rgb and .rgba extensions.
public const int IL_SGI = 0x042C;
//#define IL_TGA 0x042D
// TrueVision Targa File - .tga, .vda, .icb and .vst extensions.
public const int IL_TGA = 0x042D;
//#define IL_TIF 0x042E
// Tagged Image File Format - .tif and .tiff extensions.
public const int IL_TIF = 0x042E;
//#define IL_CHEAD 0x042F
// C-Style Header - .h extension.
public const int IL_CHEAD = 0x042F;
//#define IL_RAW 0x0430
// Raw Image Data - any extension.
public const int IL_RAW = 0x0430;
//#define IL_MDL 0x0431
// Half-Life Model Texture - .mdl extension.
public const int IL_MDL = 0x0431;
//#define IL_WAL 0x0432
// Quake 2 Texture - .wal extension.
public const int IL_WAL = 0x0432;
//#define IL_LIF 0x0434
// Homeworld Texture - .lif extension.
public const int IL_LIF = 0x0434;
//#define IL_MNG 0x0435
// Multiple-image Network Graphics - .mng extension.
public const int IL_MNG = 0x0435;
//#define IL_JNG 0x0435
public const int IL_JNG = 0x0435;
//#define IL_GIF 0x0436
// Graphics Interchange Format - .gif extension.
public const int IL_GIF = 0x0436;
//#define IL_DDS 0x0437
// DirectDraw Surface - .dds extension.
public const int IL_DDS = 0x0437;
//#define IL_DCX 0x0438
// ZSoft Multi-PCX - .dcx extension.
public const int IL_DCX = 0x0438;
//#define IL_PSD 0x0439
// Adobe PhotoShop - .psd extension.
public const int IL_PSD = 0x0439;
//#define IL_EXIF 0x043A
public const int IL_EXIF = 0x043A;
//#define IL_PSP 0x043B
// PaintShop Pro - .psp extension.
public const int IL_PSP = 0x043B;
//#define IL_PIX 0x043C
// PIX - .pix extension.
public const int IL_PIX = 0x043C;
//#define IL_PXR 0x043D
// Pixar - .pxr extension.
public const int IL_PXR = 0x043D;
//#define IL_XPM 0x043E
// X Pixel Map - .xpm extension.
public const int IL_XPM = 0x043E;
//#define IL_HDR 0x043F
// Radiance High Dynamic Range - .hdr extension.
public const int IL_HDR = 0x043F;
//#define IL_ICNS 0x0440
// Macintosh Icon - .icns extension.
public const int IL_ICNS = 0x0440;
//#define IL_JP2 0x0441
// Jpeg 2000 - .jp2 extension.
public const int IL_JP2 = 0x0441;
//#define IL_EXR 0x0442
// OpenEXR - .exr extension.
public const int IL_EXR = 0x0442;
//#define IL_WDP 0x0443
// Microsoft HD Photo - .wdp and .hdp extension.
public const int IL_WDP = 0x0443;
//#define IL_VTF 0x0444
// Valve Texture Format - .vtf extension.
public const int IL_VTF = 0x0444;
//#define IL_WBMP 0x0445
// Wireless Bitmap - .wbmp extension.
public const int IL_WBMP = 0x0445;
//#define IL_SUN 0x0446
// Sun Raster - .sun, .ras, .rs, .im1, .im8, .im24 and .im32 extensions.
public const int IL_SUN = 0x0446;
//#define IL_IFF 0x0447
// Interchange File Format - .iff extension.
public const int IL_IFF = 0x0447;
//#define IL_TPL 0x0448
// Gamecube Texture - .tpl extension.
public const int IL_TPL = 0x0448;
//#define IL_FITS 0x0449
// Flexible Image Transport System - .fit and .fits extensions.
public const int IL_FITS = 0x0449;
//#define IL_DICOM 0x044A
// Digital Imaging and Communications in Medicine (DICOM) - .dcm and .dicom extensions.
public const int IL_DICOM = 0x044A;
//#define IL_IWI 0x044B
// Call of Duty Infinity Ward Image - .iwi extension.
public const int IL_IWI = 0x044B;
//#define IL_BLP 0x044C
// Blizzard Texture Format - .blp extension.
public const int IL_BLP = 0x044C;
//#define IL_FTX 0x044D
// Heavy Metal: FAKK2 Texture - .ftx extension.
public const int IL_FTX = 0x044D;
//#define IL_ROT 0x044E
// Homeworld 2 - Relic Texture - .rot extension.
public const int IL_ROT = 0x044E;
//#define IL_TEXTURE 0x044F
// Medieval II: Total War Texture - .texture extension.
public const int IL_TEXTURE = 0x044F;
//#define IL_DPX 0x0450
// Digital Picture Exchange - .dpx extension.
public const int IL_DPX = 0x0450;
//#define IL_UTX 0x0451
// Unreal (and Unreal Tournament) Texture - .utx extension.
public const int IL_UTX = 0x0451;
//#define IL_MP3 0x0452
// MPEG-1 Audio Layer 3 - .mp3 extension.
public const int IL_MP3 = 0x0452;
//#define IL_JASC_PAL 0x0475
// PaintShop Pro Palette.
public const int IL_JASC_PAL = 0x0475;
#endregion
#region
//#define IL_NO_ERROR 0x0000
public const int IL_NO_ERROR = 0x0000;
//#define IL_INVALID_ENUM 0x0501
public const int IL_INVALID_ENUM = 0x0501;
//#define IL_OUT_OF_MEMORY 0x0502
public const int IL_OUT_OF_MEMORY = 0x0502;
//#define IL_FORMAT_NOT_SUPPORTED 0x0503
public const int IL_FORMAT_NOT_SUPPORTED = 0x0503;
//#define IL_INTERNAL_ERROR 0x0504
public const int IL_INTERNAL_ERROR = 0x0504;
//#define IL_INVALID_VALUE 0x0505
public const int IL_INVALID_VALUE = 0x0505;
//#define IL_ILLEGAL_OPERATION 0x0506
public const int IL_ILLEGAL_OPERATION = 0x0506;
//#define IL_ILLEGAL_FILE_VALUE 0x0507
public const int IL_ILLEGAL_FILE_VALUE = 0x0507;
//#define IL_INVALID_FILE_HEADER 0x0508
public const int IL_INVALID_FILE_HEADER = 0x0508;
//#define IL_INVALID_PARAM 0x0509
public const int IL_INVALID_PARAM = 0x0509;
//#define IL_COULD_NOT_OPEN_FILE 0x050A
public const int IL_COULD_NOT_OPEN_FILE = 0x050A;
//#define IL_INVALID_EXTENSION 0x050B
public const int IL_INVALID_EXTENSION = 0x050B;
//#define IL_FILE_ALREADY_EXISTS 0x050C
public const int IL_FILE_ALREADY_EXISTS = 0x050C;
//#define IL_OUT_FORMAT_SAME 0x050D
public const int IL_OUT_FORMAT_SAME = 0x050D;
//#define IL_STACK_OVERFLOW 0x050E
public const int IL_STACK_OVERFLOW = 0x050E;
//#define IL_STACK_UNDERFLOW 0x050F
public const int IL_STACK_UNDERFLOW = 0x050F;
//#define IL_INVALID_CONVERSION 0x0510
public const int IL_INVALID_CONVERSION = 0x0510;
//#define IL_BAD_DIMENSIONS 0x0511
public const int IL_BAD_DIMENSIONS = 0x0511;
//#define IL_FILE_READ_ERROR 0x0512
public const int IL_FILE_READ_ERROR = 0x0512;
//#define IL_FILE_WRITE_ERROR 0x0512
public const int IL_FILE_WRITE_ERROR = 0x0512;
//#define IL_LIB_GIF_ERROR 0x05E1
public const int IL_LIB_GIF_ERROR = 0x05E1;
//#define IL_LIB_JPEG_ERROR 0x05E2
public const int IL_LIB_JPEG_ERROR = 0x05E2;
//#define IL_LIB_PNG_ERROR 0x05E3
public const int IL_LIB_PNG_ERROR = 0x05E3;
//#define IL_LIB_TIFF_ERROR 0x05E4
public const int IL_LIB_TIFF_ERROR = 0x05E4;
//#define IL_LIB_MNG_ERROR 0x05E5
public const int IL_LIB_MNG_ERROR = 0x05E5;
//#define IL_LIB_JP2_ERROR 0x05E6
public const int IL_LIB_JP2_ERROR = 0x05E6;
//#define IL_LIB_EXR_ERROR 0x05E7
public const int IL_LIB_EXR_ERROR = 0x05E7;
//#define IL_UNKNOWN_ERROR 0x05FF
public const int IL_UNKNOWN_ERROR = 0x05FF;
//#define IL_ORIGIN_SET 0x0600
public const int IL_ORIGIN_SET = 0x0600;
//#define IL_ORIGIN_LOWER_LEFT 0x0601
public const int IL_ORIGIN_LOWER_LEFT = 0x0601;
//#define IL_ORIGIN_UPPER_LEFT 0x0602
public const int IL_ORIGIN_UPPER_LEFT = 0x0602;
//#define IL_ORIGIN_MODE 0x0603
public const int IL_ORIGIN_MODE = 0x0603;
//#define IL_FORMAT_SET 0x0610
public const int IL_FORMAT_SET = 0x0610;
//#define IL_FORMAT_MODE 0x0611
public const int IL_FORMAT_MODE = 0x0611;
//#define IL_TYPE_SET 0x0612
public const int IL_TYPE_SET = 0x0612;
//#define IL_TYPE_MODE 0x0613
public const int IL_TYPE_MODE = 0x0613;
//#define IL_FILE_OVERWRITE 0x0620
public const int IL_FILE_OVERWRITE = 0x0620;
//#define IL_FILE_MODE 0x0621
public const int IL_FILE_MODE = 0x0621;
//#define IL_CONV_PAL 0x0630
public const int IL_CONV_PAL = 0x0630;
//#define IL_DEFAULT_ON_FAIL 0x0632
public const int IL_DEFAULT_ON_FAIL = 0x0632;
//#define IL_USE_KEY_COLOUR 0x0635
public const int IL_USE_KEY_COLOUR = 0x0635;
//#define IL_USE_KEY_COLOR 0x0635
public const int IL_USE_KEY_COLOR = 0x0635;
//#define IL_BLIT_BLEND 0x0636
public const int IL_BLIT_BLEND = 0x0636;
//#define IL_SAVE_INTERLACED 0x0639
public const int IL_SAVE_INTERLACED = 0x0639;
//#define IL_INTERLACE_MODE 0x063A
public const int IL_INTERLACE_MODE = 0x063A;
//#define IL_QUANTIZATION_MODE 0x0640
public const int IL_QUANTIZATION_MODE = 0x0640;
//#define IL_WU_QUANT 0x0641
public const int IL_WU_QUANT = 0x0641;
//#define IL_NEU_QUANT 0x0642
public const int IL_NEU_QUANT = 0x0642;
//#define IL_NEU_QUANT_SAMPLE 0x0643
public const int IL_NEU_QUANT_SAMPLE = 0x0643;
//#define IL_MAX_QUANT_INDEXS 0x0644
public const int IL_MAX_QUANT_INDEXS = 0x0644;
//#define IL_MAX_QUANT_INDICES 0x0644
public const int IL_MAX_QUANT_INDICES = 0x0644;
//#define IL_FASTEST 0x0660
public const int IL_FASTEST = 0x0660;
//#define IL_LESS_MEM 0x0661
public const int IL_LESS_MEM = 0x0661;
//#define IL_DONT_CARE 0x0662
public const int IL_DONT_CARE = 0x0662;
//#define IL_MEM_SPEED_HINT 0x0665
public const int IL_MEM_SPEED_HINT = 0x0665;
//#define IL_USE_COMPRESSION 0x0666
public const int IL_USE_COMPRESSION = 0x0666;
//#define IL_NO_COMPRESSION 0x0667
public const int IL_NO_COMPRESSION = 0x0667;
//#define IL_COMPRESSION_HINT 0x0668
public const int IL_COMPRESSION_HINT = 0x0668;
//#define IL_NVIDIA_COMPRESS 0x0670
public const int IL_NVIDIA_COMPRESS = 0x0670;
//#define IL_SQUISH_COMPRESS 0x0671
public const int IL_SQUISH_COMPRESS = 0x0671;
//#define IL_SUB_NEXT 0x0680
public const int IL_SUB_NEXT = 0x0680;
//#define IL_SUB_MIPMAP 0x0681
public const int IL_SUB_MIPMAP = 0x0681;
//#define IL_SUB_LAYER 0x0682
public const int IL_SUB_LAYER = 0x0682;
//#define IL_COMPRESS_MODE 0x0700
public const int IL_COMPRESS_MODE = 0x0700;
//#define IL_COMPRESS_NONE 0x0701
public const int IL_COMPRESS_NONE = 0x0701;
//#define IL_COMPRESS_RLE 0x0702
public const int IL_COMPRESS_RLE = 0x0702;
//#define IL_COMPRESS_LZO 0x0703
public const int IL_COMPRESS_LZO = 0x0703;
//#define IL_COMPRESS_ZLIB 0x0704
public const int IL_COMPRESS_ZLIB = 0x0704;
//#define IL_TGA_CREATE_STAMP 0x0710
public const int IL_TGA_CREATE_STAMP = 0x0710;
//#define IL_JPG_QUALITY 0x0711
public const int IL_JPG_QUALITY = 0x0711;
//#define IL_PNG_INTERLACE 0x0712
public const int IL_PNG_INTERLACE = 0x0712;
//#define IL_TGA_RLE 0x0713
public const int IL_TGA_RLE = 0x0713;
//#define IL_BMP_RLE 0x0714
public const int IL_BMP_RLE = 0x0714;
//#define IL_SGI_RLE 0x0715
public const int IL_SGI_RLE = 0x0715;
//#define IL_TGA_ID_STRING 0x0717
public const int IL_TGA_ID_STRING = 0x0717;
//#define IL_TGA_AUTHNAME_STRING 0x0718
public const int IL_TGA_AUTHNAME_STRING = 0x0718;
//#define IL_TGA_AUTHCOMMENT_STRING 0x0719
public const int IL_TGA_AUTHCOMMENT_STRING = 0x0719;
//#define IL_PNG_AUTHNAME_STRING 0x071A
public const int IL_PNG_AUTHNAME_STRING = 0x071A;
//#define IL_PNG_TITLE_STRING 0x071B
public const int IL_PNG_TITLE_STRING = 0x071B;
//#define IL_PNG_DESCRIPTION_STRING 0x071C
public const int IL_PNG_DESCRIPTION_STRING = 0x071C;
//#define IL_TIF_DESCRIPTION_STRING 0x071D
public const int IL_TIF_DESCRIPTION_STRING = 0x071D;
//#define IL_TIF_HOSTCOMPUTER_STRING 0x071E
public const int IL_TIF_HOSTCOMPUTER_STRING = 0x071E;
//#define IL_TIF_DOCUMENTNAME_STRING 0x071F
public const int IL_TIF_DOCUMENTNAME_STRING = 0x071F;
//#define IL_TIF_AUTHNAME_STRING 0x0720
public const int IL_TIF_AUTHNAME_STRING = 0x0720;
//#define IL_JPG_SAVE_FORMAT 0x0721
public const int IL_JPG_SAVE_FORMAT = 0x0721;
//#define IL_CHEAD_HEADER_STRING 0x0722
public const int IL_CHEAD_HEADER_STRING = 0x0722;
//#define IL_PCD_PICNUM 0x0723
public const int IL_PCD_PICNUM = 0x0723;
//#define IL_PNG_ALPHA_INDEX 0x0724
public const int IL_PNG_ALPHA_INDEX = 0x0724;
//#define IL_JPG_PROGRESSIVE 0x0725
public const int IL_JPG_PROGRESSIVE = 0x0725;
//#define IL_VTF_COMP 0x0726
public const int IL_VTF_COMP = 0x0726;
//#define IL_DXTC_FORMAT 0x0705
public const int IL_DXTC_FORMAT = 0x0705;
//#define IL_DXT1 0x0706
public const int IL_DXT1 = 0x0706;
//#define IL_DXT2 0x0707
public const int IL_DXT2 = 0x0707;
//#define IL_DXT3 0x0708
public const int IL_DXT3 = 0x0708;
//#define IL_DXT4 0x0709
public const int IL_DXT4 = 0x0709;
//#define IL_DXT5 0x070A
public const int IL_DXT5 = 0x070A;
//#define IL_DXT_NO_COMP 0x070B
public const int IL_DXT_NO_COMP = 0x070B;
//#define IL_KEEP_DXTC_DATA 0x070C
public const int IL_KEEP_DXTC_DATA = 0x070C;
//#define IL_DXTC_DATA_FORMAT 0x070D
public const int IL_DXTC_DATA_FORMAT = 0x070D;
//#define IL_3DC 0x070E
public const int IL_3DC = 0x070E;
//#define IL_RXGB 0x070F
public const int IL_RXGB = 0x070F;
//#define IL_ATI1N 0x0710
public const int IL_ATI1N = 0x0710;
//#define IL_DXT1A 0x0711
public const int IL_DXT1A = 0x0711;
#endregion
#region IL_CUBEMAP
//#define IL_CUBEMAP_POSITIVEX 0x00000400
public const int IL_CUBEMAP_POSITIVEX = 0x00000400;
//#define IL_CUBEMAP_NEGATIVEX 0x00000800
public const int IL_CUBEMAP_NEGATIVEX = 0x00000800;
//#define IL_CUBEMAP_POSITIVEY 0x00001000
public const int IL_CUBEMAP_POSITIVEY = 0x00001000;
//#define IL_CUBEMAP_NEGATIVEY 0x00002000
public const int IL_CUBEMAP_NEGATIVEY = 0x00002000;
//#define IL_CUBEMAP_POSITIVEZ 0x00004000
public const int IL_CUBEMAP_POSITIVEZ = 0x00004000;
//#define IL_CUBEMAP_NEGATIVEZ 0x00008000
public const int IL_CUBEMAP_NEGATIVEZ = 0x00008000;
#endregion
//#define IL_SPHEREMAP 0x00010000
public const int IL_SPHEREMAP = 0x00010000;
//#define IL_VERSION_NUM 0x0DE2
public const int IL_VERSION_NUM = 0x0DE2;
#region IL_IMAGE
//#define IL_IMAGE_WIDTH 0x0DE4
public const int IL_IMAGE_WIDTH = 0x0DE4;
//#define IL_IMAGE_HEIGHT 0x0DE5
public const int IL_IMAGE_HEIGHT = 0x0DE5;
//#define IL_IMAGE_DEPTH 0x0DE6
public const int IL_IMAGE_DEPTH = 0x0DE6;
//#define IL_IMAGE_SIZE_OF_DATA 0x0DE7
public const int IL_IMAGE_SIZE_OF_DATA = 0x0DE7;
//#define IL_IMAGE_BPP 0x0DE8
public const int IL_IMAGE_BPP = 0x0DE8;
//#define IL_IMAGE_BYTES_PER_PIXEL 0x0DE8
public const int IL_IMAGE_BYTES_PER_PIXEL = 0x0DE8;
#define IL_IMAGE_BPP 0x0DE8
//public const int IL_IMAGE_BPP = 0x0DE8;
//#define IL_IMAGE_BITS_PER_PIXEL 0x0DE9
public const int IL_IMAGE_BITS_PER_PIXEL = 0x0DE9;
//#define IL_IMAGE_FORMAT 0x0DEA
public const int IL_IMAGE_FORMAT = 0x0DEA;
//#define IL_IMAGE_TYPE 0x0DEB
public const int IL_IMAGE_TYPE = 0x0DEB;
#endregion
#region IL_PALETTE
//#define IL_PALETTE_TYPE 0x0DEC
public const int IL_PALETTE_TYPE = 0x0DEC;
//#define IL_PALETTE_SIZE 0x0DED
public const int IL_PALETTE_SIZE = 0x0DED;
//#define IL_PALETTE_BPP 0x0DEE
public const int IL_PALETTE_BPP = 0x0DEE;
//#define IL_PALETTE_NUM_COLS 0x0DEF
public const int IL_PALETTE_NUM_COLS = 0x0DEF;
//#define IL_PALETTE_BASE_TYPE 0x0DF0
public const int IL_PALETTE_BASE_TYPE = 0x0DF0;
#endregion
#region IL_NUM
//#define IL_NUM_FACES 0x0DE1
public const int IL_NUM_FACES = 0x0DE1;
//#define IL_NUM_IMAGES 0x0DF1
public const int IL_NUM_IMAGES = 0x0DF1;
//#define IL_NUM_MIPMAPS 0x0DF2
public const int IL_NUM_MIPMAPS = 0x0DF2;
//#define IL_NUM_LAYERS 0x0DF3
public const int IL_NUM_LAYERS = 0x0DF3;
#endregion
#region IL_ACTIVE
//#define IL_ACTIVE_IMAGE 0x0DF4
public const int IL_ACTIVE_IMAGE = 0x0DF4;
//#define IL_ACTIVE_MIPMAP 0x0DF5
public const int IL_ACTIVE_MIPMAP = 0x0DF5;
//#define IL_ACTIVE_LAYER 0x0DF6
public const int IL_ACTIVE_LAYER = 0x0DF6;
//#define IL_ACTIVE_FACE 0x0E00
public const int IL_ACTIVE_FACE = 0x0E00;
#endregion
//#define IL_CUR_IMAGE 0x0DF7
public const int IL_CUR_IMAGE = 0x0DF7;
#region IL_IMAGE
//#define IL_IMAGE_DURATION 0x0DF8
public const int IL_IMAGE_DURATION = 0x0DF8;
//#define IL_IMAGE_PLANESIZE 0x0DF9
public const int IL_IMAGE_PLANESIZE = 0x0DF9;
//#define IL_IMAGE_BPC 0x0DFA
public const int IL_IMAGE_BPC = 0x0DFA;
//#define IL_IMAGE_OFFX 0x0DFB
public const int IL_IMAGE_OFFX = 0x0DFB;
//#define IL_IMAGE_OFFY 0x0DFC
public const int IL_IMAGE_OFFY = 0x0DFC;
//#define IL_IMAGE_CUBEFLAGS 0x0DFD
public const int IL_IMAGE_CUBEFLAGS = 0x0DFD;
//#define IL_IMAGE_ORIGIN 0x0DFE
public const int IL_IMAGE_ORIGIN = 0x0DFE;
//#define IL_IMAGE_CHANNELS 0x0DFF
public const int IL_IMAGE_CHANNELS = 0x0DFF;
#endregion
//#define DEPRECATED (D) D
//#define ILAPIENTRY
//#define IL_PACKSTRUCT
//#define ILAPI
#region
//#define IL_SEEK_SET 0
public const int IL_SEEK_SET = 0;
//#define IL_SEEK_CUR 1
public const int IL_SEEK_CUR = 1;
//#define IL_SEEK_END 2
public const int IL_SEEK_END = 2;
//#define IL_EOF -1
public const int IL_EOF = -1;
#endregion
//#define ilClearColor ilClearColour
//#define ilKeyColor ilKeyColour
//#define imemclear(x, y) memset(x,0,y);
#endregion
#region //Typedefs
#region MyRegion
//typedef unsigned int ILenum
//我想应该这样定义 System.UInt32 ILenum;
//typedef unsigned char ILboolean
//typedef unsigned int ILbitfield
//typedef signed char ILbyte
//typedef signed short ILshort
//typedef int ILint
//typedef size_t ILsizei
//typedef unsigned char ILubyte
//typedef unsigned short ILushort
//typedef unsigned int ILuint
//typedef float ILfloat
//typedef float ILclampf
//typedef double ILdouble
//typedef double ILclampd
//typedef long long int ILint64
//typedef long long unsigned int ILuint64
//typedef void * ILHANDLE
//#region Aliases
//using ILHANDLE = System.IntPtr;
typedef unsigned int ILenum;
//using ILenum = System.Int32;
typedef unsigned char ILboolean;
//using ILboolean = System.Boolean;
typedef unsigned int ILbitfield;
//using ILbitfield = System.UInt32;
typedef char ILbyte;
//using ILbyte = System.Byte;
typedef short ILshort;
//using ILshort = System.Int16;
typedef int ILint;
//using ILint = System.Int32;
typedef int ILsizei;
//using ILsizei = System.Int32;
typedef unsigned char ILubyte;
//using ILubyte = System.Byte;
typedef unsigned short ILushort;
//using ILushort = System.UInt16;
typedef unsigned int ILuint;
//using ILuint = System.Int32;
typedef float ILfloat;
//using ILfloat = System.Single;
typedef float ILclampf;
//using ILclampf = System.Single;
typedef double ILdouble;
//using ILdouble = System.Double;
typedef double ILclampd;
//using ILclampd = System.Double;
typedef void ILvoid;
using ILvoid = void;
//using ILstring = System.String;
//#endregion Aliases
#endregion
#region
//typedef void(ILAPIENTRY * fCloseRProc )(ILHANDLE)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void fCloseRProc(ILHANDLE handle);
//typedef void(ILAPIENTRY * fCloseWProc )(ILHANDLE)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void fCloseWProc(ILHANDLE handle);
//typedef void *(ILAPIENTRY * mAlloc )(const ILsizei)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void mAlloc(ILuint a);
//typedef ILenum(ILAPIENTRY * IL_LOADPROC )(ILconst_string)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILenum IL_LOADPROC(ILstring str);
//typedef ILenum(ILAPIENTRY * IL_SAVEPROC )(ILconst_string)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILenum IL_SAVEPROC(ILstring str);
#endregion
#endregion
#region //Functions [typedef as delegate]
//typedef ILboolean (ILAPIENTRY *fEofProc)(ILHANDLE)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILboolean fEofProc(ILHANDLE handle);
//typedef ILint (ILAPIENTRY *fGetcProc)(ILHANDLE)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fGetcProc(ILHANDLE handle);
//typedef ILHANDLE (ILAPIENTRY *fOpenRProc)(ILconst_string)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILHANDLE fOpenRProc(ILstring str);
//typedef void (ILAPIENTRY *mFree)(const void *CONST_RESTRICT)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void mFree(IntPtr ptr);
#endregion
#region Delegates
Callback functions for file reading
typedef ILvoid (ILAPIENTRY *fCloseRProc)(ILHANDLE);
/ <summary>
/
/ </summary>
/ <param name="handle"></param>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate void fCloseRProc(ILHANDLE handle);
typedef ILboolean (ILAPIENTRY *fEofProc) (ILHANDLE);
/ <summary>
/
/ </summary>
/ <param name="handle"></param>
/ <returns></returns>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate ILboolean fEofProc(ILHANDLE handle);
typedef ILint (ILAPIENTRY *fGetcProc) (ILHANDLE);
/ <summary>
/
/ </summary>
/ <param name="handle"></param>
/ <returns></returns>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate ILint fGetcProc(ILHANDLE handle);
typedef ILHANDLE (ILAPIENTRY *fOpenRProc) (const ILstring);
/ <summary>
/
/ </summary>
/ <param name="str"></param>
/ <returns></returns>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate ILHANDLE fOpenRProc(ILstring str);
//typedef ILint (ILAPIENTRY *fReadProc) (void*, ILuint, ILuint, ILHANDLE);
/// <summary>
///
/// </summary>
/// <param name="ptr"></param>
/// <param name="a"></param>
/// <param name="b"></param>
/// <param name="handle"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fReadProc(IntPtr ptr, ILuint a, ILuint b, ILHANDLE handle);
//typedef ILint (ILAPIENTRY *fSeekRProc) (ILHANDLE, ILint, ILint);
/// <summary>
///
/// </summary>
/// <param name="handle"></param>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fSeekRProc(ILHANDLE handle, ILint a, ILint b);
//typedef ILint (ILAPIENTRY *fTellRProc) (ILHANDLE);
/// <summary>
///
/// </summary>
/// <param name="handle"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fTellRProc(ILHANDLE handle);
Callback functions for file writing
typedef ILvoid (ILAPIENTRY *fCloseWProc)(ILHANDLE);
/ <summary>
/
/ </summary>
/ <param name="handle"></param>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate void fCloseWProc(ILHANDLE handle);
//typedef ILHANDLE (ILAPIENTRY *fOpenWProc) (const ILstring);
/// <summary>
///
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILHANDLE fOpenWProc(ILstring str);
//typedef ILint (ILAPIENTRY *fPutcProc) (ILubyte, ILHANDLE);
/// <summary>
///
/// </summary>
/// <param name="byt"></param>
/// <param name="handle"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fPutcProc(ILubyte byt, ILHANDLE handle);
//typedef ILint (ILAPIENTRY *fSeekWProc) (ILHANDLE, ILint, ILint);
/// <summary>
///
/// </summary>
/// <param name="handle"></param>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fSeekWProc(ILHANDLE handle, ILint a, ILint b);
//typedef ILint (ILAPIENTRY *fTellWProc) (ILHANDLE);
/// <summary>
///
/// </summary>
/// <param name="handle"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fTellWProc(ILHANDLE handle);
//typedef ILint (ILAPIENTRY *fWriteProc) (const void*, ILuint, ILuint, ILHANDLE);
/// <summary>
///
/// </summary>
/// <param name="ptr"></param>
/// <param name="a"></param>
/// <param name="b"></param>
/// <param name="handle"></param>
/// <returns></returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate ILint fWriteProc(IntPtr ptr, ILuint a, ILuint b, ILHANDLE handle);
Callback functions for allocation and deallocation
typedef ILvoid* (ILAPIENTRY *mAlloc)(ILuint);
/ <summary>
/
/ </summary>
/ <param name="a"></param>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate void mAlloc(ILuint a);
typedef ILvoid (ILAPIENTRY *mFree) (ILvoid*);
/ <summary>
/
/ </summary>
/ <param name="ptr"></param>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate void mFree(IntPtr ptr);
Registered format procedures
typedef ILenum (ILAPIENTRY *IL_LOADPROC)(const ILstring);
/ <summary>
/
/ </summary>
/ <param name="str"></param>
/ <returns></returns>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate ILenum IL_LOADPROC(ILstring str);
typedef ILenum (ILAPIENTRY *IL_SAVEPROC)(const ILstring);
/ <summary>
/
/ </summary>
/ <param name="str"></param>
/ <returns></returns>
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
//public delegate ILenum IL_SAVEPROC(ILstring str);
#endregion Delegates
#region // ImageLib Functions
/// <summary>
/// //ILAPI ILboolean ILAPIENTRY ilActiveFace (ILuint Number)
/// Used for setting the current face if it is a cubemap.
/// ilActiveImage sets the current image to be an image in an animation chain
/// </summary>
/// <param name="Number">Animation numer to select as current.</param>
/// <returns></returns>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilActiveFace(ILuint Number);
//ILAPI ILboolean ILAPIENTRY ilActiveImage (ILuint Number)
// Used for setting the current image if it is an animation.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilActiveImage(ILuint Number);
//ILAPI ILboolean ILAPIENTRY ilActiveLayer (ILuint Number)
// Used for setting the current layer if layers exist.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilActiveLayer(ILuint Number);
//ILAPI ILboolean ILAPIENTRY ilActiveMipmap (ILuint Number)
// Sets the current mipmap level.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilActiveMipmap(ILuint Number);
//ILAPI ILboolean ILAPIENTRY ilApplyPal (ILconst_string FileName)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilApplyPal(ILstring FileName);
//ILAPI ILboolean ILAPIENTRY ilApplyProfile (ILstring InProfile, ILstring OutProfile)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilApplyProfile(ILstring InProfile, ILstring OutProfile);
//ILAPI void ILAPIENTRY ilBindImage (ILuint Image)
// Makes Image the current active image - similar to glBindTexture().
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilBindImage(ILuint Image);
//ILAPI ILboolean ILAPIENTRY ilBlit (ILuint Source, ILint DestX, ILint DestY, ILint DestZ, ILuint SrcX, ILuint SrcY, ILuint SrcZ, ILuint Width, ILuint Height, ILuint Depth)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilBlit(ILuint Source, ILint DestX, ILint DestY, ILint DestZ, ILuint SrcX, ILuint SrcY, ILuint SrcZ, ILuint Width, ILuint Height, ILuint Depth);
//ILAPI ILboolean ILAPIENTRY ilClampNTSC (void)
// Clamps data values of unsigned bytes from 16 to 235 for display on an.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilClampNTSC();
//ILAPI void ILAPIENTRY ilClearColour (ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilClearColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
//ILAPI ILboolean ILAPIENTRY ilClearImage (void)
// Clears the current bound image to the values specified in ilClearColour.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilClearImage();
//ILAPI ILuint ILAPIENTRY ilCloneCurImage (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilCloneCurImage();
//ILAPI ILubyte *ILAPIENTRY ilCompressDXT (ILubyte *Data, ILuint Width, ILuint Height, ILuint Depth, ILenum DXTCFormat, ILuint *DXTCSize)
// Compresses data to a DXT format using different methods.
//ILAPI ILboolean ILAPIENTRY ilCompressFunc (ILenum Mode)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilCompressFunc(ILenum Mode);
//ILAPI ILboolean ILAPIENTRY ilConvertImage (ILenum DestFormat, ILenum DestType)
// Converts the current image to the DestFormat format.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilConvertImage(ILenum DestFormat, ILenum DestType);
//ILAPI ILboolean ILAPIENTRY ilConvertPal (ILenum DestFormat)
// Converts the current image to the DestFormat format.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilConvertPal(ILenum DestFormat);
//ILAPI ILboolean ILAPIENTRY ilCopyImage (ILuint Src)
// Copies everything from Src to the current bound image.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilCopyImage(ILuint Src);
//ILAPI ILuint ILAPIENTRY ilCopyPixels (ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilCopyPixels(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, IntPtr Data);
//ILAPI ILuint ILAPIENTRY ilCreateSubImage (ILenum Type, ILuint Num)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilCreateSubImage(ILenum Type, ILuint Num);
//ILAPI ILboolean ILAPIENTRY ilDefaultImage (void)
// Creates an ugly 64x64 black and yellow checkerboard image.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilDefaultImage();
//ILAPI void ILAPIENTRY ilDeleteImage (const ILuint Num)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilDeleteImage(ILuint Num);
//ILAPI void ILAPIENTRY ilDeleteImages (ILsizei Num, const ILuint *Images)
// Deletes Num images from the image stack - similar to glDeleteTextures().
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilDeleteImages(ILsizei Num, ref ILuint Image);
//ILAPI ILenum ILAPIENTRY ilDetermineType (ILconst_string FileName)
//ILAPI ILenum ILAPIENTRY ilDetermineTypeF (ILHANDLE File)
//ILAPI ILenum ILAPIENTRY ilDetermineTypeL (const void *Lump, ILuint Size)
//ILAPI ILboolean ILAPIENTRY ilDisable (ILenum Mode)
// Disables a mode.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilDisable(ILenum Mode);
//ILAPI ILboolean ILAPIENTRY ilDxtcDataToImage (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilDxtcDataToImage();
//ILAPI ILboolean ILAPIENTRY ilDxtcDataToSurface (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilDxtcDataToSurface();
//ILAPI ILboolean ILAPIENTRY ilEnable (ILenum Mode)
// Enables a mode.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilEnable(ILenum Mode);
//ILAPI void ILAPIENTRY ilFlipSurfaceDxtcData (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilFlipSurfaceDxtcData();
//ILAPI ILboolean ILAPIENTRY ilFormatFunc (ILenum Mode)
// Sets the default format to be used.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilFormatFunc(ILenum Mode);
//ILAPI void ILAPIENTRY ilGenImages (ILsizei Num, ILuint *Images)
// Creates Num images and puts their index in Images - similar to glGenTextures().
/// <summary>
/// ilGenImages stores Num image names in Images. The names stored are not necessarily contiguous, and names can have been deleted via ilDeleteImages beforehand. The image names stored in Images can be used with ilBindImage after calling ilGenImages. After calling ilGenImages, all image dimensions and features are undefined.
/// </summary>
/// <param name="Num">Number of image names to generate.</param>
/// <param name="Images">Pointer in which the generated image names are stored.</param>
// ILAPI ILvoid ILAPIENTRY ilGenImages(ILsizei Num, ILuint *Images);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilGenImages(ILsizei Num, out ILuint Images);
/// <summary>
/// ilGenImages stores Num image names in Images. The names stored are not necessarily contiguous, and names can have been deleted via ilDeleteImages beforehand. The image names stored in Images can be used with ilBindImage after calling ilGenImages. After calling ilGenImages, all image dimensions and features are undefined.
/// </summary>
/// <param name="Num">Number of image names to generate.</param>
/// <param name="Images">Pointer in which the generated image names are stored.</param>
// ILAPI ILvoid ILAPIENTRY ilGenImages(ILsizei Num, ILuint *Images);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilGenImages(ILsizei Num, [Out] ILuint[] Images);
//ILAPI ILuint ILAPIENTRY ilGenImage (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILint ilGenImage();
//ILAPI ILubyte *ILAPIENTRY ilGetAlpha (ILenum Type)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern IntPtr ilGetAlpha(ILenum Type);
//ILAPI ILboolean ILAPIENTRY ilGetBoolean (ILenum Mode)
// Returns the current value of the Mode.
/// <remarks>
/// <para><see cref="IL_ACTIVE_IMAGE"/> - Returns the current image number.</para>
/// <para><see cref="IL_ACTIVE_LAYER"/> - Returns the current layer number.</para>
/// <para><see cref="IL_ACTIVE_MIPMAP"/> - Returns the current mipmap number..</para>
/// <para><see cref="IL_CONV_PAL"/> - Returns whether palette'd images are converted to their base palettes types on load - e.g. converted to a bgra image.</para>
/// <para><see cref="IL_CUR_IMAGE"/> - Returns the current bound image name.</para>
/// <para><see cref="IL_FILE_MODE"/> - Returns whether file overwriting when saving is enabled.</para>
/// <para><see cref="IL_FORMAT_MODE"/> - Returns the format images are converted to upon loading.</para>
/// <para><see cref="IL_FORMAT_SET"/> - Returns whether all images loaded are converted to a specific format.</para>
/// <para><see cref="IL_IMAGE_BITS_PER_PIXEL"/> - Returns the bits per pixel of the current image's data.</para>
/// <para><see cref="IL_IMAGE_BYTES_PER_PIXEL"/> - Returns the bytes per pixel of the current image's data.</para>
/// <para><see cref="IL_IMAGE_FORMAT"/> - Returns the current image's format.</para>
/// <para><see cref="IL_IMAGE_HEIGHT"/> - Returns the current image's height.</para>
/// <para><see cref="IL_IMAGE_TYPE"/> - Returns the current image's type.</para>
/// <para><see cref="IL_IMAGE_WIDTH"/> - Returns the current image's width.</para>
/// <para><see cref="IL_NUM_IMAGES"/> - Returns the number of images in the current image animation chain.</para>
/// <para><see cref="IL_NUM_MIPMAPS"/> - Returns the number of mipmaps of the current image.</para>
/// <para><see cref="IL_ORIGIN_MODE"/> - Returns the current origin position.</para>
/// <para><see cref="IL_ORIGIN_SET"/> - Returns whether all images loaded and saved adhere to a specific origin.</para>
/// <para><see cref="IL_PALETTE_BPP"/> - Returns the bytes per pixel of the current image's palette.</para>
/// <para><see cref="IL_PALETTE_NUM_COLS"/> - Returns the number of colours of the current image's palette.</para>
/// <para><see cref="IL_PALETTE_TYPE"/> - Returns the palette type of the current image.</para>
/// <para><see cref="IL_TYPE_MODE"/> - Returns the type images are converted to upon loading.</para>
/// <para><see cref="IL_TYPE_SET"/> - Returns whether all images loaded are converted to a specific type.</para>
/// <para><see cref="IL_USE_KEY_COLOUR"/> - Returns whether OpenIL uses a key colour (not used yet).</para>
/// <para><see cref="IL_VERSION_NUM"/> - Returns the version number of the shared library. This can be checked against the <see cref="IL_VERSION"/> #define.</para>
/// </remarks>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilGetBoolean(ILenum Mode);
//ILAPI void ILAPIENTRY ilGetBooleanv (ILenum Mode, ILboolean *Param)
// Sets Param equal to the current value of the Mode.
/// <summary>
/// ilGetBooleanv function returns the mode value in the Param parameter.
/// </summary>
/// <param name="Mode">The mode value to be returned.</param>
/// <param name="Param">Array where the values are stored</param>
/// <remarks>
/// <para><see cref="IL_ACTIVE_IMAGE"/> - Returns the current image number.</para>
/// <para><see cref="IL_ACTIVE_LAYER"/> - Returns the current layer number.</para>
/// <para><see cref="IL_ACTIVE_MIPMAP"/> - Returns the current mipmap number..</para>
/// <para><see cref="IL_CONV_PAL"/> - Returns whether palette'd images are converted to their base palettes types on load - e.g. converted to a bgra image.</para>
/// <para><see cref="IL_CUR_IMAGE"/> - Returns the current bound image name.</para>
/// <para><see cref="IL_FILE_MODE"/> - Returns whether file overwriting when saving is enabled.</para>
/// <para><see cref="IL_FORMAT_MODE"/> - Returns the format images are converted to upon loading.</para>
/// <para><see cref="IL_FORMAT_SET"/> - Returns whether all images loaded are converted to a specific format.</para>
/// <para><see cref="IL_IMAGE_BITS_PER_PIXEL"/> - Returns the bits per pixel of the current image's data.</para>
/// <para><see cref="IL_IMAGE_BYTES_PER_PIXEL"/> - Returns the bytes per pixel of the current image's data.</para>
/// <para><see cref="IL_IMAGE_FORMAT"/> - Returns the current image's format.</para>
/// <para><see cref="IL_IMAGE_HEIGHT"/> - Returns the current image's height.</para>
/// <para><see cref="IL_IMAGE_TYPE"/> - Returns the current image's type.</para>
/// <para><see cref="IL_IMAGE_WIDTH"/> - Returns the current image's width.</para>
/// <para><see cref="IL_NUM_IMAGES"/> - Returns the number of images in the current image animation chain.</para>
/// <para><see cref="IL_NUM_MIPMAPS"/> - Returns the number of mipmaps of the current image.</para>
/// <para><see cref="IL_ORIGIN_MODE"/> - Returns the current origin position.</para>
/// <para><see cref="IL_ORIGIN_SET"/> - Returns whether all images loaded and saved adhere to a specific origin.</para>
/// <para><see cref="IL_PALETTE_BPP"/> - Returns the bytes per pixel of the current image's palette.</para>
/// <para><see cref="IL_PALETTE_NUM_COLS"/> - Returns the number of colours of the current image's palette.</para>
/// <para><see cref="IL_PALETTE_TYPE"/> - Returns the palette type of the current image.</para>
/// <para><see cref="IL_TYPE_MODE"/> - Returns the type images are converted to upon loading.</para>
/// <para><see cref="IL_TYPE_SET"/> - Returns whether all images loaded are converted to a specific type.</para>
/// <para><see cref="IL_USE_KEY_COLOUR"/> - Returns whether OpenIL uses a key colour (not used yet).</para>
/// <para><see cref="IL_VERSION_NUM"/> - Returns the version number of the shared library. This can be checked against the <see cref="IL_VERSION"/> #define.</para>
/// </remarks>
// ILAPI ILvoid ILAPIENTRY ilGetBooleanv(ILenum Mode, ILboolean *Param);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilGetBooleanv(ILenum Mode, out ILboolean Param);
//ILAPI ILubyte *ILAPIENTRY ilGetData (void)
// Returns a pointer to the current image's data.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern IntPtr ilGetData();
//ILAPI ILuint ILAPIENTRY ilGetDXTCData (void *Buffer, ILuint BufferSize, ILenum DXTCFormat)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilGetDXTCData(IntPtr Buffer, ILuint BufferSize, ILenum DXTCFormat);
//ILAPI ILenum ILAPIENTRY ilGetError (void)
// Gets the last error on the error stack.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILenum ilGetError();
//ILAPI ILint ILAPIENTRY ilGetInteger (ILenum Mode)
// Returns the current value of the Mode.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILint ilGetInteger(ILenum Mode);
//ILAPI void ILAPIENTRY ilGetIntegerv (ILenum Mode, ILint *Param)
// Sets Param equal to the current value of the Mode.
/// <summary>
/// ilGetIntegerv function returns the mode value in the Param parameter.
/// </summary>
/// <param name="Mode">The mode value to be returned.</param>
/// <param name="Param">Array where the values are stored</param>
// ILAPI ILvoid ILAPIENTRY ilGetIntegerv(ILenum Mode, ILint *Param);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilGetIntegerv(ILenum Mode, out ILint Param);
/// <summary>
/// ilGetIntegerv function returns the mode value in the Param parameter.
/// </summary>
/// <param name="Mode">The mode value to be returned.</param>
/// <param name="Param">Array where the values are stored</param>
// ILAPI ILvoid ILAPIENTRY ilGetIntegerv(ILenum Mode, ILint *Param);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilGetIntegerv(ILenum Mode, [Out] ILint[] Param);
//ILAPI ILuint ILAPIENTRY ilGetLumpPos (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilGetLumpPos();
//ILAPI ILubyte *ILAPIENTRY ilGetPalette (void)
// Returns a pointer to the current image's palette data.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern IntPtr ilGetPalette();
//ILAPI ILconst_string ILAPIENTRY ilGetString (ILenum StringName)
// Returns a constant string detailing aspects about this library.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILstring ilGetString(ILenum StringName);
//ILAPI void ILAPIENTRY ilHint (ILenum Target, ILenum Mode)
// Specifies implementation-dependent performance hints.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilHint(ILenum Target, ILenum Mode);
//ILAPI ILboolean ILAPIENTRY ilInvertSurfaceDxtcDataAlpha (void)
//ILAPI void ILAPIENTRY ilInit (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilInit();
//ILAPI ILboolean ILAPIENTRY ilImageToDxtcData (ILenum Format)
//ILAPI ILboolean ILAPIENTRY ilIsDisabled (ILenum Mode)
// Checks whether the mode is disabled.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilIsDisabled(ILenum Mode);
//ILAPI ILboolean ILAPIENTRY ilIsEnabled (ILenum Mode)
// Checks whether the mode is enabled.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilIsEnabled(ILenum Mode);
//ILAPI ILboolean ILAPIENTRY ilIsImage (ILuint Image)
// Checks if Image is a valid ilGenImages-generated image (like glIsTexture()).
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilIsImage(ILuint Image);
// ILAPI ILboolean ILAPIENTRY ilIsValid(ILenum Type, ILstring FileName);
/// <summary>
/// //ILAPI ILboolean ILAPIENTRY ilIsValid (ILenum Type, ILconst_string FileName)
/// </summary>
/// <param name="Type"></param>
/// <param name="FileName"></param>
/// <returns></returns>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilIsValid(ILenum Type, ILstring FileName);
/// <summary>
/// //ILAPI ILboolean ILAPIENTRY ilIsValidF (ILenum Type, ILHANDLE File)
/// </summary>
/// <param name="Type"></param>
/// <param name="File"></param>
/// <returns></returns>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilIsValidF(ILenum Type, ILHANDLE File);
/// <summary>
/// //ILAPI ILboolean ILAPIENTRY ilIsValidL (ILenum Type, void *Lump, ILuint Size)
/// </summary>
/// <param name="Type"></param>
/// <param name="Lump"></param>
/// <param name="Size"></param>
/// <returns></returns>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilIsValidL(ILenum Type, IntPtr Lump, ILuint Size);
/// <summary>
/// //ILAPI ILboolean ILAPIENTRY ilIsValidL (ILenum Type, void *Lump, ILuint Size)
/// </summary>
/// <param name="Type"></param>
/// <param name="Lump"></param>
/// <param name="Size"></param>
/// <returns></returns>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilIsValidL(ILenum Type, byte[] Lump, ILuint Size);
//ILAPI void ILAPIENTRY ilKeyColour (ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha)
/// <summary>
///
/// </summary>
/// <param name="Red"></param>
/// <param name="Green"></param>
/// <param name="Blue"></param>
/// <param name="Alpha"></param>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilKeyColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
//ILAPI ILboolean ILAPIENTRY ilLoad (ILenum Type, ILconst_string FileName)
// Attempts to load an image from a file. The file format is specified by the user.
/// <summary>
/// ilLoad can be used much in the same way ilLoadImage is used, except with ilLoad, it is possible to force OpenIL to load a file as a specific image format, no matter what the extension.
/// </summary>
/// <param name="Type">Format Specification</param>
/// <param name="FileName">File to load the image</param>
/// <returns></returns>
// ILAPI ILboolean ILAPIENTRY ilLoad(ILenum Type, const ILstring FileName);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoad(ILenum Type, ILstring FileName);
//ILAPI ILboolean ILAPIENTRY ilLoadF (ILenum Type, ILHANDLE File)
// Attempts to load an image from a file stream. The file format is specified by the user.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadF(ILenum Type, ILHANDLE File);
//ILAPI ILboolean ILAPIENTRY ilLoadImage (ILconst_string FileName)
// Attempts to load an image from a file with various different methods before failing - very generic.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadImage(ILstring FileName);
//ILAPI ILboolean ILAPIENTRY ilLoadL (ILenum Type, const void *Lump, ILuint Size)
// Attempts to load an image from a memory buffer. The file format is specified by the user.
// ILAPI ILboolean ILAPIENTRY ilLoadL(ILenum Type, const ILvoid *Lump, ILuint Size);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadL(ILenum Type, IntPtr Lump, ILuint Size);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadL(ILenum Type, byte[] Lump, ILuint Size);
//ILAPI ILboolean ILAPIENTRY ilLoadPal (ILconst_string FileName)
// Loads a palette from FileName into the current image's palette.
// ILAPI ILboolean ILAPIENTRY ilLoadPal(const ILstring FileName);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadPal(ILstring FileName);
//ILAPI void ILAPIENTRY ilModAlpha (ILdouble AlphaValue)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilModAlpha(ILdouble AlphaValue);
//ILAPI ILboolean ILAPIENTRY ilOriginFunc (ILenum Mode)
// Sets the default origin to be used.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern byte ilOriginFunc(ILenum Mode);
//ILAPI ILboolean ILAPIENTRY ilOverlayImage (ILuint Source, ILint XCoord, ILint YCoord, ILint ZCoord)
// Overlays the image found in Src on top of the current bound image at the coords specified.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilOverlayImage(ILuint Source, ILint XCoord, ILint YCoord, ILint ZCoord);
//ILAPI void ILAPIENTRY ilPopAttrib (void)
// Pops the last entry off the state stack into the current states.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilPopAttrib();
//ILAPI void ILAPIENTRY ilPushAttrib (ILuint Bits)
// Pushes the states indicated by Bits onto the state stack.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilPushAttrib(ILuint Bits);
//ILAPI void ILAPIENTRY ilRegisterFormat (ILenum Format)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilRegisterFormat(ILenum Format);
//ILAPI ILboolean ILAPIENTRY ilRegisterLoad (ILconst_string Ext, IL_LOADPROC Load)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilRegisterLoad(ILstring Ext, IL_LOADPROC Load);
//ILAPI ILboolean ILAPIENTRY ilRegisterMipNum (ILuint Num)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilRegisterMipNum(ILuint Num);
//ILAPI ILboolean ILAPIENTRY ilRegisterNumFaces (ILuint Num)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilRegisterNumFaces(ILuint Num);
//ILAPI ILboolean ILAPIENTRY ilRegisterNumImages (ILuint Num)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilRegisterNumImages(ILuint Num);
//ILAPI void ILAPIENTRY ilRegisterOrigin (ILenum Origin)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilRegisterOrigin(ILenum Origin);
//ILAPI void ILAPIENTRY ilRegisterPal (void *Pal, ILuint Size, ILenum Type)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilRegisterPal(IntPtr Pal, ILuint Size, ILenum Type);
//ILAPI ILboolean ILAPIENTRY ilRegisterSave (ILconst_string Ext, IL_SAVEPROC Save)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilRegisterSave(ILstring Ext, IL_SAVEPROC Save);
//ILAPI void ILAPIENTRY ilRegisterType (ILenum Type)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilRegisterType(ILenum Type);
//ILAPI ILboolean ILAPIENTRY ilRemoveLoad (ILconst_string Ext)
// Unregisters a load extension - doesn't have to be called.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilRemoveLoad(ILstring Ext);
//ILAPI ILboolean ILAPIENTRY ilRemoveSave (ILconst_string Ext)
// Unregisters a save extension - doesn't have to be called.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilRemoveSave(ILstring Ext);
//ILAPI void ILAPIENTRY ilResetMemory (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilResetMemory();
//ILAPI void ILAPIENTRY ilResetRead (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilResetRead();
//ILAPI void ILAPIENTRY ilResetWrite (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilResetWrite();
//ILAPI ILboolean ILAPIENTRY ilSave (ILenum Type, ILconst_string FileName)
// Attempts to save an image to a file. The file format is specified by the user.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilSave(ILenum Type, ILstring FileName);
//ILAPI ILuint ILAPIENTRY ilSaveF (ILenum Type, ILHANDLE File)
// Attempts to save an image to a file stream. The file format is specified by the user.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilSaveF(ILenum Type, ILHANDLE File);
//ILAPI ILboolean ILAPIENTRY ilSaveImage (ILconst_string FileName)
// Saves the current image based on the extension given in FileName.
// ILAPI ILboolean ILAPIENTRY ilSaveImage(const ILstring FileName);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilSaveImage(ILstring FileName);
//ILAPI ILuint ILAPIENTRY ilSaveL (ILenum Type, void *Lump, ILuint Size)
// Attempts to save an image to a memory buffer. The file format is specified by the user.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilSaveL(ILenum Type, IntPtr Lump, ILuint Size);
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILuint ilSaveL(ILenum Type, byte[] Lump, ILuint Size);
//ILAPI ILboolean ILAPIENTRY ilSavePal (ILconst_string FileName)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilSavePal(ILstring FileName);
//ILAPI ILboolean ILAPIENTRY ilSetAlpha (ILdouble AlphaValue)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilSetAlpha(ILdouble AlphaValue);
//ILAPI ILboolean ILAPIENTRY ilSetData (void *Data)
// Uploads Data of the same size to replace the current image's data.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilSetData(IntPtr Data);
//ILAPI ILboolean ILAPIENTRY ilSetDuration (ILuint Duration)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilSetDuration(ILuint Duration);
//ILAPI void ILAPIENTRY ilSetInteger (ILenum Mode, ILint Param)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilSetInteger(ILenum Mode, ILint Param);
//ILAPI void ILAPIENTRY ilSetMemory (mAlloc, mFree)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilSetMemory(mAlloc AllocFunc, mFree FreeFunc);
//ILAPI void ILAPIENTRY ilSetPixels (ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilSetPixels(ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILuint Format, ILuint Type, IntPtr Data);
//ILAPI void ILAPIENTRY ilSetRead (fOpenRProc, fCloseRProc, fEofProc, fGetcProc, fReadProc, fSeekRProc, fTellRProc)
// Allows you to override the default file-reading functions.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilSetRead(fOpenRProc Open, fCloseRProc Close, fEofProc Eof, fGetcProc Getc, fReadProc Read, fSeekRProc Seek, fTellRProc Tell);
//ILAPI void ILAPIENTRY ilSetString (ILenum Mode, const char *String)
/// <summary>
/// ilSetString gives DevIL users the option to set strings in certain file formats that have fields for strings, making DevIL highly customizable. Choose one of the acceptable parameters for Mode and specify any string you want. If the string is too long, it will be truncated when writing to the file.
/// </summary>
/// <param name="Mode">Specifies the string to be set.</param>
/// <param name="str">String to use for setting a string field of a specified image format.</param>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilSetString(ILenum Mode, string str);
//ILAPI void ILAPIENTRY ilSetWrite (fOpenWProc, fCloseWProc, fPutcProc, fSeekWProc, fTellWProc, fWriteProc)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilSetWrite(fOpenWProc Open, fCloseWProc Close, fPutcProc Putc, fSeekWProc Seek, fTellWProc Tell, fWriteProc Write);
//ILAPI void ILAPIENTRY ilShutDown (void)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern void ilShutDown();
//ILAPI ILboolean ILAPIENTRY ilSurfaceToDxtcData (ILenum Format)
//ILAPI ILboolean ILAPIENTRY ilTexImage (ILuint Width, ILuint Height, ILuint Depth, ILubyte NumChannels, ILenum Format, ILenum Type, void *Data)
// Changes the current bound image to use these new dimensions (current data is destroyed).
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilTexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte numChannels, ILenum Format, ILenum Type, IntPtr Data);
//ILAPI ILboolean ILAPIENTRY ilTexImageDxtc (ILint w, ILint h, ILint d, ILenum DxtFormat, const ILubyte *data)
//ILAPI ILenum ILAPIENTRY ilTypeFromExt (ILconst_string FileName)
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILenum ilTypeFromExt(ILstring FileName);
//ILAPI ILboolean ILAPIENTRY ilTypeFunc (ILenum Mode)
// Sets the default type to be used.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilTypeFunc(ILenum Mode);
//ILAPI ILboolean ILAPIENTRY ilLoadData (ILconst_string FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp)
// Reads a raw data file.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadData(ILstring FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
//ILAPI ILboolean ILAPIENTRY ilLoadDataF (ILHANDLE File, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp)
// Reads an already-opened raw data file.
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadDataF(ILHANDLE File, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
//ILAPI ILboolean ILAPIENTRY ilLoadDataL (void *Lump, ILuint Size, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp)
// Reads from a raw data memory "lump".
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilLoadDataL(IntPtr Lump, ILuint Size, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
//ILAPI ILboolean ILAPIENTRY ilSaveData (ILconst_string FileName)
// Save the current image to FileName as raw data.
// ILAPI ILboolean ILAPIENTRY ilSaveData(const ILstring FileName);
/// <summary>
///
/// </summary>
/// <param name="FileName"></param>
/// <returns></returns>
[DllImport(DEVIL_NATIVE_LIBRARY, CallingConvention = CALLING_CONVENTION), SuppressUnmanagedCodeSecurity]
public static extern ILboolean ilSaveData(ILstring FileName);
#endregion
}
}