Ajout version Release/x64 avec les libraries x64 et tuning de la version Debug

This commit is contained in:
MarcEricMartel 2021-12-10 07:16:43 -05:00
parent 9b56a9b4a5
commit f4ec4816af
2745 changed files with 292873 additions and 8 deletions

1
.gitignore vendored
View File

@ -366,3 +366,4 @@ FodyWeavers.xsd
/SQCSim2021/Debug
/SQCSim2021/Release
/SQCSim2021/media/chunks
/x64/Release/SQCSim2021.exe

View File

@ -85,14 +85,14 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>ClangCL</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -127,8 +127,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>D:\Repos\SQCSim2021\SQCSim2021\external\irrKlang-1.6.0\include;external\sfml23\include;external\devil178\include;external\glew170\include;$(IncludePath)</IncludePath>
<LibraryPath>external\sfml23\lib;external\devil178\lib;external\glew170\lib;$(LibraryPath);D:\Repos\SQCSim2021\SQCSim2021\external\irrKlang-1.6.0\lib\Win32-visualStudio</LibraryPath>
<IncludePath>external\irrKlang-64bit-1.6.0\include;external\sfml251\include;external\devil180\include;external\glew210\include;$(IncludePath)</IncludePath>
<LibraryPath>external\sfml251\lib;external\devil180\lib\x64\Release\;external\glew210\lib\Release\x64\;$(LibraryPath);external\irrKlang-64bit-1.6.0\lib\winx64-visualStudio</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -18,15 +18,15 @@
#define MAX_SELECTION_DISTANCE 5
#ifdef _DEBUG
#define WORLD_SIZE_X 32
#define WORLD_SIZE_Y 32
#define WORLD_SIZE_X 64
#define WORLD_SIZE_Y 64
#define FRAMES_RENDER_CHUNKS 4
#define FRAMES_UPDATE_CHUNKS 4
#define FRAMES_DELETE_CHUNKS 4
#define VIEW_DISTANCE 128
#define TEXTURE_SIZE 32
#define VIEW_DISTANCE 256
#define TEXTURE_SIZE 128
#define MAX_BULLETS 64
#endif

View File

@ -0,0 +1,13 @@
%module DevIL
%{
#include "il.h"
#include "ilu.h"
#include "ilut.h"
//#include "ilu_region.h"
%}
%include "il.h"
%include "ilu.h"
%include "ilut.h"
//%include "ilu_region.h"

View File

@ -0,0 +1,51 @@
IL_INCLUDE_PATH="/usr/include"
IL_LIB_PATH="/usr/lib"
LUA_INCLUDE_PATH="/usr/include/lua5.1"
LUA_LIB_PATH="/usr/lib"
OSX=no
echo "Building the lua binding!"
export SWIG_FEATURES="-I$IL_INCLUDE_PATH"
swig -lua DevIL.i
if [ $? -ne 0 ] ; then
echo "swig Failed to build the lua interface"
exit 1
fi
compile() {
gcc luadevil.c "$1" -o luadevil "-L$LUA_LIB_PATH" "-I$LUA_INCLUDE_PATH" "-I$IL_LIB_PATH" -lIL -lILU -lILUT -llua5.1 &>/dev/null
err=$?
if [ "$OSX" = "no" ] ; then
gcc -shared "$1" -o DevIL.so "-L$LUA_LIB_PATH" "-I$LUA_INCLUDE_PATH" "-I$IL_LIB_PATH" -lIL -lILU -lILUT &>/dev/null
else
gcc -bundle -undefined dynamic_lookup "$1" -o DevIL.so "-L$LUA_LIB_PATH" "-I$LUA_INCLUDE_PATH" "-I$IL_LIB_PATH" -lIL -lILU -lILUT &>/dev/null
fi
return $err
}
compile DevIL_wrap.c
if [ $? -ne 0 ] ; then
echo 'Failed compilation'
echo 'On some platform the file malloc.h is not present and produces a compilation error'
echo -n 'it can be removed safely, try [y/n] ? '
while read i ; do
if [ "$i" = "y" ] ; then
sed 's/\#include\ \<malloc\.h\>//' < DevIL_wrap.c > DevIL_wrap.mod.c
compile "DevIL_wrap.mod.c"
if [ $? -ne 0 ] ; then
echo 'still failing...'
exit 2
fi
exit 0
elif [ "$i" = "n" ] ; then
echo 'ok, failing...'
exit 3
else
echo 'Unknown command [y/n] ? '
fi
done
fi
echo "ok!"
exit 0

View File

@ -0,0 +1,17 @@
#! /bin/bash
IL_INCLUDE_PATH="/usr/local/include"
IL_LIB_PATH="/usr/local/lib"
PYTHON_INCLUDE_PATH="/usr/include/python2.5"
swig "-I$IL_INCLUDE_PATH" -python -interface DevIL DevIL.i
if [ $? -ne 0 ] ; then
echo Error while building the swig interface
exit 1
fi
gcc -shared "-I$IL_INCLUDE_PATH" "-I$PYTHON_INCLUDE_PATH" "-L$IL_LIB_PATH" -lIL -lILU -lILUT DevIL_wrap.c -o DevIL.so
if [ $? -ne 0 ] ; then
echo Error while compiling the python module
fi
echo "DevIL.py and DevIL.so are ready"

View File

@ -0,0 +1,79 @@
#ifndef __CONFIG_H__
#define __CONFIG_H__
#define IL_USE_PRAGMA_LIBS // Links to only the libraries that are requested.
#define IL_INLINE_ASM 1 // Define if you can support at least some ASM
// Supported images formats (IL)
// #define IL_NO_BLP
// #define IL_NO_BMP
// #define IL_NO_CUT
// #define IL_NO_CHEAD
// #define IL_NO_DCX
// #define IL_NO_DDS
// #define IL_NO_DICOM
// #define IL_NO_DOOM
// #define IL_NO_EXR
// #define IL_NO_FITS
// #define IL_NO_FTX
// #define IL_NO_GIF
// #define IL_NO_HDR
// #define IL_NO_ICO
// #define IL_NO_ICNS
// #define IL_NO_IWI
// #define IL_NO_JP2
// #define IL_NO_JPG
// #define IL_NO_LCMS
// #define IL_NO_LIF
// #define IL_NO_MDL
// #define IL_NO_MNG
// #define IL_NO_PCD
// #define IL_NO_PCX
// #define IL_NO_PIC
// #define IL_NO_PIX
// #define IL_NO_PNG
// #define IL_NO_PNM
// #define IL_NO_PSD
// #define IL_NO_PSP
// #define IL_NO_PXR
// #define IL_NO_RAW
// #define IL_NO_ROT
// #define IL_NO_SGI
// #define IL_NO_SUN
// #define IL_NO_TGA
// #define IL_NO_TIF
// #define IL_NO_TPL
// #define IL_NO_WAL
// #define IL_NO_WDP
// #define IL_NO_XPM
#define IL_USE_JPEGLIB_UNMODIFIED 1
#define IL_USE_DXTC_NVIDIA
#define IL_USE_DXTC_SQUISH
//#define IL_NO_GAMES
/* Supported api (ilut) */
//
// sorry just
// cant get this one to work under windows
// have disabled for the now
//
// will look at it some more later
//
// Kriss
//
#undef ILUT_USE_ALLEGRO
#undef ILUT_USE_DIRECTX8
#define ILUT_USE_DIRECTX9
#define ILUT_USE_DIRECTX10
#define ILUT_USE_OPENGL
#define ILUT_USE_SDL
#define ILUT_USE_WIN32
#endif /* __CONFIG_H__ */

View File

@ -0,0 +1,952 @@
#ifndef DEVIL_CPP_WRAPPER_HPP
#define DEVIL_CPP_WRAPPER_HPP
#include <IL/ilut.h> // Probably only have to #include this one
class ilImage
{
public:
ilImage();
ilImage(ILconst_string);
ilImage(const ilImage &);
virtual ~ilImage();
ILboolean Load(ILconst_string);
ILboolean Load(ILconst_string, ILenum);
ILboolean Save(ILconst_string);
ILboolean Save(ILconst_string, ILenum);
// ImageLib functions
ILboolean ActiveImage(ILuint);
ILboolean ActiveLayer(ILuint);
ILboolean ActiveMipmap(ILuint);
ILboolean Clear(void);
void ClearColour(ILclampf, ILclampf, ILclampf, ILclampf);
ILboolean Convert(ILenum);
ILboolean Copy(ILuint);
ILboolean Default(void);
ILboolean Flip(void);
ILboolean SwapColours(void);
ILboolean Resize(ILuint, ILuint, ILuint);
ILboolean TexImage(ILuint, ILuint, ILuint, ILubyte, ILenum, ILenum, void*);
// Image handling
void Bind(void) const;
void Bind(ILuint);
void Close(void) { this->Delete(); }
void Delete(void);
void iGenBind();
ILenum PaletteAlphaIndex();
// Image characteristics
ILuint Width(void);
ILuint Height(void);
ILuint Depth(void);
ILubyte Bpp(void);
ILubyte Bitpp(void);
ILenum PaletteType(void);
ILenum Format(void);
ILenum Type(void);
ILuint NumImages(void);
ILuint NumMipmaps(void);
ILuint GetId(void) const;
ILenum GetOrigin(void);
ILubyte *GetData(void);
ILubyte *GetPalette(void);
// Rendering
ILuint BindImage(void);
ILuint BindImage(ILenum);
// Operators
ilImage& operator = (ILuint);
ilImage& operator = (const ilImage &);
protected:
ILuint Id;
private:
static int ilStartUp();
static ILboolean ilStartedUp;
};
// ensure that init is called exactly once
int ilImage::ilStartUp()
{
ilInit();
iluInit();
//ilutInit();
return true;
}
ILboolean ilImage::ilStartedUp = ilStartUp();
class ilFilters
{
public:
static ILboolean Alienify(ilImage &);
static ILboolean BlurAvg(ilImage &, ILuint Iter);
static ILboolean BlurGaussian(ilImage &, ILuint Iter);
static ILboolean Contrast(ilImage &, ILfloat Contrast);
static ILboolean EdgeDetectE(ilImage &);
static ILboolean EdgeDetectP(ilImage &);
static ILboolean EdgeDetectS(ilImage &);
static ILboolean Emboss(ilImage &);
static ILboolean Gamma(ilImage &, ILfloat Gamma);
static ILboolean Negative(ilImage &);
static ILboolean Noisify(ilImage &, ILubyte Factor);
static ILboolean Pixelize(ilImage &, ILuint PixSize);
static ILboolean Saturate(ilImage &, ILfloat Saturation);
static ILboolean Saturate(ilImage &, ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
static ILboolean ScaleColours(ilImage &, ILfloat r, ILfloat g, ILfloat b);
static ILboolean Sharpen(ilImage &, ILfloat Factor, ILuint Iter);
};
#ifdef ILUT_USE_OPENGL
class ilOgl
{
public:
static void Init(void);
static GLuint BindTex(ilImage &);
static ILboolean Upload(ilImage &, ILuint);
static GLuint Mipmap(ilImage &);
static ILboolean Screen(void);
static ILboolean Screenie(void);
};
#endif//ILUT_USE_OPENGL
#ifdef ILUT_USE_ALLEGRO
class ilAlleg
{
public:
static void Init(void);
static BITMAP *Convert(ilImage &);
};
#endif//ILUT_USE_ALLEGRO
#ifdef ILUT_USE_WIN32
class ilWin32
{
public:
static void Init(void);
static HBITMAP Convert(ilImage &);
static ILboolean GetClipboard(ilImage &);
static void GetInfo(ilImage &, BITMAPINFO *Info);
static ILubyte *GetPadData(ilImage &);
static HPALETTE GetPal(ilImage &);
static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType);
static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType, ILenum Type);
static ILboolean SetClipboard(ilImage &);
};
#endif//ILUT_USE_WIN32
class ilValidate
{
public:
static ILboolean Valid(ILenum, ILconst_string);
static ILboolean Valid(ILenum, FILE *);
static ILboolean Valid(ILenum, void *, ILuint);
protected:
private:
};
class ilState
{
public:
static ILboolean Disable(ILenum);
static ILboolean Enable(ILenum);
static void Get(ILenum, ILboolean &);
static void Get(ILenum, ILint &);
static ILboolean GetBool(ILenum);
static ILint GetInt(ILenum);
static const char *GetString(ILenum);
static ILboolean IsDisabled(ILenum);
static ILboolean IsEnabled(ILenum);
static ILboolean Origin(ILenum);
static void Pop(void);
static void Push(ILuint);
protected:
private:
};
class ilError
{
public:
static void Check(void (*Callback)(const char*));
static void Check(void (*Callback)(ILenum));
static ILenum Get(void);
static const char *String(void);
static const char *String(ILenum);
protected:
private:
};
//
// ILIMAGE
//
ilImage::ilImage()
{
this->Id = 0;
//this->iStartUp(); // This was commented out, but it needs to be somewhere...
this->iGenBind();
return;
}
ilImage::ilImage(ILconst_string FileName)
{
this->Id = 0;
//this->iStartUp(); // This was commented out, but it needs to be somewhere...
this->iGenBind();
ilLoadImage(FileName);
return;
}
ilImage::ilImage(const ilImage &Image)
{
this->Id = 0;
// this->iStartUp();
this->iGenBind();
*this = Image;
return;
}
ilImage::~ilImage()
{
if (this->Id)
ilDeleteImages(1, &this->Id);
this->Id = 0;
return;
}
ILboolean ilImage::Load(ILconst_string FileName)
{
this->iGenBind();
return ilLoadImage(FileName);
}
ILboolean ilImage::Load(ILconst_string FileName, ILenum Type)
{
this->iGenBind();
return ilLoad(Type, FileName);
}
ILboolean ilImage::Save(ILconst_string FileName)
{
this->iGenBind();
return ilSaveImage(FileName);
}
ILboolean ilImage::Save(ILconst_string FileName, ILenum Type)
{
this->iGenBind();
return ilSave(Type, FileName);
}
//
// ImageLib functions
//
ILboolean ilImage::ActiveImage(ILuint Number)
{
if (this->Id) {
this->Bind();
return ilActiveImage(Number);
}
return IL_FALSE;
}
ILboolean ilImage::ActiveLayer(ILuint Number)
{
if (this->Id) {
this->Bind();
return ilActiveLayer(Number);
}
return IL_FALSE;
}
ILboolean ilImage::ActiveMipmap(ILuint Number)
{
if (this->Id) {
this->Bind();
return ilActiveMipmap(Number);
}
return IL_FALSE;
}
ILboolean ilImage::Clear()
{
if (this->Id) {
this->Bind();
return ilClearImage();
}
return IL_FALSE;
}
void ilImage::ClearColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha)
{
ilClearColour(Red, Green, Blue, Alpha);
return;
}
ILboolean ilImage::Convert(ILenum NewFormat)
{
if (this->Id) {
this->Bind();
return ilConvertImage(NewFormat, IL_UNSIGNED_BYTE);
}
return IL_FALSE;
}
ILboolean ilImage::Copy(ILuint Src)
{
if (this->Id) {
this->Bind();
return ilCopyImage(Src);
}
return IL_FALSE;
}
ILboolean ilImage::Default()
{
if (this->Id) {
this->Bind();
return ilDefaultImage();
}
return IL_FALSE;
}
ILboolean ilImage::Flip()
{
if (this->Id) {
this->Bind();
return iluFlipImage();
}
return IL_FALSE;
}
ILboolean ilImage::SwapColours()
{
if (this->Id) {
this->Bind();
return iluSwapColours();
}
return IL_FALSE;
}
ILboolean ilImage::Resize(ILuint Width, ILuint Height, ILuint Depth)
{
if (this->Id) {
this->Bind();
return iluScale(Width, Height, Depth);
}
return IL_FALSE;
}
ILboolean ilImage::TexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data)
{
if (this->Id) {
this->Bind();
return ilTexImage(Width, Height, Depth, Bpp, Format, Type, Data);
}
return IL_FALSE;
}
//
// Image handling
//
void ilImage::Bind() const
{
if (this->Id)
ilBindImage(this->Id);
return;
}
// Note: Behaviour may be changed!
void ilImage::Bind(ILuint Image)
{
if (this->Id == Image)
return;
this->Delete(); // Should we delete it?
this->Id = Image;
ilBindImage(this->Id);
return;
}
void ilImage::Delete()
{
if (this->Id == 0)
return;
ilDeleteImages(1, &this->Id);
this->Id = 0;
return;
}
//
// Image characteristics
//
ILuint ilImage::Width()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_IMAGE_WIDTH);
}
return 0;
}
ILuint ilImage::Height()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_IMAGE_HEIGHT);
}
return 0;
}
ILuint ilImage::Depth()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_IMAGE_DEPTH);
}
return 0;
}
ILubyte ilImage::Bpp()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL);
}
return 0;
}
ILubyte ilImage::Bitpp()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_IMAGE_BITS_PER_PIXEL);
}
return 0;
}
ILenum ilImage::Format()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_IMAGE_FORMAT);
}
return 0;
}
ILenum ilImage::PaletteType()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_PALETTE_TYPE);
}
return 0;
}
ILenum ilImage::PaletteAlphaIndex()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_PNG_ALPHA_INDEX);
}
return 0;
}
ILenum ilImage::Type()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_IMAGE_TYPE);
}
return 0;
}
ILenum ilImage::NumImages()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_NUM_IMAGES);
}
return 0;
}
ILenum ilImage::NumMipmaps()
{
if (this->Id) {
this->Bind();
return ilGetInteger(IL_NUM_MIPMAPS);
}
return 0;
}
ILuint ilImage::GetId() const
{
return this->Id;
}
ILenum ilImage::GetOrigin(void)
{
ILinfo Info;
if (this->Id) {
this->Bind();
iluGetImageInfo(&Info);
return Info.Origin;
}
return 0;
}
ILubyte* ilImage::GetData()
{
if (this->Id) {
this->Bind();
return ilGetData();
}
return 0;
}
ILubyte* ilImage::GetPalette()
{
if (this->Id) {
this->Bind();
return ilGetPalette();
}
return 0;
}
//
// Private members
//
/*void ilImage::iStartUp()
{
ilInit();
iluInit();
ilutInit();
return;
}*/
void ilImage::iGenBind()
{
if (this->Id == 0) {
ilGenImages(1, &this->Id);
}
ilBindImage(this->Id);
return;
}
//
// Operators
//
ilImage& ilImage::operator = (ILuint Image)
{
if (this->Id == 0)
this->Id = Image;
else {
this->Bind();
ilCopyImage(Image);
}
return *this;
}
ilImage& ilImage::operator = (const ilImage &Image)
{
if (Id == 0)
Id = Image.GetId();
else {
Bind();
ilCopyImage(Image.GetId());
}
return *this;
}
//
// ILFILTERS
//
ILboolean ilFilters::Alienify(ilImage &Image)
{
Image.Bind();
return iluAlienify();
}
ILboolean ilFilters::BlurAvg(ilImage &Image, ILuint Iter)
{
Image.Bind();
return iluBlurAvg(Iter);
}
ILboolean ilFilters::BlurGaussian(ilImage &Image, ILuint Iter)
{
Image.Bind();
return iluBlurGaussian(Iter);
}
ILboolean ilFilters::Contrast(ilImage &Image, ILfloat Contrast)
{
Image.Bind();
return iluContrast(Contrast);
}
ILboolean ilFilters::EdgeDetectE(ilImage &Image)
{
Image.Bind();
return iluEdgeDetectP();
}
ILboolean ilFilters::EdgeDetectP(ilImage &Image)
{
Image.Bind();
return iluEdgeDetectP();
}
ILboolean ilFilters::EdgeDetectS(ilImage &Image)
{
Image.Bind();
return iluEdgeDetectS();
}
ILboolean ilFilters::Emboss(ilImage &Image)
{
Image.Bind();
return iluEmboss();
}
ILboolean ilFilters::Gamma(ilImage &Image, ILfloat Gamma)
{
Image.Bind();
return iluGammaCorrect(Gamma);
}
ILboolean ilFilters::Negative(ilImage &Image)
{
Image.Bind();
return iluNegative();
}
ILboolean ilFilters::Noisify(ilImage &Image, ILubyte Factor)
{
Image.Bind();
return iluNoisify(Factor);
}
ILboolean ilFilters::Pixelize(ilImage &Image, ILuint PixSize)
{
Image.Bind();
return iluPixelize(PixSize);
}
ILboolean ilFilters::Saturate(ilImage &Image, ILfloat Saturation)
{
Image.Bind();
return iluSaturate1f(Saturation);
}
ILboolean ilFilters::Saturate(ilImage &Image, ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation)
{
Image.Bind();
return iluSaturate4f(r, g, b, Saturation);
}
ILboolean ilFilters::ScaleColours(ilImage &Image, ILfloat r, ILfloat g, ILfloat b)
{
Image.Bind();
return iluScaleColours(r, g, b);
}
ILboolean ilFilters::Sharpen(ilImage &Image, ILfloat Factor, ILuint Iter)
{
Image.Bind();
return iluSharpen(Factor, Iter);
}
//
// ILOPENGL
//
#ifdef ILUT_USE_OPENGL
void ilOgl::Init()
{
ilutRenderer(ILUT_OPENGL);
return;
}
GLuint ilOgl::BindTex(ilImage &Image)
{
Image.Bind();
return ilutGLBindTexImage();
}
ILboolean ilOgl::Upload(ilImage &Image, ILuint Level)
{
Image.Bind();
return ilutGLTexImage(Level);
}
GLuint ilOgl::Mipmap(ilImage &Image)
{
Image.Bind();
return ilutGLBuildMipmaps();
}
ILboolean ilOgl::Screen()
{
return ilutGLScreen();
}
ILboolean ilOgl::Screenie()
{
return ilutGLScreenie();
}
#endif//ILUT_USE_OPENGL
//
// ILALLEGRO
//
#ifdef ILUT_USE_ALLEGRO
void ilAlleg::Init()
{
ilutRenderer(IL_ALLEGRO);
return;
}
BITMAP *ilAlleg::Convert(ilImage &Image, PALETTE Pal)
{
Image.Bind();
return ilutConvertToAlleg(Pal);
}
#endif//ILUT_USE_ALLEGRO
//
// ILWIN32
//
#ifdef ILUT_USE_WIN32
void ilWin32::Init()
{
ilutRenderer(ILUT_WIN32);
return;
}
HBITMAP ilWin32::Convert(ilImage &Image)
{
Image.Bind();
return ilutConvertToHBitmap(GetDC(NULL));
}
ILboolean ilWin32::GetClipboard(ilImage &Image)
{
Image.Bind();
return ilutGetWinClipboard();
}
void ilWin32::GetInfo(ilImage &Image, BITMAPINFO *Info)
{
Image.Bind();
ilutGetBmpInfo(Info);
return;
}
ILubyte* ilWin32::GetPadData(ilImage &Image)
{
Image.Bind();
return ilutGetPaddedData();
}
HPALETTE ilWin32::GetPal(ilImage &Image)
{
Image.Bind();
return ilutGetHPal();
}
ILboolean ilWin32::GetResource(ilImage &Image, HINSTANCE hInst, ILint ID, char *ResourceType)
{
Image.Bind();
return ilutLoadResource(hInst, ID, ResourceType, IL_TYPE_UNKNOWN);
}
ILboolean ilWin32::GetResource(ilImage &Image, HINSTANCE hInst, ILint ID, char *ResourceType, ILenum Type)
{
Image.Bind();
return ilutLoadResource(hInst, ID, ResourceType, Type);
}
ILboolean ilWin32::SetClipboard(ilImage &Image)
{
Image.Bind();
return ilutSetWinClipboard();
}
#endif//ILUT_USE_WIN32
//
// ILVALIDATE
//
ILboolean ilValidate::Valid(ILenum Type, ILconst_string FileName)
{
return ilIsValid(Type, FileName);
}
ILboolean ilValidate::Valid(ILenum Type, FILE *File)
{
return ilIsValidF(Type, File);
}
ILboolean ilValidate::Valid(ILenum Type, void *Lump, ILuint Size)
{
return ilIsValidL(Type, Lump, Size);
}
//
// ILSTATE
//
ILboolean ilState::Disable(ILenum State)
{
return ilDisable(State);
}
ILboolean ilState::Enable(ILenum State)
{
return ilEnable(State);
}
void ilState::Get(ILenum Mode, ILboolean &Param)
{
ilGetBooleanv(Mode, &Param);
return;
}
void ilState::Get(ILenum Mode, ILint &Param)
{
ilGetIntegerv(Mode, &Param);
return;
}
ILboolean ilState::GetBool(ILenum Mode)
{
return ilGetBoolean(Mode);
}
ILint ilState::GetInt(ILenum Mode)
{
return ilGetInteger(Mode);
}
const char *ilState::GetString(ILenum StringName)
{
return ilGetString(StringName);
}
ILboolean ilState::IsDisabled(ILenum Mode)
{
return ilIsDisabled(Mode);
}
ILboolean ilState::IsEnabled(ILenum Mode)
{
return ilIsEnabled(Mode);
}
ILboolean ilState::Origin(ILenum Mode)
{
return ilOriginFunc(Mode);
}
void ilState::Pop()
{
ilPopAttrib();
return;
}
void ilState::Push(ILuint Bits = IL_ALL_ATTRIB_BITS)
{
ilPushAttrib(Bits);
return;
}
//
// ILERROR
//
void ilError::Check(void (*Callback)(const char*))
{
static ILenum Error;
while ((Error = ilGetError()) != IL_NO_ERROR) {
Callback(iluErrorString(Error));
}
return;
}
void ilError::Check(void (*Callback)(ILenum))
{
static ILenum Error;
while ((Error = ilGetError()) != IL_NO_ERROR) {
Callback(Error);
}
return;
}
ILenum ilError::Get()
{
return ilGetError();
}
const char *ilError::String()
{
return iluErrorString(ilGetError());
}
const char *ilError::String(ILenum Error)
{
return iluErrorString(Error);
}
#endif// DEVIL_CPP_WRAPPER_HPP

View File

@ -0,0 +1,159 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2017 by Denton Woods
// Last modified: 01/06/2009
//
// Filename: IL/devil_internal_exports.h
//
// Description: Internal stuff for DevIL (IL, ILU and ILUT)
//
//-----------------------------------------------------------------------------
#ifndef IL_EXPORTS_H
#define IL_EXPORTS_H
#include "IL/il.h"
#ifdef DEBUG
#include <assert.h>
#else
#define assert(x)
#endif
#ifdef NOINLINE
// No inlining. Treat all inline funcs as static.
// Functions will be replicated in all translation units
// use them.
#define STATIC_INLINE static
#else
#if defined(_MSC_VER) && !defined(__cplusplus)
// MSVC compiler uses __inline when compiling C (not C++)
#define STATIC_INLINE static __inline
#else
// Portable across C99, GNU89, C++...
#define STATIC_INLINE static inline
#endif
#endif // NOINLINE
#ifdef __cplusplus
extern "C" {
#endif
#define IL_MAX(a,b) (((a) > (b)) ? (a) : (b))
#define IL_MIN(a,b) (((a) < (b)) ? (a) : (b))
//! Basic Palette struct
typedef struct ILpal
{
ILubyte* Palette; //!< the image palette (if any)
ILuint PalSize; //!< size of the palette (in bytes)
ILenum PalType; //!< the palette types in il.h (0x0500 range)
} ILpal;
//! The Fundamental Image structure
/*! Every bit of information about an image is stored in this internal structure.*/
typedef struct ILimage
{
ILuint Width; //!< the image's width
ILuint Height; //!< the image's height
ILuint Depth; //!< the image's depth
ILubyte Bpp; //!< bytes per pixel (now number of channels)
ILubyte Bpc; //!< bytes per channel
ILuint Bps; //!< bytes per scanline (components for IL)
ILubyte* Data; //!< the image data
ILuint SizeOfData; //!< the total size of the data (in bytes)
ILuint SizeOfPlane; //!< SizeOfData in a 2d image, size of each plane slice in a 3d image (in bytes)
ILenum Format; //!< image format (in IL enum style)
ILenum Type; //!< image type (in IL enum style)
ILenum Origin; //!< origin of the image
ILpal Pal; //!< palette details
ILuint Duration; //!< length of the time to display this "frame"
ILenum CubeFlags; //!< cube map flags for sides present in chain
struct ILimage* Mipmaps; //!< mipmapped versions of this image terminated by a NULL - usu. NULL
struct ILimage* Next; //!< next image in the chain - usu. NULL
struct ILimage* Faces; //!< next cubemap face in the chain - usu. NULL
struct ILimage* Layers; //!< subsequent layers in the chain - usu. NULL
ILuint* AnimList; //!< animation list
ILuint AnimSize; //!< animation list size
void* Profile; //!< colour profile
ILuint ProfileSize; //!< colour profile size
ILuint OffX; //!< x-offset of the image
ILuint OffY; //!< y-offset of the image
ILubyte* DxtcData; //!< compressed data
ILenum DxtcFormat; //!< compressed data format
ILuint DxtcSize; //!< compressed data size
} ILimage;
// Memory functions
ILAPI void* ILAPIENTRY ialloc(const ILsizei Size);
ILAPI void ILAPIENTRY ifree(const void *Ptr);
ILAPI void* ILAPIENTRY icalloc(const ILsizei Size, const ILsizei Num);
#ifdef ALTIVEC_GCC
ILAPI void* ILAPIENTRY ivec_align_buffer(void *buffer, const ILuint size);
#endif
// Internal library functions in IL
ILAPI ILimage* ILAPIENTRY ilGetCurImage(void);
ILAPI void ILAPIENTRY ilSetCurImage(ILimage *Image);
ILAPI void ILAPIENTRY ilSetError(ILenum Error);
ILAPI void ILAPIENTRY ilSetPal(ILpal *Pal);
//
// Utility functions
//
ILAPI ILubyte ILAPIENTRY ilGetBppFormat(ILenum Format);
ILAPI ILenum ILAPIENTRY ilGetFormatBpp(ILubyte Bpp);
ILAPI ILubyte ILAPIENTRY ilGetBpcType(ILenum Type);
ILAPI ILenum ILAPIENTRY ilGetTypeBpc(ILubyte Bpc);
ILAPI ILubyte ILAPIENTRY ilGetBppPal(ILenum PalType);
ILAPI ILenum ILAPIENTRY ilGetPalBaseType(ILenum PalType);
ILAPI ILuint ILAPIENTRY ilNextPower2(ILuint Num);
ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
ILAPI void ILAPIENTRY ilReplaceCurImage(ILimage *Image);
ILAPI void ILAPIENTRY iMemSwap(ILubyte *, ILubyte *, const ILuint);
//
// Image functions
//
ILAPI void ILAPIENTRY iBindImageTemp (void);
ILAPI ILboolean ILAPIENTRY ilClearImage_ (ILimage *Image);
ILAPI void ILAPIENTRY ilCloseImage (ILimage *Image);
ILAPI void ILAPIENTRY ilClosePal (ILpal *Palette);
ILAPI ILpal* ILAPIENTRY iCopyPal (void);
ILAPI ILboolean ILAPIENTRY ilCopyImageAttr (ILimage *Dest, ILimage *Src);
ILAPI ILimage* ILAPIENTRY ilCopyImage_ (ILimage *Src);
ILAPI void ILAPIENTRY ilGetClear (void *Colours, ILenum Format, ILenum Type);
ILAPI ILuint ILAPIENTRY ilGetCurName (void);
ILAPI ILboolean ILAPIENTRY ilIsValidPal (ILpal *Palette);
ILAPI ILimage* ILAPIENTRY ilNewImage (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
ILAPI ILimage* ILAPIENTRY ilNewImageFull (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilInitImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilResizeImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
ILAPI ILboolean ILAPIENTRY ilTexImage_ (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilTexImageSurface_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilTexSubImage_ (ILimage *Image, void *Data);
ILAPI void* ILAPIENTRY ilConvertBuffer (ILuint SizeOfData, ILenum SrcFormat, ILenum DestFormat, ILenum SrcType, ILenum DestType, ILpal *SrcPal, void *Buffer);
ILAPI ILimage* ILAPIENTRY iConvertImage (ILimage *Image, ILenum DestFormat, ILenum DestType);
ILAPI ILpal* ILAPIENTRY iConvertPal (ILpal *Pal, ILenum DestFormat);
ILAPI ILubyte* ILAPIENTRY iGetFlipped (ILimage *Image);
ILAPI ILboolean ILAPIENTRY iMirror();
ILAPI void ILAPIENTRY iFlipBuffer(ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num);
ILubyte* iFlipNewBuffer(ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num);
ILAPI void ILAPIENTRY iGetIntegervImage(ILimage *Image, ILenum Mode, ILint *Param);
// Internal library functions in ILU
ILAPI ILimage* ILAPIENTRY iluRotate_(ILimage *Image, ILfloat Angle);
ILAPI ILimage* ILAPIENTRY iluRotate3D_(ILimage *Image, ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
ILAPI ILimage* ILAPIENTRY iluScale_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth);
#ifdef __cplusplus
}
#endif
#endif//IL_EXPORTS_H

View File

@ -0,0 +1,645 @@
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2017 by Denton Woods
// Last modified: 03/07/2009
//
// Filename: IL/il.h
//
// Description: The main include file for DevIL
//
//-----------------------------------------------------------------------------
// Doxygen comment
/*! \file il.h
The main include file for DevIL
*/
#ifndef __il_h_
#ifndef __IL_H__
#define __il_h_
#define __IL_H__
#ifdef __cplusplus
extern "C" {
#endif
//this define controls if floats and doubles are clamped to [0..1]
//during conversion. It takes a little more time, but it is the correct
//way of doing this. If you are sure your floats are always valid,
//you can undefine this value...
#define CLAMP_HALF 1
#define CLAMP_FLOATS 1
#define CLAMP_DOUBLES 1
/*#ifdef _WIN32_WCE
#define IL_NO_EXR
#define IL_NO_GIF
#define IL_NO_JP2
#define IL_NO_JPG
#define IL_NO_MNG
#define IL_NO_PNG
#define IL_NO_TIF
#define IL_NO_LCMS
#endif //_WIN32_WCE
#ifdef DJGPP
#define IL_NO_EXR
#define IL_NO_GIF
#define IL_NO_JP2
#define IL_NO_JPG
#define IL_NO_MNG
#define IL_NO_PNG
#define IL_NO_TIF
#define IL_NO_LCMS
#endif //DJGPP*/
#ifdef _WIN32
#if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(_IL_BUILD_LIBRARY))
#if defined(_MSC_VER) || defined(__BORLANDC__)
#pragma comment(lib, "DevIL.lib")
#endif
#endif
#endif
#if defined(RESTRICT_KEYWORD) && !defined(__cplusplus)
#define RESTRICT restrict
#define CONST_RESTRICT const restrict
#else
#define RESTRICT
#define CONST_RESTRICT const
#endif
#include <stdio.h>
typedef unsigned int 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;
#ifdef _MSC_VER
typedef __int64 ILint64;
typedef unsigned __int64 ILuint64;
#else
typedef long long int ILint64;
typedef long long unsigned int ILuint64;
#endif
#include <limits.h>
#ifdef _UNICODE
#ifndef _WIN32_WCE
#include <wchar.h>
#endif
//if we use a define instead of a typedef,
//ILconst_string works as intended
#define ILchar wchar_t
#define ILstring wchar_t*
#define ILconst_string wchar_t const *
#else
//if we use a define instead of a typedef,
//ILconst_string works as intended
#define ILchar char
#define ILstring char*
#define ILconst_string char const *
#endif //_UNICODE
#define IL_FALSE 0
#define IL_TRUE 1
// Matches OpenGL's right now.
//! Data formats \link Formats Formats\endlink
#define IL_COLOUR_INDEX 0x1900
#define IL_COLOR_INDEX 0x1900
#define IL_ALPHA 0x1906
#define IL_RGB 0x1907
#define IL_RGBA 0x1908
#define IL_BGR 0x80E0
#define IL_BGRA 0x80E1
#define IL_LUMINANCE 0x1909
#define IL_LUMINANCE_ALPHA 0x190A
//! Data types \link Types Types\endlink
#define IL_BYTE 0x1400
#define IL_UNSIGNED_BYTE 0x1401
#define IL_SHORT 0x1402
#define IL_UNSIGNED_SHORT 0x1403
#define IL_INT 0x1404
#define IL_UNSIGNED_INT 0x1405
#define IL_FLOAT 0x1406
#define IL_DOUBLE 0x140A
#define IL_HALF 0x140B
#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)
#define IL_VENDOR 0x1F00
#define IL_LOAD_EXT 0x1F01
#define IL_SAVE_EXT 0x1F02
//
// IL-specific #define's
//
#define IL_VERSION_1_8_0 1
#define IL_VERSION 180
// Attribute Bits
#define IL_ORIGIN_BIT 0x00000001
#define IL_FILE_BIT 0x00000002
#define IL_PAL_BIT 0x00000004
#define IL_FORMAT_BIT 0x00000008
#define IL_TYPE_BIT 0x00000010
#define IL_COMPRESS_BIT 0x00000020
#define IL_LOADFAIL_BIT 0x00000040
#define IL_FORMAT_SPECIFIC_BIT 0x00000080
#define IL_ALL_ATTRIB_BITS 0x000FFFFF
// Palette types
#define IL_PAL_NONE 0x0400
#define IL_PAL_RGB24 0x0401
#define IL_PAL_RGB32 0x0402
#define IL_PAL_RGBA32 0x0403
#define IL_PAL_BGR24 0x0404
#define IL_PAL_BGR32 0x0405
#define IL_PAL_BGRA32 0x0406
// Image types
#define IL_TYPE_UNKNOWN 0x0000
#define IL_BMP 0x0420 //!< Microsoft Windows Bitmap - .bmp extension
#define IL_CUT 0x0421 //!< Dr. Halo - .cut extension
#define IL_DOOM 0x0422 //!< DooM walls - no specific extension
#define IL_DOOM_FLAT 0x0423 //!< DooM flats - no specific extension
#define IL_ICO 0x0424 //!< Microsoft Windows Icons and Cursors - .ico and .cur extensions
#define IL_JPG 0x0425 //!< JPEG - .jpg, .jpe and .jpeg extensions
#define IL_JFIF 0x0425 //!<
#define IL_ILBM 0x0426 //!< Amiga IFF (FORM ILBM) - .iff, .ilbm, .lbm extensions
#define IL_PCD 0x0427 //!< Kodak PhotoCD - .pcd extension
#define IL_PCX 0x0428 //!< ZSoft PCX - .pcx extension
#define IL_PIC 0x0429 //!< PIC - .pic extension
#define IL_PNG 0x042A //!< Portable Network Graphics - .png extension
#define IL_PNM 0x042B //!< Portable Any Map - .pbm, .pgm, .ppm and .pnm extensions
#define IL_SGI 0x042C //!< Silicon Graphics - .sgi, .bw, .rgb and .rgba extensions
#define IL_TGA 0x042D //!< TrueVision Targa File - .tga, .vda, .icb and .vst extensions
#define IL_TIF 0x042E //!< Tagged Image File Format - .tif and .tiff extensions
#define IL_CHEAD 0x042F //!< C-Style Header - .h extension
#define IL_RAW 0x0430 //!< Raw Image Data - any extension
#define IL_MDL 0x0431 //!< Half-Life Model Texture - .mdl extension
#define IL_WAL 0x0432 //!< Quake 2 Texture - .wal extension
#define IL_LIF 0x0434 //!< Homeworld Texture - .lif extension
#define IL_MNG 0x0435 //!< Multiple-image Network Graphics - .mng extension
#define IL_JNG 0x0435 //!<
#define IL_GIF 0x0436 //!< Graphics Interchange Format - .gif extension
#define IL_DDS 0x0437 //!< DirectDraw Surface - .dds extension
#define IL_DCX 0x0438 //!< ZSoft Multi-PCX - .dcx extension
#define IL_PSD 0x0439 //!< Adobe PhotoShop - .psd extension
#define IL_EXIF 0x043A //!<
#define IL_PSP 0x043B //!< PaintShop Pro - .psp extension
#define IL_PIX 0x043C //!< PIX - .pix extension
#define IL_PXR 0x043D //!< Pixar - .pxr extension
#define IL_XPM 0x043E //!< X Pixel Map - .xpm extension
#define IL_HDR 0x043F //!< Radiance High Dynamic Range - .hdr extension
#define IL_ICNS 0x0440 //!< Macintosh Icon - .icns extension
#define IL_JP2 0x0441 //!< Jpeg 2000 - .jp2 extension
#define IL_EXR 0x0442 //!< OpenEXR - .exr extension
#define IL_WDP 0x0443 //!< Microsoft HD Photo - .wdp and .hdp extension
#define IL_VTF 0x0444 //!< Valve Texture Format - .vtf extension
#define IL_WBMP 0x0445 //!< Wireless Bitmap - .wbmp extension
#define IL_SUN 0x0446 //!< Sun Raster - .sun, .ras, .rs, .im1, .im8, .im24 and .im32 extensions
#define IL_IFF 0x0447 //!< Interchange File Format - .iff extension
#define IL_TPL 0x0448 //!< Gamecube Texture - .tpl extension
#define IL_FITS 0x0449 //!< Flexible Image Transport System - .fit and .fits extensions
#define IL_DICOM 0x044A //!< Digital Imaging and Communications in Medicine (DICOM) - .dcm and .dicom extensions
#define IL_IWI 0x044B //!< Call of Duty Infinity Ward Image - .iwi extension
#define IL_BLP 0x044C //!< Blizzard Texture Format - .blp extension
#define IL_FTX 0x044D //!< Heavy Metal: FAKK2 Texture - .ftx extension
#define IL_ROT 0x044E //!< Homeworld 2 - Relic Texture - .rot extension
#define IL_TEXTURE 0x044F //!< Medieval II: Total War Texture - .texture extension
#define IL_DPX 0x0450 //!< Digital Picture Exchange - .dpx extension
#define IL_UTX 0x0451 //!< Unreal (and Unreal Tournament) Texture - .utx extension
#define IL_MP3 0x0452 //!< MPEG-1 Audio Layer 3 - .mp3 extension
#define IL_KTX 0x0453 //!< Khronos Texture - .ktx extension
#define IL_JASC_PAL 0x0475 //!< PaintShop Pro Palette
// Error Types
#define IL_NO_ERROR 0x0000
#define IL_INVALID_ENUM 0x0501
#define IL_OUT_OF_MEMORY 0x0502
#define IL_FORMAT_NOT_SUPPORTED 0x0503
#define IL_INTERNAL_ERROR 0x0504
#define IL_INVALID_VALUE 0x0505
#define IL_ILLEGAL_OPERATION 0x0506
#define IL_ILLEGAL_FILE_VALUE 0x0507
#define IL_INVALID_FILE_HEADER 0x0508
#define IL_INVALID_PARAM 0x0509
#define IL_COULD_NOT_OPEN_FILE 0x050A
#define IL_INVALID_EXTENSION 0x050B
#define IL_FILE_ALREADY_EXISTS 0x050C
#define IL_OUT_FORMAT_SAME 0x050D
#define IL_STACK_OVERFLOW 0x050E
#define IL_STACK_UNDERFLOW 0x050F
#define IL_INVALID_CONVERSION 0x0510
#define IL_BAD_DIMENSIONS 0x0511
#define IL_FILE_READ_ERROR 0x0512 // 05/12/2002: Addition by Sam.
#define IL_FILE_WRITE_ERROR 0x0512
#define IL_LIB_GIF_ERROR 0x05E1
#define IL_LIB_JPEG_ERROR 0x05E2
#define IL_LIB_PNG_ERROR 0x05E3
#define IL_LIB_TIFF_ERROR 0x05E4
#define IL_LIB_MNG_ERROR 0x05E5
#define IL_LIB_JP2_ERROR 0x05E6
#define IL_LIB_EXR_ERROR 0x05E7
#define IL_UNKNOWN_ERROR 0x05FF
// Origin Definitions
#define IL_ORIGIN_SET 0x0600
#define IL_ORIGIN_LOWER_LEFT 0x0601
#define IL_ORIGIN_UPPER_LEFT 0x0602
#define IL_ORIGIN_MODE 0x0603
// Format and Type Mode Definitions
#define IL_FORMAT_SET 0x0610
#define IL_FORMAT_MODE 0x0611
#define IL_TYPE_SET 0x0612
#define IL_TYPE_MODE 0x0613
// File definitions
#define IL_FILE_OVERWRITE 0x0620
#define IL_FILE_MODE 0x0621
// Palette definitions
#define IL_CONV_PAL 0x0630
// Load fail definitions
#define IL_DEFAULT_ON_FAIL 0x0632
// Key colour and alpha definitions
#define IL_USE_KEY_COLOUR 0x0635
#define IL_USE_KEY_COLOR 0x0635
#define IL_BLIT_BLEND 0x0636
// Interlace definitions
#define IL_SAVE_INTERLACED 0x0639
#define IL_INTERLACE_MODE 0x063A
// Quantization definitions
#define IL_QUANTIZATION_MODE 0x0640
#define IL_WU_QUANT 0x0641
#define IL_NEU_QUANT 0x0642
#define IL_NEU_QUANT_SAMPLE 0x0643
#define IL_MAX_QUANT_INDEXS 0x0644 //XIX : ILint : Maximum number of colors to reduce to, default of 256. and has a range of 2-256
#define IL_MAX_QUANT_INDICES 0x0644 // Redefined, since the above #define is misspelled
// Hints
#define IL_FASTEST 0x0660
#define IL_LESS_MEM 0x0661
#define IL_DONT_CARE 0x0662
#define IL_MEM_SPEED_HINT 0x0665
#define IL_USE_COMPRESSION 0x0666
#define IL_NO_COMPRESSION 0x0667
#define IL_COMPRESSION_HINT 0x0668
// Compression
#define IL_NVIDIA_COMPRESS 0x0670
#define IL_SQUISH_COMPRESS 0x0671
// Subimage types
#define IL_SUB_NEXT 0x0680
#define IL_SUB_MIPMAP 0x0681
#define IL_SUB_LAYER 0x0682
// Compression definitions
#define IL_COMPRESS_MODE 0x0700
#define IL_COMPRESS_NONE 0x0701
#define IL_COMPRESS_RLE 0x0702
#define IL_COMPRESS_LZO 0x0703
#define IL_COMPRESS_ZLIB 0x0704
// File format-specific values
#define IL_TGA_CREATE_STAMP 0x0710
#define IL_JPG_QUALITY 0x0711
#define IL_PNG_INTERLACE 0x0712
#define IL_TGA_RLE 0x0713
#define IL_BMP_RLE 0x0714
#define IL_SGI_RLE 0x0715
#define IL_TGA_ID_STRING 0x0717
#define IL_TGA_AUTHNAME_STRING 0x0718
#define IL_TGA_AUTHCOMMENT_STRING 0x0719
#define IL_PNG_AUTHNAME_STRING 0x071A
#define IL_PNG_TITLE_STRING 0x071B
#define IL_PNG_DESCRIPTION_STRING 0x071C
#define IL_TIF_DESCRIPTION_STRING 0x071D
#define IL_TIF_HOSTCOMPUTER_STRING 0x071E
#define IL_TIF_DOCUMENTNAME_STRING 0x071F
#define IL_TIF_AUTHNAME_STRING 0x0720
#define IL_JPG_SAVE_FORMAT 0x0721
#define IL_CHEAD_HEADER_STRING 0x0722
#define IL_PCD_PICNUM 0x0723
#define IL_PNG_ALPHA_INDEX 0x0724 // currently has no effect!
#define IL_JPG_PROGRESSIVE 0x0725
#define IL_VTF_COMP 0x0726
// DXTC definitions
#define IL_DXTC_FORMAT 0x0705
#define IL_DXT1 0x0706
#define IL_DXT2 0x0707
#define IL_DXT3 0x0708
#define IL_DXT4 0x0709
#define IL_DXT5 0x070A
#define IL_DXT_NO_COMP 0x070B
#define IL_KEEP_DXTC_DATA 0x070C
#define IL_DXTC_DATA_FORMAT 0x070D
#define IL_3DC 0x070E
#define IL_RXGB 0x070F
#define IL_ATI1N 0x0710
#define IL_DXT1A 0x0711 // Normally the same as IL_DXT1, except for nVidia Texture Tools.
// Environment map definitions
#define IL_CUBEMAP_POSITIVEX 0x00000400
#define IL_CUBEMAP_NEGATIVEX 0x00000800
#define IL_CUBEMAP_POSITIVEY 0x00001000
#define IL_CUBEMAP_NEGATIVEY 0x00002000
#define IL_CUBEMAP_POSITIVEZ 0x00004000
#define IL_CUBEMAP_NEGATIVEZ 0x00008000
#define IL_SPHEREMAP 0x00010000
// Values
#define IL_VERSION_NUM 0x0DE2
#define IL_IMAGE_WIDTH 0x0DE4
#define IL_IMAGE_HEIGHT 0x0DE5
#define IL_IMAGE_DEPTH 0x0DE6
#define IL_IMAGE_SIZE_OF_DATA 0x0DE7
#define IL_IMAGE_BPP 0x0DE8
#define IL_IMAGE_BYTES_PER_PIXEL 0x0DE8
#define IL_IMAGE_BPP 0x0DE8
#define IL_IMAGE_BITS_PER_PIXEL 0x0DE9
#define IL_IMAGE_FORMAT 0x0DEA
#define IL_IMAGE_TYPE 0x0DEB
#define IL_PALETTE_TYPE 0x0DEC
#define IL_PALETTE_SIZE 0x0DED
#define IL_PALETTE_BPP 0x0DEE
#define IL_PALETTE_NUM_COLS 0x0DEF
#define IL_PALETTE_BASE_TYPE 0x0DF0
#define IL_NUM_FACES 0x0DE1
#define IL_NUM_IMAGES 0x0DF1
#define IL_NUM_MIPMAPS 0x0DF2
#define IL_NUM_LAYERS 0x0DF3
#define IL_ACTIVE_IMAGE 0x0DF4
#define IL_ACTIVE_MIPMAP 0x0DF5
#define IL_ACTIVE_LAYER 0x0DF6
#define IL_ACTIVE_FACE 0x0E00
#define IL_CUR_IMAGE 0x0DF7
#define IL_IMAGE_DURATION 0x0DF8
#define IL_IMAGE_PLANESIZE 0x0DF9
#define IL_IMAGE_BPC 0x0DFA
#define IL_IMAGE_OFFX 0x0DFB
#define IL_IMAGE_OFFY 0x0DFC
#define IL_IMAGE_CUBEFLAGS 0x0DFD
#define IL_IMAGE_ORIGIN 0x0DFE
#define IL_IMAGE_CHANNELS 0x0DFF
# if defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0))
// __attribute__((deprecated)) is supported by GCC 3.1 and later.
# define DEPRECATED(D) D __attribute__((deprecated))
# elif defined _MSC_VER && _MSC_VER >= 1300
// __declspec(deprecated) is supported by MSVC 7.0 and later.
# define DEPRECATED(D) __declspec(deprecated) D
# else
# define DEPRECATED (D) D
# endif
//
// Section shamelessly modified from the glut header.
//
// This is from Win32's <windef.h>
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__)
#define ILAPIENTRY __stdcall
#define IL_PACKSTRUCT
//#elif defined(linux) || defined(MACOSX) || defined(__CYGWIN__) //fix bug 840364
#elif defined( __GNUC__ )
// this should work for any of the above commented platforms
// plus any platform using GCC
#ifdef __MINGW32__
#define ILAPIENTRY __stdcall
#else
#define ILAPIENTRY
#endif
#define IL_PACKSTRUCT __attribute__ ((packed))
#else
#define ILAPIENTRY
#define IL_PACKSTRUCT
#endif
// This is from Win32's <wingdi.h> and <winnt.h>
#if defined(__LCC__)
#define ILAPI __stdcall
#elif defined(_WIN32) //changed 20031221 to fix bug 840421
#ifdef IL_STATIC_LIB
#define ILAPI
#else
#ifdef _IL_BUILD_LIBRARY
#define ILAPI __declspec(dllexport)
#else
#define ILAPI __declspec(dllimport)
#endif
#endif
#elif __APPLE__
#define ILAPI extern
#else
#define ILAPI
#endif
#define IL_SEEK_SET 0
#define IL_SEEK_CUR 1
#define IL_SEEK_END 2
#define IL_EOF -1
// Callback functions for file reading
typedef void* ILHANDLE;
typedef void (ILAPIENTRY *fCloseRProc)(ILHANDLE);
typedef ILboolean (ILAPIENTRY *fEofProc) (ILHANDLE);
typedef ILint (ILAPIENTRY *fGetcProc) (ILHANDLE);
typedef ILHANDLE (ILAPIENTRY *fOpenRProc) (ILconst_string);
typedef ILint (ILAPIENTRY *fReadProc) (void*, ILuint, ILuint, ILHANDLE);
typedef ILint (ILAPIENTRY *fSeekRProc) (ILHANDLE, ILint, ILint);
typedef ILint (ILAPIENTRY *fTellRProc) (ILHANDLE);
// Callback functions for file writing
typedef void (ILAPIENTRY *fCloseWProc)(ILHANDLE);
typedef ILHANDLE (ILAPIENTRY *fOpenWProc) (ILconst_string);
typedef ILint (ILAPIENTRY *fPutcProc) (ILubyte, ILHANDLE);
typedef ILint (ILAPIENTRY *fSeekWProc) (ILHANDLE, ILint, ILint);
typedef ILint (ILAPIENTRY *fTellWProc) (ILHANDLE);
typedef ILint (ILAPIENTRY *fWriteProc) (const void*, ILuint, ILuint, ILHANDLE);
// Callback functions for allocation and deallocation
typedef void* (ILAPIENTRY *mAlloc)(const ILsizei);
typedef void (ILAPIENTRY *mFree) (const void* CONST_RESTRICT);
// Registered format procedures
typedef ILenum (ILAPIENTRY *IL_LOADPROC)(ILconst_string);
typedef ILenum (ILAPIENTRY *IL_SAVEPROC)(ILconst_string);
// ImageLib Functions
ILAPI ILboolean ILAPIENTRY ilActiveFace(ILuint Number);
ILAPI ILboolean ILAPIENTRY ilActiveImage(ILuint Number);
ILAPI ILboolean ILAPIENTRY ilActiveLayer(ILuint Number);
ILAPI ILboolean ILAPIENTRY ilActiveMipmap(ILuint Number);
ILAPI ILboolean ILAPIENTRY ilApplyPal(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilApplyProfile(ILstring InProfile, ILstring OutProfile);
ILAPI void ILAPIENTRY 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);
ILAPI ILboolean ILAPIENTRY ilClampNTSC(void);
ILAPI void ILAPIENTRY ilClearColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
ILAPI ILboolean ILAPIENTRY ilClearImage(void);
ILAPI ILuint ILAPIENTRY ilCloneCurImage(void);
ILAPI ILubyte* ILAPIENTRY ilCompressDXT(ILubyte *Data, ILuint Width, ILuint Height, ILuint Depth, ILenum DXTCFormat, ILuint *DXTCSize);
ILAPI ILboolean ILAPIENTRY ilCompressFunc(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilConvertImage(ILenum DestFormat, ILenum DestType);
ILAPI ILboolean ILAPIENTRY ilConvertPal(ILenum DestFormat);
ILAPI ILboolean ILAPIENTRY 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);
ILAPI ILuint ILAPIENTRY ilCreateSubImage(ILenum Type, ILuint Num);
ILAPI ILboolean ILAPIENTRY ilDefaultImage(void);
ILAPI void ILAPIENTRY ilDeleteImage(const ILuint Num);
ILAPI void ILAPIENTRY ilDeleteImages(ILsizei Num, const ILuint *Images);
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);
ILAPI ILboolean ILAPIENTRY ilDxtcDataToImage(void);
ILAPI ILboolean ILAPIENTRY ilDxtcDataToSurface(void);
ILAPI ILboolean ILAPIENTRY ilEnable(ILenum Mode);
ILAPI void ILAPIENTRY ilFlipSurfaceDxtcData(void);
ILAPI ILboolean ILAPIENTRY ilFormatFunc(ILenum Mode);
ILAPI void ILAPIENTRY ilGenImages(ILsizei Num, ILuint *Images);
ILAPI ILuint ILAPIENTRY ilGenImage(void);
ILAPI ILubyte* ILAPIENTRY ilGetAlpha(ILenum Type);
ILAPI ILboolean ILAPIENTRY ilGetBoolean(ILenum Mode);
ILAPI void ILAPIENTRY ilGetBooleanv(ILenum Mode, ILboolean *Param);
ILAPI ILubyte* ILAPIENTRY ilGetData(void);
ILAPI ILuint ILAPIENTRY ilGetDXTCData(void *Buffer, ILuint BufferSize, ILenum DXTCFormat);
ILAPI ILenum ILAPIENTRY ilGetError(void);
ILAPI ILint ILAPIENTRY ilGetInteger(ILenum Mode);
ILAPI void ILAPIENTRY ilGetIntegerv(ILenum Mode, ILint *Param);
ILAPI ILuint ILAPIENTRY ilGetLumpPos(void);
ILAPI ILubyte* ILAPIENTRY ilGetPalette(void);
ILAPI ILconst_string ILAPIENTRY ilGetString(ILenum StringName);
ILAPI void ILAPIENTRY ilHint(ILenum Target, ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilInvertSurfaceDxtcDataAlpha(void);
ILAPI void ILAPIENTRY ilInit(void);
ILAPI ILboolean ILAPIENTRY ilImageToDxtcData(ILenum Format);
ILAPI ILboolean ILAPIENTRY ilIsDisabled(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilIsEnabled(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilIsImage(ILuint Image);
ILAPI ILboolean ILAPIENTRY ilIsValid(ILenum Type, ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilIsValidF(ILenum Type, ILHANDLE File);
ILAPI ILboolean ILAPIENTRY ilIsValidL(ILenum Type, void *Lump, ILuint Size);
ILAPI void ILAPIENTRY ilKeyColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha);
ILAPI ILboolean ILAPIENTRY ilLoad(ILenum Type, ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilLoadF(ILenum Type, ILHANDLE File);
ILAPI ILboolean ILAPIENTRY ilLoadImage(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilLoadL(ILenum Type, const void *Lump, ILuint Size);
ILAPI ILboolean ILAPIENTRY ilLoadPal(ILconst_string FileName);
ILAPI void ILAPIENTRY ilModAlpha(ILdouble AlphaValue);
ILAPI ILboolean ILAPIENTRY ilOriginFunc(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilOverlayImage(ILuint Source, ILint XCoord, ILint YCoord, ILint ZCoord);
ILAPI void ILAPIENTRY ilPopAttrib(void);
ILAPI void ILAPIENTRY ilPushAttrib(ILuint Bits);
ILAPI void ILAPIENTRY ilRegisterFormat(ILenum Format);
ILAPI ILboolean ILAPIENTRY ilRegisterLoad(ILconst_string Ext, IL_LOADPROC Load);
ILAPI ILboolean ILAPIENTRY ilRegisterMipNum(ILuint Num);
ILAPI ILboolean ILAPIENTRY ilRegisterNumFaces(ILuint Num);
ILAPI ILboolean ILAPIENTRY ilRegisterNumImages(ILuint Num);
ILAPI void ILAPIENTRY ilRegisterOrigin(ILenum Origin);
ILAPI void ILAPIENTRY ilRegisterPal(void *Pal, ILuint Size, ILenum Type);
ILAPI ILboolean ILAPIENTRY ilRegisterSave(ILconst_string Ext, IL_SAVEPROC Save);
ILAPI void ILAPIENTRY ilRegisterType(ILenum Type);
ILAPI ILboolean ILAPIENTRY ilRemoveLoad(ILconst_string Ext);
ILAPI ILboolean ILAPIENTRY ilRemoveSave(ILconst_string Ext);
ILAPI void ILAPIENTRY ilResetMemory(void); // Deprecated
ILAPI void ILAPIENTRY ilResetRead(void);
ILAPI void ILAPIENTRY ilResetWrite(void);
ILAPI ILboolean ILAPIENTRY ilSave(ILenum Type, ILconst_string FileName);
ILAPI ILuint ILAPIENTRY ilSaveF(ILenum Type, ILHANDLE File);
ILAPI ILboolean ILAPIENTRY ilSaveImage(ILconst_string FileName);
ILAPI ILuint ILAPIENTRY ilSaveL(ILenum Type, void *Lump, ILuint Size);
ILAPI ILboolean ILAPIENTRY ilSavePal(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilSetAlpha(ILdouble AlphaValue);
ILAPI ILboolean ILAPIENTRY ilSetData(void *Data);
ILAPI ILboolean ILAPIENTRY ilSetDuration(ILuint Duration);
ILAPI void ILAPIENTRY ilSetInteger(ILenum Mode, ILint Param);
ILAPI void ILAPIENTRY ilSetMemory(mAlloc, mFree);
ILAPI void ILAPIENTRY ilSetPixels(ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data);
ILAPI void ILAPIENTRY ilSetRead(fOpenRProc, fCloseRProc, fEofProc, fGetcProc, fReadProc, fSeekRProc, fTellRProc);
ILAPI void ILAPIENTRY ilSetString(ILenum Mode, const char *String);
ILAPI void ILAPIENTRY ilSetWrite(fOpenWProc, fCloseWProc, fPutcProc, fSeekWProc, fTellWProc, fWriteProc);
ILAPI void ILAPIENTRY ilShutDown(void);
ILAPI ILboolean ILAPIENTRY ilSurfaceToDxtcData(ILenum Format);
ILAPI ILboolean ILAPIENTRY ilTexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte NumChannels, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilTexImageDxtc(ILint w, ILint h, ILint d, ILenum DxtFormat, const ILubyte* data);
ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilTypeFunc(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilLoadData(ILconst_string FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
ILAPI ILboolean ILAPIENTRY 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);
ILAPI ILboolean ILAPIENTRY ilSaveData(ILconst_string FileName);
// For all those weirdos that spell "colour" without the 'u'.
#define ilClearColor ilClearColour
#define ilKeyColor ilKeyColour
#define imemclear(x,y) memset(x,0,y);
#ifdef __cplusplus
}
#endif
#endif // __IL_H__
#endif // __il_h__

View File

@ -0,0 +1,205 @@
#ifndef WRAPPER_H
#define WRAPPER_H
/*#include <il/il.h>
#include <il/ilu.h>*/
#include <IL/ilut.h> // Probably only have to #include this one
#ifdef _MSC_VER
#ifndef _IL_WRAP_BUILD_LIB
#pragma comment(lib, "il_wrap.lib")
#endif
#endif
class ilImage
{
public:
ilImage();
ilImage(char *);
ilImage(const ilImage &);
virtual ~ilImage();
ILboolean Load(char *);
ILboolean Load(char *, ILenum);
ILboolean Save(char *);
ILboolean Save(char *, ILenum);
// ImageLib functions
ILboolean ActiveImage(ILuint);
ILboolean ActiveLayer(ILuint);
ILboolean ActiveMipmap(ILuint);
ILboolean Clear(void);
ILvoid ClearColour(ILclampf, ILclampf, ILclampf, ILclampf);
ILboolean Convert(ILenum);
ILboolean Copy(ILuint);
ILboolean Default(void);
ILboolean Flip(void);
ILboolean SwapColours(void);
ILboolean Resize(ILuint, ILuint, ILuint);
ILboolean TexImage(ILuint, ILuint, ILuint, ILubyte, ILenum, ILenum, ILvoid*);
// Image handling
ILvoid Bind(void) const;
ILvoid Bind(ILuint);
ILvoid Close(void) { this->Delete(); }
ILvoid Delete(void);
ILvoid iGenBind();
ILenum PaletteAlphaIndex();
// Image characteristics
ILuint Width(void);
ILuint Height(void);
ILuint Depth(void);
ILubyte Bpp(void);
ILubyte Bitpp(void);
ILenum PaletteType(void);
ILenum Format(void);
ILenum Type(void);
ILuint NumImages(void);
ILuint NumMipmaps(void);
ILuint GetId(void) const;
ILenum GetOrigin(void);
ILubyte *GetData(void);
ILubyte *GetPalette(void);
// Rendering
ILuint BindImage(void);
ILuint BindImage(ILenum);
// Operators
ilImage& operator = (ILuint);
ilImage& operator = (const ilImage &);
protected:
ILuint Id;
private:
ILvoid iStartUp();
};
class ilFilters
{
public:
static ILboolean Alienify(ilImage &);
static ILboolean BlurAvg(ilImage &, ILuint Iter);
static ILboolean BlurGaussian(ilImage &, ILuint Iter);
static ILboolean Contrast(ilImage &, ILfloat Contrast);
static ILboolean EdgeDetectE(ilImage &);
static ILboolean EdgeDetectP(ilImage &);
static ILboolean EdgeDetectS(ilImage &);
static ILboolean Emboss(ilImage &);
static ILboolean Gamma(ilImage &, ILfloat Gamma);
static ILboolean Negative(ilImage &);
static ILboolean Noisify(ilImage &, ILubyte Factor);
static ILboolean Pixelize(ilImage &, ILuint PixSize);
static ILboolean Saturate(ilImage &, ILfloat Saturation);
static ILboolean Saturate(ilImage &, ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
static ILboolean ScaleColours(ilImage &, ILfloat r, ILfloat g, ILfloat b);
static ILboolean Sharpen(ilImage &, ILfloat Factor, ILuint Iter);
};
#ifdef ILUT_USE_OPENGL
class ilOgl
{
public:
static ILvoid Init(void);
static GLuint BindTex(ilImage &);
static ILboolean Upload(ilImage &, ILuint);
static GLuint Mipmap(ilImage &);
static ILboolean Screen(void);
static ILboolean Screenie(void);
};
#endif//ILUT_USE_OPENGL
#ifdef ILUT_USE_ALLEGRO
class ilAlleg
{
public:
static ILvoid Init(void);
static BITMAP *Convert(ilImage &);
};
#endif//ILUT_USE_ALLEGRO
#ifdef ILUT_USE_WIN32
class ilWin32
{
public:
static ILvoid Init(void);
static HBITMAP Convert(ilImage &);
static ILboolean GetClipboard(ilImage &);
static ILvoid GetInfo(ilImage &, BITMAPINFO *Info);
static ILubyte *GetPadData(ilImage &);
static HPALETTE GetPal(ilImage &);
static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType);
static ILboolean GetResource(ilImage &, HINSTANCE hInst, ILint ID, char *ResourceType, ILenum Type);
static ILboolean SetClipboard(ilImage &);
};
#endif//ILUT_USE_WIN32
class ilValidate
{
public:
static ILboolean Valid(ILenum, char *);
static ILboolean Valid(ILenum, FILE *);
static ILboolean Valid(ILenum, ILvoid *, ILuint);
protected:
private:
};
class ilState
{
public:
static ILboolean Disable(ILenum);
static ILboolean Enable(ILenum);
static ILvoid Get(ILenum, ILboolean &);
static ILvoid Get(ILenum, ILint &);
static ILboolean GetBool(ILenum);
static ILint GetInt(ILenum);
static const char *GetString(ILenum);
static ILboolean IsDisabled(ILenum);
static ILboolean IsEnabled(ILenum);
static ILboolean Origin(ILenum);
static ILvoid Pop(void);
static ILvoid Push(ILuint);
protected:
private:
};
class ilError
{
public:
static ILvoid Check(ILvoid (*Callback)(const char*));
static ILvoid Check(ILvoid (*Callback)(ILenum));
static ILenum Get(void);
static const char *String(void);
static const char *String(ILenum);
protected:
private:
};
#endif//WRAPPER_H

View File

@ -0,0 +1,198 @@
//-----------------------------------------------------------------------------
//
// ImageLib Utility Sources
// Copyright (C) 2000-2017 by Denton Woods
// Last modified: 03/07/2009
//
// Filename: IL/ilu.h
//
// Description: The main include file for ILU
//
//-----------------------------------------------------------------------------
// Doxygen comment
/*! \file ilu.h
The main include file for ILU
*/
#ifndef __ilu_h_
#ifndef __ILU_H__
#define __ilu_h_
#define __ILU_H__
#include <IL/il.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(_IL_BUILD_LIBRARY))
#if defined(_MSC_VER) || defined(__BORLANDC__)
#pragma comment(lib, "ILU.lib")
#endif
#endif
#endif
#define ILU_VERSION_1_8_0 1
#define ILU_VERSION 180
#define ILU_FILTER 0x2600
#define ILU_NEAREST 0x2601
#define ILU_LINEAR 0x2602
#define ILU_BILINEAR 0x2603
#define ILU_SCALE_BOX 0x2604
#define ILU_SCALE_TRIANGLE 0x2605
#define ILU_SCALE_BELL 0x2606
#define ILU_SCALE_BSPLINE 0x2607
#define ILU_SCALE_LANCZOS3 0x2608
#define ILU_SCALE_MITCHELL 0x2609
// Error types
#define ILU_INVALID_ENUM 0x0501
#define ILU_OUT_OF_MEMORY 0x0502
#define ILU_INTERNAL_ERROR 0x0504
#define ILU_INVALID_VALUE 0x0505
#define ILU_ILLEGAL_OPERATION 0x0506
#define ILU_INVALID_PARAM 0x0509
// Values
#define ILU_PLACEMENT 0x0700
#define ILU_LOWER_LEFT 0x0701
#define ILU_LOWER_RIGHT 0x0702
#define ILU_UPPER_LEFT 0x0703
#define ILU_UPPER_RIGHT 0x0704
#define ILU_CENTER 0x0705
#define ILU_CONVOLUTION_MATRIX 0x0710
#define ILU_VERSION_NUM IL_VERSION_NUM
#define ILU_VENDOR IL_VENDOR
// Languages
#define ILU_ENGLISH 0x0800
#define ILU_ARABIC 0x0801
#define ILU_DUTCH 0x0802
#define ILU_JAPANESE 0x0803
#define ILU_SPANISH 0x0804
#define ILU_GERMAN 0x0805
#define ILU_FRENCH 0x0806
#define ILU_ITALIAN 0x0807
// Filters
/*
#define ILU_FILTER_BLUR 0x0803
#define ILU_FILTER_GAUSSIAN_3x3 0x0804
#define ILU_FILTER_GAUSSIAN_5X5 0x0805
#define ILU_FILTER_EMBOSS1 0x0807
#define ILU_FILTER_EMBOSS2 0x0808
#define ILU_FILTER_LAPLACIAN1 0x080A
#define ILU_FILTER_LAPLACIAN2 0x080B
#define ILU_FILTER_LAPLACIAN3 0x080C
#define ILU_FILTER_LAPLACIAN4 0x080D
#define ILU_FILTER_SHARPEN1 0x080E
#define ILU_FILTER_SHARPEN2 0x080F
#define ILU_FILTER_SHARPEN3 0x0810
*/
typedef struct ILinfo
{
ILuint Id; // the image's id
ILubyte *Data; // the image's data
ILuint Width; // the image's width
ILuint Height; // the image's height
ILuint Depth; // the image's depth
ILubyte Bpp; // bytes per pixel (not bits) of the image
ILuint SizeOfData; // the total size of the data (in bytes)
ILenum Format; // image format (in IL enum style)
ILenum Type; // image type (in IL enum style)
ILenum Origin; // origin of the image
ILubyte *Palette; // the image's palette
ILenum PalType; // palette type
ILuint PalSize; // palette size
ILenum CubeFlags; // flags for what cube map sides are present
ILuint NumNext; // number of images following
ILuint NumMips; // number of mipmaps
ILuint NumLayers; // number of layers
} ILinfo;
typedef struct ILpointf {
ILfloat x;
ILfloat y;
} ILpointf;
typedef struct ILpointi {
ILint x;
ILint y;
} ILpointi;
ILAPI ILboolean ILAPIENTRY iluAlienify(void);
ILAPI ILboolean ILAPIENTRY iluBlurAvg(ILuint Iter);
ILAPI ILboolean ILAPIENTRY iluBlurGaussian(ILuint Iter);
ILAPI ILboolean ILAPIENTRY iluBuildMipmaps(void);
ILAPI ILuint ILAPIENTRY iluColoursUsed(void);
ILAPI ILboolean ILAPIENTRY iluCompareImage(ILuint Comp);
ILAPI ILboolean ILAPIENTRY iluContrast(ILfloat Contrast);
ILAPI ILboolean ILAPIENTRY iluCrop(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth);
ILAPI void ILAPIENTRY iluDeleteImage(ILuint Id); // Deprecated
ILAPI ILboolean ILAPIENTRY iluEdgeDetectE(void);
ILAPI ILboolean ILAPIENTRY iluEdgeDetectP(void);
ILAPI ILboolean ILAPIENTRY iluEdgeDetectS(void);
ILAPI ILboolean ILAPIENTRY iluEmboss(void);
ILAPI ILboolean ILAPIENTRY iluEnlargeCanvas(ILuint Width, ILuint Height, ILuint Depth);
ILAPI ILboolean ILAPIENTRY iluEnlargeImage(ILfloat XDim, ILfloat YDim, ILfloat ZDim);
ILAPI ILboolean ILAPIENTRY iluEqualize(void);
ILAPI ILboolean ILAPIENTRY iluEqualize2(void);
ILAPI ILconst_string ILAPIENTRY iluErrorString(ILenum Error);
ILAPI ILboolean ILAPIENTRY iluConvolution(ILint *matrix, ILint scale, ILint bias);
ILAPI ILboolean ILAPIENTRY iluFlipImage(void);
ILAPI ILboolean ILAPIENTRY iluGammaCorrect(ILfloat Gamma);
ILAPI ILuint ILAPIENTRY iluGenImage(void); // Deprecated
ILAPI void ILAPIENTRY iluGetImageInfo(ILinfo *Info);
ILAPI ILint ILAPIENTRY iluGetInteger(ILenum Mode);
ILAPI void ILAPIENTRY iluGetIntegerv(ILenum Mode, ILint *Param);
ILAPI ILstring ILAPIENTRY iluGetString(ILenum StringName);
ILAPI void ILAPIENTRY iluImageParameter(ILenum PName, ILenum Param);
ILAPI void ILAPIENTRY iluInit(void);
ILAPI ILboolean ILAPIENTRY iluInvertAlpha(void);
ILAPI ILuint ILAPIENTRY iluLoadImage(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY iluMirror(void);
ILAPI ILboolean ILAPIENTRY iluNegative(void);
ILAPI ILboolean ILAPIENTRY iluNoisify(ILclampf Tolerance);
ILAPI ILboolean ILAPIENTRY iluPixelize(ILuint PixSize);
ILAPI void ILAPIENTRY iluRegionfv(ILpointf *Points, ILuint n);
ILAPI void ILAPIENTRY iluRegioniv(ILpointi *Points, ILuint n);
ILAPI ILboolean ILAPIENTRY iluReplaceColour(ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance);
ILAPI ILboolean ILAPIENTRY iluRotate(ILfloat Angle);
ILAPI ILboolean ILAPIENTRY iluRotate3D(ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
ILAPI ILboolean ILAPIENTRY iluSaturate1f(ILfloat Saturation);
ILAPI ILboolean ILAPIENTRY iluSaturate4f(ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
ILAPI ILboolean ILAPIENTRY iluScale(ILuint Width, ILuint Height, ILuint Depth);
ILAPI ILboolean ILAPIENTRY iluScaleAlpha(ILfloat scale);
ILAPI ILboolean ILAPIENTRY iluScaleColours(ILfloat r, ILfloat g, ILfloat b);
ILAPI ILboolean ILAPIENTRY iluSepia(void);
ILAPI ILboolean ILAPIENTRY iluSetLanguage(ILenum Language);
ILAPI ILboolean ILAPIENTRY iluSharpen(ILfloat Factor, ILuint Iter);
ILAPI ILboolean ILAPIENTRY iluSwapColours(void);
ILAPI ILboolean ILAPIENTRY iluWave(ILfloat Angle);
#define iluColorsUsed iluColoursUsed
#define iluSwapColors iluSwapColours
#define iluReplaceColor iluReplaceColour
#define iluScaleColor iluScaleColour
#ifdef __cplusplus
}
#endif
#endif // __ILU_H__
#endif // __ilu_h_

View File

@ -0,0 +1,25 @@
//-----------------------------------------------------------------------------
//
// ImageLib Utility Sources
// Copyright (C) 2000-2002 by Denton Woods
// Last modified: 07/09/2002 <--Y2K Compliant! =]
//
// Filename: src-ILU/src/ilu_region.h
//
// Description: Creates an image region.
//
//-----------------------------------------------------------------------------
#ifndef ILU_REGION_H
#define ILU_REGION_H
typedef struct Edge
{
ILint yUpper;
ILfloat xIntersect, dxPerScan;
struct Edge *next;
} Edge;
#endif//ILU_REGION_H

View File

@ -0,0 +1,354 @@
//-----------------------------------------------------------------------------
//
// ImageLib Utility Toolkit Sources
// Copyright (C) 2000-2017 by Denton Woods
// Last modified: 03/07/2009
//
// Filename: IL/ilut.h
//
// Description: The main include file for ILUT
//
//-----------------------------------------------------------------------------
// Doxygen comment
/*! \file ilut.h
The main include file for ILUT
*/
#ifndef __ilut_h_
#ifndef __ILUT_H__
#define __ilut_h_
#define __ILUT_H__
#include <IL/il.h>
#include <IL/ilu.h>
//-----------------------------------------------------------------------------
// Defines
//-----------------------------------------------------------------------------
#define ILUT_VERSION_1_8_0 1
#define ILUT_VERSION 180
// Attribute Bits
#define ILUT_OPENGL_BIT 0x00000001
#define ILUT_D3D_BIT 0x00000002
#define ILUT_ALL_ATTRIB_BITS 0x000FFFFF
// Error Types
#define ILUT_INVALID_ENUM 0x0501
#define ILUT_OUT_OF_MEMORY 0x0502
#define ILUT_INVALID_VALUE 0x0505
#define ILUT_ILLEGAL_OPERATION 0x0506
#define ILUT_INVALID_PARAM 0x0509
#define ILUT_COULD_NOT_OPEN_FILE 0x050A
#define ILUT_STACK_OVERFLOW 0x050E
#define ILUT_STACK_UNDERFLOW 0x050F
#define ILUT_BAD_DIMENSIONS 0x0511
#define ILUT_NOT_SUPPORTED 0x0550
// State Definitions
#define ILUT_PALETTE_MODE 0x0600
#define ILUT_OPENGL_CONV 0x0610
#define ILUT_D3D_MIPLEVELS 0x0620
#define ILUT_MAXTEX_WIDTH 0x0630
#define ILUT_MAXTEX_HEIGHT 0x0631
#define ILUT_MAXTEX_DEPTH 0x0632
#define ILUT_GL_USE_S3TC 0x0634
#define ILUT_D3D_USE_DXTC 0x0634
#define ILUT_GL_GEN_S3TC 0x0635
#define ILUT_D3D_GEN_DXTC 0x0635
#define ILUT_S3TC_FORMAT 0x0705
#define ILUT_DXTC_FORMAT 0x0705
#define ILUT_D3D_POOL 0x0706
#define ILUT_D3D_ALPHA_KEY_COLOR 0x0707
#define ILUT_D3D_ALPHA_KEY_COLOUR 0x0707
#define ILUT_FORCE_INTEGER_FORMAT 0x0636
//This new state does automatic texture target detection
//if enabled. Currently, only cubemap detection is supported.
//if the current image is no cubemap, the 2d texture is chosen.
#define ILUT_GL_AUTODETECT_TEXTURE_TARGET 0x0807
// Values
#define ILUT_VERSION_NUM IL_VERSION_NUM
#define ILUT_VENDOR IL_VENDOR
// The different rendering api's...more to be added later?
#define ILUT_OPENGL 0
#define ILUT_ALLEGRO 1
#define ILUT_WIN32 2
#define ILUT_DIRECT3D8 3
#define ILUT_DIRECT3D9 4
#define ILUT_X11 5
#define ILUT_DIRECT3D10 6
#if (defined(_WIN32) || defined(_WIN64))
#if (defined(IL_USE_PRAGMA_LIBS)) && (!defined(_IL_BUILD_LIBRARY))
#if defined(_MSC_VER) || defined(__BORLANDC__)
#pragma comment(lib, "ILUT.lib")
#endif
#endif
#include <IL/ilut_config.h>
#endif
//////////////
// OpenGL
//////////////
#ifdef ILUT_USE_OPENGL
#if defined(_MSC_VER) || defined(_WIN32)
//#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif//_MSC_VER
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif//__APPLE__
#endif
#ifdef ILUT_USE_WIN32
//#define WIN32_LEAN_AND_MEAN
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#ifndef _WIN32_WCE
#include <crtdbg.h>
#endif
#endif
#include <windows.h>
#endif
//
// If we can avoid including these in all cases thing tend to break less
// and we can keep all of them defined as available
//
// Kriss
//
// ImageLib Utility Toolkit's Allegro Functions
#ifdef ILUT_USE_ALLEGRO
// #include <allegro.h>
#endif//ILUT_USE_ALLEGRO
#ifdef ILUT_USE_SDL
// #include <SDL.h>
#endif
#ifdef ILUT_USE_DIRECTX8
#include <d3d8.h>
#endif//ILUT_USE_DIRECTX9
#ifdef ILUT_USE_DIRECTX9
#include <d3d9.h>
#endif//ILUT_USE_DIRECTX9
#ifdef ILUT_USE_DIRECTX10
#pragma warning(push)
#pragma warning(disable : 4201) // Disables 'nonstandard extension used : nameless struct/union' warning
#include <rpcsal.h>
#include <sal.h>
#include <d3d10.h>
#pragma warning(pop)
#endif//ILUT_USE_DIRECTX10
#ifdef ILUT_USE_X11
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef ILUT_USE_XSHM
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
#endif//ILUT_USE_XSHM
#endif//ILUT_USE_X11
//-----------------------------------------------------------------------------
// Functions
//-----------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
// ImageLib Utility Toolkit Functions
ILAPI ILboolean ILAPIENTRY ilutDisable(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilutEnable(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilutGetBoolean(ILenum Mode);
ILAPI void ILAPIENTRY ilutGetBooleanv(ILenum Mode, ILboolean *Param);
ILAPI ILint ILAPIENTRY ilutGetInteger(ILenum Mode);
ILAPI void ILAPIENTRY ilutGetIntegerv(ILenum Mode, ILint *Param);
ILAPI ILstring ILAPIENTRY ilutGetString(ILenum StringName);
ILAPI void ILAPIENTRY ilutInit(void);
ILAPI ILboolean ILAPIENTRY ilutIsDisabled(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilutIsEnabled(ILenum Mode);
ILAPI void ILAPIENTRY ilutPopAttrib(void);
ILAPI void ILAPIENTRY ilutPushAttrib(ILuint Bits);
ILAPI void ILAPIENTRY ilutSetInteger(ILenum Mode, ILint Param);
ILAPI ILboolean ILAPIENTRY ilutRenderer(ILenum Renderer);
// ImageLib Utility Toolkit's OpenGL Functions
#ifdef ILUT_USE_OPENGL
ILAPI GLuint ILAPIENTRY ilutGLBindTexImage();
ILAPI GLuint ILAPIENTRY ilutGLBindMipmaps(void);
ILAPI ILboolean ILAPIENTRY ilutGLBuildMipmaps(void);
ILAPI GLuint ILAPIENTRY ilutGLLoadImage(ILstring FileName);
ILAPI ILboolean ILAPIENTRY ilutGLScreen(void);
ILAPI ILboolean ILAPIENTRY ilutGLScreenie(void);
ILAPI ILboolean ILAPIENTRY ilutGLSaveImage(ILstring FileName, GLuint TexID);
ILAPI ILboolean ILAPIENTRY ilutGLSubTex2D(GLuint TexID, ILuint XOff, ILuint YOff);
ILAPI ILboolean ILAPIENTRY ilutGLSubTex3D(GLuint TexID, ILuint XOff, ILuint YOff, ILuint ZOff);
ILAPI ILboolean ILAPIENTRY ilutGLSetTex2D(GLuint TexID);
ILAPI ILboolean ILAPIENTRY ilutGLSetTex3D(GLuint TexID);
ILAPI ILboolean ILAPIENTRY ilutGLTexImage(GLuint Level);
ILAPI ILboolean ILAPIENTRY ilutGLSubTex(GLuint TexID, ILuint XOff, ILuint YOff);
ILAPI ILboolean ILAPIENTRY ilutGLSetTex(GLuint TexID); // Deprecated - use ilutGLSetTex2D.
ILAPI ILboolean ILAPIENTRY ilutGLSubTex(GLuint TexID, ILuint XOff, ILuint YOff); // Use ilutGLSubTex2D.
#endif//ILUT_USE_OPENGL
// ImageLib Utility Toolkit's Allegro Functions
#ifdef ILUT_USE_ALLEGRO
#ifdef __cplusplus
extern "C" {
#endif
#include <allegro.h>
#ifdef __cplusplus
}
#endif
ILAPI BITMAP* ILAPIENTRY ilutAllegLoadImage(ILstring FileName);
ILAPI BITMAP* ILAPIENTRY ilutConvertToAlleg(PALETTE Pal);
#endif//ILUT_USE_ALLEGRO
// ImageLib Utility Toolkit's SDL Functions
#ifdef ILUT_USE_SDL
ILAPI struct SDL_Surface* ILAPIENTRY ilutConvertToSDLSurface(unsigned int flags);
ILAPI struct SDL_Surface* ILAPIENTRY ilutSDLSurfaceLoadImage(ILstring FileName);
ILAPI ILboolean ILAPIENTRY ilutSDLSurfaceFromBitmap(struct SDL_Surface *Bitmap);
#endif//ILUT_USE_SDL
// ImageLib Utility Toolkit's BeOS Functions
#ifdef ILUT_USE_BEOS
ILAPI BBitmap ILAPIENTRY ilutConvertToBBitmap(void);
#endif//ILUT_USE_BEOS
// ImageLib Utility Toolkit's Win32 GDI Functions
#ifdef ILUT_USE_WIN32
ILAPI HBITMAP ILAPIENTRY ilutConvertToHBitmap(HDC hDC);
ILAPI HBITMAP ILAPIENTRY ilutConvertSliceToHBitmap(HDC hDC, ILuint slice);
ILAPI void ILAPIENTRY ilutFreePaddedData(ILubyte *Data);
ILAPI void ILAPIENTRY ilutGetBmpInfo(BITMAPINFO *Info);
ILAPI HPALETTE ILAPIENTRY ilutGetHPal(void);
ILAPI ILubyte* ILAPIENTRY ilutGetPaddedData(void);
ILAPI ILboolean ILAPIENTRY ilutGetWinClipboard(void);
ILAPI ILboolean ILAPIENTRY ilutLoadResource(HINSTANCE hInst, ILint ID, ILstring ResourceType, ILenum Type);
ILAPI ILboolean ILAPIENTRY ilutSetHBitmap(HBITMAP Bitmap);
ILAPI ILboolean ILAPIENTRY ilutSetHPal(HPALETTE Pal);
ILAPI ILboolean ILAPIENTRY ilutSetWinClipboard(void);
ILAPI HBITMAP ILAPIENTRY ilutWinLoadImage(ILstring FileName, HDC hDC);
ILAPI ILboolean ILAPIENTRY ilutWinLoadUrl(ILstring Url);
ILAPI ILboolean ILAPIENTRY ilutWinPrint(ILuint XPos, ILuint YPos, ILuint Width, ILuint Height, HDC hDC);
ILAPI ILboolean ILAPIENTRY ilutWinSaveImage(ILstring FileName, HBITMAP Bitmap);
#endif//ILUT_USE_WIN32
// ImageLib Utility Toolkit's DirectX 8 Functions
#ifdef ILUT_USE_DIRECTX8
// ILAPI void ILAPIENTRY ilutD3D8MipFunc(ILuint NumLevels);
ILAPI struct IDirect3DTexture8* ILAPIENTRY ilutD3D8Texture(struct IDirect3DDevice8 *Device);
ILAPI struct IDirect3DVolumeTexture8* ILAPIENTRY ilutD3D8VolumeTexture(struct IDirect3DDevice8 *Device);
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DVolumeTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileInMemory(struct IDirect3DDevice8 *Device, void *Lump, ILuint Size, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileInMemory(struct IDirect3DDevice8 *Device, void *Lump, ILuint Size, struct IDirect3DVolumeTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DVolumeTexture8 **Texture);
// These two are not tested yet.
ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DVolumeTexture8 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D8LoadSurface(struct IDirect3DDevice8 *Device, struct IDirect3DSurface8 *Surface);
#endif//ILUT_USE_DIRECTX8
#ifdef ILUT_USE_DIRECTX9
#pragma warning(push)
#pragma warning(disable : 4115) // Disables 'named type definition in parentheses' warning
// ILAPI void ILAPIENTRY ilutD3D9MipFunc(ILuint NumLevels);
ILAPI struct IDirect3DTexture9* ILAPIENTRY ilutD3D9Texture (struct IDirect3DDevice9* Device);
ILAPI struct IDirect3DVolumeTexture9* ILAPIENTRY ilutD3D9VolumeTexture (struct IDirect3DDevice9* Device);
ILAPI struct IDirect3DCubeTexture9* ILAPIENTRY ilutD3D9CubeTexture (struct IDirect3DDevice9* Device);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFile(struct IDirect3DDevice9 *Device, ILconst_string FileName, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFileInMemory(struct IDirect3DDevice9 *Device, void *Lump, ILuint Size, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, ILconst_string SrcResource, struct IDirect3DCubeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFile(struct IDirect3DDevice9 *Device, ILconst_string FileName, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFile(struct IDirect3DDevice9 *Device, ILconst_string FileName, struct IDirect3DVolumeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileInMemory(struct IDirect3DDevice9 *Device, void *Lump, ILuint Size, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileInMemory(struct IDirect3DDevice9 *Device, void *Lump, ILuint Size, struct IDirect3DVolumeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DVolumeTexture9 **Texture);
// These three are not tested yet.
ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, ILconst_string SrcResource, struct IDirect3DTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, ILconst_string SrcResource, struct IDirect3DVolumeTexture9 **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D9LoadSurface(struct IDirect3DDevice9 *Device, struct IDirect3DSurface9 *Surface);
#pragma warning(pop)
#endif//ILUT_USE_DIRECTX9
#ifdef ILUT_USE_DIRECTX10
ILAPI ID3D10Texture2D* ILAPIENTRY ilutD3D10Texture(ID3D10Device *Device);
ILAPI ILboolean ILAPIENTRY ilutD3D10TexFromFile(ID3D10Device *Device, ILconst_string FileName, ID3D10Texture2D **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D10TexFromFileInMemory(ID3D10Device *Device, void *Lump, ILuint Size, ID3D10Texture2D **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D10TexFromResource(ID3D10Device *Device, HMODULE SrcModule, ILconst_string SrcResource, ID3D10Texture2D **Texture);
ILAPI ILboolean ILAPIENTRY ilutD3D10TexFromFileHandle(ID3D10Device *Device, ILHANDLE File, ID3D10Texture2D **Texture);
#endif//ILUT_USE_DIRECTX10
#ifdef ILUT_USE_X11
ILAPI XImage * ILAPIENTRY ilutXCreateImage( Display* );
ILAPI Pixmap ILAPIENTRY ilutXCreatePixmap( Display*,Drawable );
ILAPI XImage * ILAPIENTRY ilutXLoadImage( Display*,char* );
ILAPI Pixmap ILAPIENTRY ilutXLoadPixmap( Display*,Drawable,char* );
#ifdef ILUT_USE_XSHM
ILAPI XImage * ILAPIENTRY ilutXShmCreateImage( Display*,XShmSegmentInfo* );
ILAPI void ILAPIENTRY ilutXShmDestroyImage( Display*,XImage*,XShmSegmentInfo* );
ILAPI Pixmap ILAPIENTRY ilutXShmCreatePixmap( Display*,Drawable,XShmSegmentInfo* );
ILAPI void ILAPIENTRY ilutXShmFreePixmap( Display*,Pixmap,XShmSegmentInfo* );
ILAPI XImage * ILAPIENTRY ilutXShmLoadImage( Display*,char*,XShmSegmentInfo* );
ILAPI Pixmap ILAPIENTRY ilutXShmLoadPixmap( Display*,Drawable,char*,XShmSegmentInfo* );
#endif//ILUT_USE_XSHM
#endif//ILUT_USE_X11
#ifdef __cplusplus
}
#endif
#endif // __ILUT_H__
#endif // __ilut_h_

View File

@ -0,0 +1,26 @@
#ifndef __ILUT_CONFIG_H__
#define __ILUT_CONFIG_H__
//#define IL_USE_PRAGMA_LIBS
// Supported APIs (ILUT)
//
// sorry just
// cant get this one to work under windows
// have disabled for the now
//
// will look at it some more later
//
// Kriss
//
#undef ILUT_USE_ALLEGRO
#undef ILUT_USE_DIRECTX8
//#define ILUT_USE_DIRECTX9
//#define ILUT_USE_DIRECTX10
#define ILUT_USE_OPENGL
//#define ILUT_USE_SDL
#define ILUT_USE_WIN32
#endif//__ILUT_CONFIG_H__

View File

@ -0,0 +1,393 @@
/*
** $Id: luadevil.c,v 1.1 2007-02-12 21:03:04 darkyojimbo Exp $
** Lua stand-alone interpreter
** See Copyright Notice in lua.h
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define lua_c
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
static lua_State *globalL = NULL;
static const char *progname = LUA_PROGNAME;
static void lstop (lua_State *L, lua_Debug *ar) {
(void)ar; /* unused arg. */
lua_sethook(L, NULL, 0, 0);
luaL_error(L, "interrupted!");
}
static void laction (int i) {
signal(i, SIG_DFL); /* if another SIGINT happens before lstop,
terminate process (default action) */
lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
}
static void print_usage (void) {
fprintf(stderr,
"usage: %s [options] [script [args]].\n"
"Available options are:\n"
" -e stat execute string " LUA_QL("stat") "\n"
" -l name require library " LUA_QL("name") "\n"
" -i enter interactive mode after executing " LUA_QL("script") "\n"
" -v show version information\n"
" -- stop handling options\n"
" - execute stdin and stop handling options\n"
,
progname);
fflush(stderr);
}
static void l_message (const char *pname, const char *msg) {
if (pname) fprintf(stderr, "%s: ", pname);
fprintf(stderr, "%s\n", msg);
fflush(stderr);
}
static int report (lua_State *L, int status) {
if (status && !lua_isnil(L, -1)) {
const char *msg = lua_tostring(L, -1);
if (msg == NULL) msg = "(error object is not a string)";
l_message(progname, msg);
lua_pop(L, 1);
}
return status;
}
static int traceback (lua_State *L) {
lua_getfield(L, LUA_GLOBALSINDEX, "debug");
if (!lua_istable(L, -1)) {
lua_pop(L, 1);
return 1;
}
lua_getfield(L, -1, "traceback");
if (!lua_isfunction(L, -1)) {
lua_pop(L, 2);
return 1;
}
lua_pushvalue(L, 1); /* pass error message */
lua_pushinteger(L, 2); /* skip this function and traceback */
lua_call(L, 2, 1); /* call debug.traceback */
return 1;
}
static int docall (lua_State *L, int narg, int clear) {
int status;
int base = lua_gettop(L) - narg; /* function index */
lua_pushcfunction(L, traceback); /* push traceback function */
lua_insert(L, base); /* put it under chunk and args */
signal(SIGINT, laction);
status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);
signal(SIGINT, SIG_DFL);
lua_remove(L, base); /* remove traceback function */
/* force a complete garbage collection in case of errors */
if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0);
return status;
}
static void print_version (void) {
l_message(NULL, LUA_RELEASE " " LUA_COPYRIGHT);
}
static int getargs (lua_State *L, char **argv, int n) {
int narg;
int i;
int argc = 0;
while (argv[argc]) argc++; /* count total number of arguments */
narg = argc - (n + 1); /* number of arguments to the script */
luaL_checkstack(L, narg + 3, "too many arguments to script");
for (i=n+1; i < argc; i++)
lua_pushstring(L, argv[i]);
lua_createtable(L, narg, n + 1);
for (i=0; i < argc; i++) {
lua_pushstring(L, argv[i]);
lua_rawseti(L, -2, i - n);
}
return narg;
}
static int dofile (lua_State *L, const char *name) {
int status = luaL_loadfile(L, name) || docall(L, 0, 1);
return report(L, status);
}
static int dostring (lua_State *L, const char *s, const char *name) {
int status = luaL_loadbuffer(L, s, strlen(s), name) || docall(L, 0, 1);
return report(L, status);
}
static int dolibrary (lua_State *L, const char *name) {
lua_getglobal(L, "require");
lua_pushstring(L, name);
return report(L, lua_pcall(L, 1, 0, 0));
}
static const char *get_prompt (lua_State *L, int firstline) {
const char *p;
lua_getfield(L, LUA_GLOBALSINDEX, firstline ? "_PROMPT" : "_PROMPT2");
p = lua_tostring(L, -1);
if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2);
lua_pop(L, 1); /* remove global */
return p;
}
static int incomplete (lua_State *L, int status) {
if (status == LUA_ERRSYNTAX) {
size_t lmsg;
const char *msg = lua_tolstring(L, -1, &lmsg);
const char *tp = msg + lmsg - (sizeof(LUA_QL("<eof>")) - 1);
if (strstr(msg, LUA_QL("<eof>")) == tp) {
lua_pop(L, 1);
return 1;
}
}
return 0; /* else... */
}
static int pushline (lua_State *L, int firstline) {
char buffer[LUA_MAXINPUT];
char *b = buffer;
size_t l;
const char *prmt = get_prompt(L, firstline);
if (lua_readline(L, b, prmt) == 0)
return 0; /* no input */
l = strlen(b);
if (l > 0 && b[l-1] == '\n') /* line ends with newline? */
b[l-1] = '\0'; /* remove it */
if (firstline && b[0] == '=') /* first line starts with `=' ? */
lua_pushfstring(L, "return %s", b+1); /* change it to `return' */
else
lua_pushstring(L, b);
lua_freeline(L, b);
return 1;
}
static int loadline (lua_State *L) {
int status;
lua_settop(L, 0);
if (!pushline(L, 1))
return -1; /* no input */
for (;;) { /* repeat until gets a complete line */
status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), "=stdin");
if (!incomplete(L, status)) break; /* cannot try to add lines? */
if (!pushline(L, 0)) /* no more input? */
return -1;
lua_pushliteral(L, "\n"); /* add a new line... */
lua_insert(L, -2); /* ...between the two lines */
lua_concat(L, 3); /* join them */
}
lua_saveline(L, 1);
lua_remove(L, 1); /* remove line */
return status;
}
static void dotty (lua_State *L) {
int status;
const char *oldprogname = progname;
progname = NULL;
while ((status = loadline(L)) != -1) {
if (status == 0) status = docall(L, 0, 0);
report(L, status);
if (status == 0 && lua_gettop(L) > 0) { /* any result to print? */
lua_getglobal(L, "print");
lua_insert(L, 1);
if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0)
l_message(progname, lua_pushfstring(L,
"error calling " LUA_QL("print") " (%s)",
lua_tostring(L, -1)));
}
}
lua_settop(L, 0); /* clear stack */
fputs("\n", stdout);
fflush(stdout);
progname = oldprogname;
}
static int handle_script (lua_State *L, char **argv, int n) {
int status;
const char *fname;
int narg = getargs(L, argv, n); /* collect arguments */
lua_setglobal(L, "arg");
fname = argv[n];
if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0)
fname = NULL; /* stdin */
status = luaL_loadfile(L, fname);
lua_insert(L, -(narg+1));
if (status == 0)
status = docall(L, narg, 0);
else
lua_pop(L, narg);
return report(L, status);
}
/* check that argument has no extra characters at the end */
#define notail(x) {if ((x)[2] != '\0') return -1;}
static int collectargs (char **argv, int *pi, int *pv, int *pe) {
int i;
for (i = 1; argv[i] != NULL; i++) {
if (argv[i][0] != '-') /* not an option? */
return i;
switch (argv[i][1]) { /* option */
case '-':
notail(argv[i]);
return (argv[i+1] != NULL ? i+1 : 0);
case '\0':
return i;
case 'i':
notail(argv[i]);
*pi = 1; /* go through */
case 'v':
notail(argv[i]);
*pv = 1;
break;
case 'e':
*pe = 1; /* go through */
case 'l':
if (argv[i][2] == '\0') {
i++;
if (argv[i] == NULL) return -1;
}
break;
default: return -1; /* invalid option */
}
}
return 0;
}
static int runargs (lua_State *L, char **argv, int n) {
int i;
for (i = 1; i < n; i++) {
if (argv[i] == NULL) continue;
lua_assert(argv[i][0] == '-');
switch (argv[i][1]) { /* option */
case 'e': {
const char *chunk = argv[i] + 2;
if (*chunk == '\0') chunk = argv[++i];
lua_assert(chunk != NULL);
if (dostring(L, chunk, "=(command line)") != 0)
return 1;
break;
}
case 'l': {
const char *filename = argv[i] + 2;
if (*filename == '\0') filename = argv[++i];
lua_assert(filename != NULL);
if (dolibrary(L, filename))
return 1; /* stop if file fails */
break;
}
default: break;
}
}
return 0;
}
static int handle_luainit (lua_State *L) {
const char *init = getenv(LUA_INIT);
if (init == NULL) return 0; /* status OK */
else if (init[0] == '@')
return dofile(L, init+1);
else
return dostring(L, init, "=" LUA_INIT);
}
struct Smain {
int argc;
char **argv;
int status;
};
static int pmain (lua_State *L) {
struct Smain *s = (struct Smain *)lua_touserdata(L, 1);
char **argv = s->argv;
int script;
int has_i = 0, has_v = 0, has_e = 0;
globalL = L;
if (argv[0] && argv[0][0]) progname = argv[0];
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(L); /* open libraries */
lua_gc(L, LUA_GCRESTART, 0);
s->status = handle_luainit(L);
if (s->status != 0) return 0;
script = collectargs(argv, &has_i, &has_v, &has_e);
if (script < 0) { /* invalid args? */
print_usage();
s->status = 1;
return 0;
}
if (has_v) print_version();
s->status = runargs(L, argv, (script > 0) ? script : s->argc);
if (s->status != 0) return 0;
if (script)
s->status = handle_script(L, argv, script);
if (s->status != 0) return 0;
if (has_i)
dotty(L);
else if (script == 0 && !has_e && !has_v) {
if (lua_stdin_is_tty()) {
print_version();
dotty(L);
}
else dofile(L, NULL); /* executes stdin as a file */
}
return 0;
}
int main (int argc, char **argv) {
int status;
struct Smain s;
lua_State *L = lua_open(); /* create state */
printf("DevIL embedded lua interpreter\n");
//@TODO: Where the heck is this defined?
//Devil_Init(L);
if (L == NULL) {
l_message(argv[0], "cannot create state: not enough memory");
return EXIT_FAILURE;
}
s.argc = argc;
s.argv = argv;
status = lua_cpcall(L, &pmain, &s);
report(L, status);
lua_close(L);
return (status || s.status) ? EXIT_FAILURE : EXIT_SUCCESS;
}

View File

@ -0,0 +1 @@
timestamp

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

73
SQCSim2021/external/glew210/LICENSE.txt vendored Normal file
View File

@ -0,0 +1,73 @@
The OpenGL Extension Wrangler Library
Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
Copyright (C) 2002, Lev Povalahev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
Mesa 3-D graphics library
Version: 7.0
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2007 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.

352
SQCSim2021/external/glew210/Makefile vendored Normal file
View File

@ -0,0 +1,352 @@
#!gmake
## The OpenGL Extension Wrangler Library
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002, Lev Povalahev
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
## * Redistributions of source code must retain the above copyright notice,
## this list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright notice,
## this list of conditions and the following disclaimer in the documentation
## and/or other materials provided with the distribution.
## * The name of the author may be used to endorse or promote products
## derived from this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
## THE POSSIBILITY OF SUCH DAMAGE.
include config/version
SHELL = /bin/sh
SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
ifeq ($(SYSTEM.SUPPORTED), 1)
include config/Makefile.$(SYSTEM)
else
$(error "Platform '$(SYSTEM)' not supported")
endif
GLEW_PREFIX ?= /usr
GLEW_DEST ?= /usr
BINDIR ?= $(GLEW_DEST)/bin
LIBDIR ?= $(GLEW_DEST)/lib
INCDIR ?= $(GLEW_DEST)/include/GL
PKGDIR ?= $(GLEW_DEST)/lib/pkgconfig
ifneq ($(GLEW_NO_GLU), -DGLEW_NO_GLU)
LIBGLU = glu
endif
DIST_NAME ?= glew-$(GLEW_VERSION)
DIST_SRC_ZIP ?= $(shell pwd)/$(DIST_NAME).zip
DIST_SRC_TGZ ?= $(shell pwd)/$(DIST_NAME).tgz
DIST_WIN32 ?= $(shell pwd)/$(DIST_NAME)-win32.zip
DIST_DIR := $(shell mktemp -d /tmp/glew.XXXXXX)/$(DIST_NAME)
# To disable stripping of linked binaries either:
# - use STRIP= on gmake command-line
# - edit this makefile to set STRIP to the empty string
# (Note: STRIP does not affect the strip in the install step)
#
# To disable symlinks:
# - use LN= on gmake command-line
AR ?= ar
ARFLAGS ?= cr
INSTALL ?= install
STRIP ?= strip
RM ?= rm -f
LN ?= ln -sf
UNIX2DOS ?= unix2dos -q
DOS2UNIX ?= dos2unix -q
ifneq (,$(filter debug,$(MAKECMDGOALS)))
OPT = -g
else
OPT = $(POPT)
endif
INCLUDE = -Iinclude
CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
all debug: glew.lib glew.bin
# GLEW shared and static libraries
LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
LIB.LIBS := $(GL_LDFLAGS)
LIB.SRCS := src/glew.c
LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
LIB.OBJS := $(addprefix tmp/$(SYSTEM)/default/static/,$(LIB.SRCS.NAMES))
LIB.OBJS := $(LIB.OBJS:.c=.o)
LIB.SOBJS := $(addprefix tmp/$(SYSTEM)/default/shared/,$(LIB.SRCS.NAMES))
LIB.SOBJS := $(LIB.SOBJS:.c=.o)
glew.lib: glew.lib.shared glew.lib.static
glew.lib.shared: lib lib/$(LIB.SHARED) glew.pc
glew.lib.static: lib lib/$(LIB.STATIC) glew.pc
.PHONY: glew.lib glew.lib.shared glew.lib.static
lib:
mkdir lib
lib/$(LIB.STATIC): $(LIB.OBJS)
ifneq ($(AR),)
$(AR) $(ARFLAGS) $@ $^
else ifneq ($(LIBTOOL),)
$(LIBTOOL) $@ $^
endif
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
lib/$(LIB.SHARED): $(LIB.SOBJS)
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
ifneq ($(LN),)
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
endif
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
tmp/$(SYSTEM)/default/static/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
@mkdir -p $(dir $@)
$(CC) -DGLEW_NO_GLU -DGLEW_STATIC $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
tmp/$(SYSTEM)/default/shared/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
@mkdir -p $(dir $@)
$(CC) -DGLEW_NO_GLU -DGLEW_BUILD $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
# Force re-write of glew.pc, GLEW_DEST can vary
.PHONY: glew.pc
glew.pc: glew.pc.in
sed \
-e "s|@prefix@|$(GLEW_PREFIX)|g" \
-e "s|@libdir@|$(LIBDIR)|g" \
-e "s|@exec_prefix@|$(BINDIR)|g" \
-e "s|@includedir@|$(INCDIR)|g" \
-e "s|@version@|$(GLEW_VERSION)|g" \
-e "s|@cflags@||g" \
-e "s|@libname@|$(NAME)|g" \
-e "s|@requireslib@|$(LIBGLU)|g" \
< $< > $@
# GLEW utility programs
BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
GLEWINFO.BIN := glewinfo$(BIN.SUFFIX)
GLEWINFO.BIN.SRC := src/glewinfo.c
GLEWINFO.BIN.OBJ := $(addprefix tmp/$(SYSTEM)/default/shared/,$(notdir $(GLEWINFO.BIN.SRC)))
GLEWINFO.BIN.OBJ := $(GLEWINFO.BIN.OBJ:.c=.o)
VISUALINFO.BIN := visualinfo$(BIN.SUFFIX)
VISUALINFO.BIN.SRC := src/visualinfo.c
VISUALINFO.BIN.OBJ := $(addprefix tmp/$(SYSTEM)/default/shared/,$(notdir $(VISUALINFO.BIN.SRC)))
VISUALINFO.BIN.OBJ := $(VISUALINFO.BIN.OBJ:.c=.o)
# Don't build glewinfo or visualinfo for NaCL, yet.
ifneq ($(filter nacl%,$(SYSTEM)),)
glew.bin: glew.lib bin
else
glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)
endif
bin:
mkdir bin
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
$(GLEWINFO.BIN.OBJ): $(GLEWINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
@mkdir -p $(dir $@)
$(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
$(VISUALINFO.BIN.OBJ): $(VISUALINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
@mkdir -p $(dir $@)
$(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
# Install targets
install.all: install install.bin
install: install.include install.lib install.pkgconfig
install.lib: glew.lib
$(INSTALL) -d -m 0755 "$(DESTDIR)$(LIBDIR)"
# runtime
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)"
$(INSTALL) -m 0755 lib/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/"
else
$(INSTALL) -m 0644 lib/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/"
endif
ifneq ($(LN),)
$(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)"
endif
# development files
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -m 0644 lib/$(LIB.DEVLNK) "$(DESTDIR)$(LIBDIR)/"
endif
ifneq ($(LN),)
$(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.DEVLNK)"
endif
$(INSTALL) -m 0644 lib/$(LIB.STATIC) "$(DESTDIR)$(LIBDIR)/"
install.bin: glew.bin
$(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)"
$(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/"
install.include:
$(INSTALL) -d -m 0755 "$(DESTDIR)$(INCDIR)"
$(INSTALL) -m 0644 include/GL/wglew.h "$(DESTDIR)$(INCDIR)/"
$(INSTALL) -m 0644 include/GL/glew.h "$(DESTDIR)$(INCDIR)/"
$(INSTALL) -m 0644 include/GL/glxew.h "$(DESTDIR)$(INCDIR)/"
install.pkgconfig: glew.pc
$(INSTALL) -d -m 0755 "$(DESTDIR)$(PKGDIR)"
$(INSTALL) -d -m 0755 "$(DESTDIR)$(PKGDIR)"
$(INSTALL) -m 0644 glew.pc "$(DESTDIR)$(PKGDIR)/"
uninstall:
$(RM) "$(DESTDIR)$(INCDIR)/wglew.h"
$(RM) "$(DESTDIR)$(INCDIR)/glew.h"
$(RM) "$(DESTDIR)$(INCDIR)/glxew.h"
$(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.DEVLNK)"
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(RM) "$(DESTDIR)$(BINDIR)/$(LIB.SHARED)"
else
$(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)"
$(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.SHARED)"
endif
$(RM) "$(DESTDIR)$(LIBDIR)/$(LIB.STATIC)"
$(RM) "$(DESTDIR)$(BINDIR)/$(GLEWINFO.BIN)" "$(DESTDIR)$(BINDIR)/$(VISUALINFO.BIN)"
clean:
$(RM) -r tmp/
$(RM) -r lib/
$(RM) -r bin/
$(RM) glew.pc
distclean: clean
find . -name \*~ | xargs $(RM)
find . -name .\*.sw\? | xargs $(RM)
# Distributions
dist-win32:
$(RM) -r $(DIST_DIR)
mkdir -p $(DIST_DIR)
cp -a include $(DIST_DIR)
cp -a doc $(DIST_DIR)
cp -a *.txt $(DIST_DIR)
cp -a bin $(DIST_DIR)
cp -a lib $(DIST_DIR)
$(RM) -f $(DIST_DIR)/bin/*/*/*.pdb $(DIST_DIR)/bin/*/*/*.exp
$(RM) -f $(DIST_DIR)/bin/*/*/glewinfo-*.exe $(DIST_DIR)/bin/*/*/visualinfo-*.exe
$(RM) -f $(DIST_DIR)/lib/*/*/*.pdb $(DIST_DIR)/lib/*/*/*.exp
$(UNIX2DOS) $(DIST_DIR)/include/GL/*.h
$(UNIX2DOS) $(DIST_DIR)/doc/*.txt
$(UNIX2DOS) $(DIST_DIR)/doc/*.html
$(UNIX2DOS) $(DIST_DIR)/*.txt
rm -f $(DIST_WIN32)
cd $(DIST_DIR)/.. && zip -rq9 $(DIST_WIN32) $(DIST_NAME)
$(RM) -r $(DIST_DIR)
dist-src:
$(RM) -r $(DIST_DIR)
mkdir -p $(DIST_DIR)
mkdir -p $(DIST_DIR)/bin
mkdir -p $(DIST_DIR)/lib
cp -a auto $(DIST_DIR)
$(RM) -Rf $(DIST_DIR)/auto/registry
cp -a build $(DIST_DIR)
cp -a config $(DIST_DIR)
cp -a src $(DIST_DIR)
cp -a doc $(DIST_DIR)
cp -a include $(DIST_DIR)
cp -a *.md $(DIST_DIR)
cp -a *.txt $(DIST_DIR)
cp -a Makefile $(DIST_DIR)
cp -a glew.pc.in $(DIST_DIR)
find $(DIST_DIR) -name '*.o' | xargs $(RM) -r
find $(DIST_DIR) -name '*~' | xargs $(RM) -r
find $(DIST_DIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
find $(DIST_DIR) -name .svn | xargs $(RM) -r
find $(DIST_DIR) -name "*.patch" | xargs $(RM) -r
$(DOS2UNIX) $(DIST_DIR)/Makefile
$(DOS2UNIX) $(DIST_DIR)/auto/Makefile
$(DOS2UNIX) $(DIST_DIR)/config/*
$(UNIX2DOS) $(DIST_DIR)/auto/core/*
$(UNIX2DOS) $(DIST_DIR)/auto/extensions/*
find $(DIST_DIR) -name '*.h' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.c' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.md' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.txt' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.html' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.css' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.sh' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.pl' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name 'Makefile' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.in' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.pm' | xargs $(UNIX2DOS)
find $(DIST_DIR) -name '*.rc' | xargs $(UNIX2DOS)
rm -f $(DIST_SRC_ZIP)
cd $(DIST_DIR)/.. && zip -rq9 $(DIST_SRC_ZIP) $(DIST_NAME)
$(DOS2UNIX) $(DIST_DIR)/Makefile
$(DOS2UNIX) $(DIST_DIR)/auto/Makefile
$(DOS2UNIX) $(DIST_DIR)/config/*
$(DOS2UNIX) $(DIST_DIR)/auto/core/*
$(DOS2UNIX) $(DIST_DIR)/auto/extensions/*
find $(DIST_DIR) -name '*.h' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.c' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.md' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.txt' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.html' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.css' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.sh' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.pl' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name 'Makefile' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.in' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.pm' | xargs $(DOS2UNIX)
find $(DIST_DIR) -name '*.rc' | xargs $(DOS2UNIX)
rm -f $(DIST_SRC_TGZ)
cd $(DIST_DIR)/.. && env GZIP=-9 tar czf $(DIST_SRC_TGZ) $(DIST_NAME)
$(RM) -r $(DIST_DIR)
extensions:
$(MAKE) -C auto
.PHONY: clean distclean tardist dist-win32 dist-src

190
SQCSim2021/external/glew210/README.md vendored Normal file
View File

@ -0,0 +1,190 @@
# GLEW - The OpenGL Extension Wrangler Library
![](http://glew.sourceforge.net/glew.png)
http://glew.sourceforge.net/
https://github.com/nigels-com/glew
[![Build Status](https://travis-ci.org/nigels-com/glew.svg?branch=master)](https://travis-ci.org/nigels-com/glew)
[![Gitter](https://badges.gitter.im/nigels-com/glew.svg)](https://gitter.im/nigels-com/glew?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Download](https://img.shields.io/sourceforge/dm/glew.svg)](https://sourceforge.net/projects/glew/files/latest/download)
## Downloads
Current release is [2.1.0](https://sourceforge.net/projects/glew/files/glew/2.1.0/).
[(Change Log)](http://glew.sourceforge.net/log.html)
Sources available as
[ZIP](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip/download) or
[TGZ](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download).
Windows binaries for [32-bit and 64-bit](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download).
### Recent snapshots
Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases.
## Build
It is highly recommended to build from a tgz or zip release snapshot.
The code generation workflow is a complex brew of gnu make, perl and python, that works best on Linux or Mac.
For most end-users of GLEW the official releases are the best choice, with first class support.
### Linux and Mac
#### Using GNU Make
##### Install build tools
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev`
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel`
##### Build
$ make
$ sudo make install
$ make clean
Targets: `all, glew.lib (sub-targets: glew.lib.shared, glew.lib.static), glew.bin, clean, install, uninstall`
Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=`
_Note: may need to make **auto** folder_
#### Using cmake
*CMake 2.8.12 or higher is required.*
##### Install build tools
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev cmake`
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake`
##### Build
$ cd build
$ cmake ./cmake
$ make -j4
| Target | Description |
| ---------- | ----------- |
| glew | Build the glew shared library. |
| glew_s | Build the glew static library. |
| glewinfo | Build the `glewinfo` executable (requires `BUILD_UTILS` to be `ON`). |
| visualinfo | Build the `visualinfo` executable (requires `BUILD_UTILS` to be `ON`). |
| install | Install all enabled targets into `CMAKE_INSTALL_PREFIX`. |
| clean | Clean up build artifacts. |
| all | Build all enabled targets (default target). |
| Variables | Description |
| --------------- | ----------- |
| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. |
| GLEW_REGAL | Build in Regal mode. |
| GLEW_OSMESA | Build in off-screen Mesa mode. |
| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. |
### Windows
#### Visual Studio
Use the provided Visual Studio project file in build/vc12/
Projects for vc6 and vc10 are also provided
#### MSYS/Mingw
Available from [Mingw](http://www.mingw.org/)
Requirements: bash, make, gcc
$ mingw32-make
$ mingw32-make install
$ mingw32-make install.all
Alternative toolchain: `SYSTEM=mingw-win32`
#### MSYS2/Mingw-w64
Available from [Msys2](http://msys2.github.io/) and/or [Mingw-w64](http://mingw-w64.org/)
Requirements: bash, make, gcc
$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
$ make
$ make install
$ make install.all
Alternative toolchain: `SYSTEM=msys, SYSTEM=msys-win32, SYSTEM=msys-win64`
## glewinfo
`glewinfo` is a command-line tool useful for inspecting the capabilities of an
OpenGL implementation and GLEW support for that. Please include `glewinfo.txt`
with bug reports, as appropriate.
---------------------------
GLEW Extension Info
---------------------------
GLEW version 2.0.0
Reporting capabilities of pixelformat 3
Running on a Intel(R) HD Graphics 3000 from Intel
OpenGL version 3.1.0 - Build 9.17.10.4229 is supported
GL_VERSION_1_1: OK
---------------
GL_VERSION_1_2: OK
---------------
glCopyTexSubImage3D: OK
glDrawRangeElements: OK
glTexImage3D: OK
glTexSubImage3D: OK
...
## Code Generation
A Unix or Mac environment is needed for building GLEW from scratch to
include new extensions, or customize the code generation. The extension
data is regenerated from the top level source directory with:
make extensions
An alternative to generating the GLEW sources from scratch is to
download a pre-generated (unsupported) snapshot:
https://sourceforge.net/projects/glew/files/glew/snapshots/
Travis-built snapshots are also available:
https://glew.s3.amazonaws.com/index.html
## Authors
GLEW is currently maintained by [Nigel Stewart](https://github.com/nigels-com)
with bug fixes, new OpenGL extension support and new releases.
GLEW was developed by [Milan Ikits](http://www.cs.utah.edu/~ikits/)
and [Marcelo Magallon](http://wwwvis.informatik.uni-stuttgart.de/~magallon/).
Aaron Lefohn, Joe Kniss, and Chris Wyman were the first users and also
assisted with the design and debugging process.
The acronym GLEW originates from Aaron Lefohn.
Pasi K&auml;rkk&auml;inen identified and fixed several problems with
GLX and SDL. Nate Robins created the `wglinfo` utility, to
which modifications were made by Michael Wimmer.
## Copyright and Licensing
GLEW is originally derived from the EXTGL project by Lev Povalahev.
The source code is licensed under the
[Modified BSD License](http://glew.sourceforge.net/glew.txt), the
[Mesa 3-D License](http://glew.sourceforge.net/mesa.txt) (MIT) and the
[Khronos License](http://glew.sourceforge.net/khronos.txt) (MIT).
The automatic code generation scripts are released under the
[GNU GPL](http://glew.sourceforge.net/gpl.txt).

View File

@ -0,0 +1,357 @@
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
include ../config/version
#GLEW_SPLIT_SOURCE = yes
SHELL = bash
PYTHON ?= python
### Use git repository for GL extension specifications
GIT_CLONE ?= git clone --branch glew https://github.com/nigels-com/glfixes.git
###
### Conventional desktop OpenGL settings
###
REGISTRY = registry/gl/specs
EXT = extensions/gl
FILTER = filter_gl_ext.sh
CORE = core/gl
REGISTRY_URL = http://www.opengl.org/registry/
###
### Experimental OpenGL ES settings
###
# REGISTRY = registry/gles
# EXT = extensions/gles
# FILTER = filter_gles_ext.sh
# CORE = core/gles
# REGISTRY_URL = http://www.khronos.org/registry/gles/
BIN = bin
SRC = src
BLACKLIST = blacklist
GL_CORE_SPEC := $(CORE)/GL_VERSION*
GLX_CORE_SPEC := $(CORE)/GLX_VERSION*
EGL_CORE_SPEC := $(CORE)/EGL_VERSION*
ifeq (custom,$(MAKECMDGOALS))
#GL_CORE_SPEC := $(shell grep GL_VERSION custom.txt | perl -pi -e "s=^=$(CORE)/=g;")
GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | perl -pi -e "s=^=$(EXT)/=g;")
WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | perl -pi -e "s=^=$(EXT)/=g;")
#GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | perl -pi -e "s=^=$(CORE)/=g;")
GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | perl -pi -e "s=^=$(EXT)/=g;")
EGL_EXT_SPEC := $(shell grep "^[ \t]*EGL_" custom.txt | grep -v EGL_VERSION | perl -pi -e "s=^=$(EXT)/=g;")
else
GL_EXT_SPEC := $(EXT)/GL_*
WGL_EXT_SPEC := $(EXT)/WGL_*
GLX_EXT_SPEC := $(EXT)/GLX_*
EGL_EXT_SPEC := $(EXT)/EGL_*
endif
PARSE_SPEC = parse_spec.pl
SYSTEM = $(strip $(shell uname -s))
TOP = ..
I.DEST = $(TOP)/include/GL
S.DEST = $(TOP)/src
D.DEST = $(TOP)/doc
B.DEST = $(TOP)/build
I.TARGETS = \
$(I.DEST)/glew.h \
$(I.DEST)/wglew.h \
$(I.DEST)/glxew.h \
$(I.DEST)/eglew.h
ifeq (yes,$(GLEW_SPLIT_SOURCE))
S.TARGETS = \
$(S.DEST)/glew_def.c \
$(S.DEST)/glew_init.c \
$(S.DEST)/glew_str.c \
$(S.DEST)/glewinfo.c
else
S.TARGETS = \
$(S.DEST)/glew.c \
$(S.DEST)/glewinfo.c
endif
D.TARGETS = \
$(D.DEST)/index.html \
$(D.DEST)/install.html \
$(D.DEST)/basic.html \
$(D.DEST)/advanced.html \
$(D.DEST)/build.html \
$(D.DEST)/credits.html \
$(D.DEST)/log.html \
$(D.DEST)/glew.html \
$(D.DEST)/wglew.html \
$(D.DEST)/glxew.html
B.TARGETS = \
$(B.DEST)/glew.rc \
$(B.DEST)/glewinfo.rc \
$(B.DEST)/visualinfo.rc
all custom: $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS)
registry: $(REGISTRY)/.dummy
ext: $(EXT)/.dummy
$(REGISTRY)/.dummy:
@echo "--------------------------------------------------------------------"
@echo "Downloading registry"
@echo "--------------------------------------------------------------------"
$(GIT_CLONE) registry
touch $@
$(EXT)/.dummy: $(REGISTRY)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating descriptors"
@echo "--------------------------------------------------------------------"
rm -rf $(EXT)
$(BIN)/update_ext.sh $(EXT) $(REGISTRY) $(BLACKLIST)
$(PYTHON) $(BIN)/parse_xml.py registry/xml/egl.xml --core core/gl --extensions extensions/gl
$(BIN)/$(FILTER) $(EXT)
ifeq ($(patsubst Darwin%,Darwin,$(SYSTEM)), Darwin)
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
xargs -J % cp % $(EXT)
else
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
xargs cp --target-directory=$(EXT)
endif
touch $@
$(I.DEST)/glew.h: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating glew.h"
@echo "--------------------------------------------------------------------"
test -d $(I.DEST) || mkdir -p $(I.DEST)
cp -f $(SRC)/glew_license.h $@
cat $(SRC)/mesa_license.h >> $@
cat $(SRC)/khronos_license.h >> $@
cat $(SRC)/glew_head.h >> $@
$(BIN)/make_header.pl GLAPIENTRY GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_header.pl GLAPIENTRY GL $(GL_EXT_SPEC) >> $@
echo -e "/* ------------------------------------------------------------------------- */\n\n" >> $@
$(BIN)/make_struct_fun.pl GLEW_FUN_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
$(BIN)/make_struct_var.pl GLEW_VAR_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
perl -e "s/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/" -pi $@
cat $(SRC)/glew_tail.h >> $@
perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
rm -f $@.bak
$(I.DEST)/wglew.h: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating wglew.h"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/glew_license.h $@
cat $(SRC)/khronos_license.h >> $@
cat $(SRC)/wglew_head.h >> $@
$(BIN)/make_header.pl WINAPI WGL $(WGL_EXT_SPEC) >> $@
cat $(SRC)/wglew_mid.h >> $@
$(BIN)/make_struct_fun.pl WGLEW_FUN_EXPORT $(WGL_EXT_SPEC) >> $@
$(BIN)/make_struct_var.pl WGLEW_VAR_EXPORT $(WGL_EXT_SPEC) >> $@
cat $(SRC)/wglew_tail.h >> $@
$(I.DEST)/glxew.h: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating glxew.h"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/glew_license.h $@
cat $(SRC)/mesa_license.h >> $@
cat $(SRC)/khronos_license.h >> $@
cat $(SRC)/glxew_head.h >> $@
$(BIN)/make_header.pl "" GLX $(GLX_CORE_SPEC) >> $@
$(BIN)/make_header.pl "" GLX $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glxew_mid.h >> $@
$(BIN)/make_struct_fun.pl GLXEW_FUN_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
$(BIN)/make_struct_var.pl GLXEW_VAR_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
perl -e "s/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/" -pi $@
cat $(SRC)/glxew_tail.h >> $@
$(I.DEST)/eglew.h: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating eglew.h"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/glew_license.h $@
cat $(SRC)/mesa_license.h >> $@
cat $(SRC)/khronos_license.h >> $@
cat $(SRC)/eglew_head.h >> $@
$(BIN)/make_header.pl "" EGL $(EGL_CORE_SPEC) >> $@
$(BIN)/make_header.pl "" EGL $(EGL_EXT_SPEC) >> $@
cat $(SRC)/eglew_mid.h >> $@
$(BIN)/make_struct_fun.pl EGLEW_FUN_EXPORT $(EGL_CORE_SPEC) $(EGL_EXT_SPEC) >> $@
$(BIN)/make_struct_var.pl EGLEW_VAR_EXPORT $(EGL_CORE_SPEC) $(EGL_EXT_SPEC) >> $@
cat $(SRC)/eglew_tail.h >> $@
$(S.DEST)/glew.c: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating glew.c"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/glew_license.h $@
cat $(SRC)/glew_head.c >> $@
$(BIN)/make_def_fun.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_def_fun.pl GL $(GL_EXT_SPEC) >> $@
echo -e "\nGLboolean __GLEW_VERSION_1_1 = GL_FALSE;" >> $@
$(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@
echo -e "\nstatic const char * _glewExtensionLookup[] = {" >> $@;
$(BIN)/make_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
echo -e " NULL\n};\n" >> $@;
$(BIN)/make_enable_index.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
$(BIN)/make_initd.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_initd.pl GL $(GL_EXT_SPEC) >> $@
echo -e "" >> $@;
$(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@
$(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@
cat $(SRC)/glew_init_gl.c >> $@
$(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
$(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
$(BIN)/make_list2.pl $(GL_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}\n" >> $@
echo -e "\n#if defined(GLEW_OSMESA)" >> $@
echo -e "\n#elif defined(GLEW_EGL)" >> $@
$(BIN)/make_def_fun.pl EGL $(EGL_CORE_SPEC) >> $@
$(BIN)/make_def_fun.pl EGL $(EGL_EXT_SPEC) >> $@
$(BIN)/make_def_var.pl EGL $(EGL_CORE_SPEC) >> $@
$(BIN)/make_def_var.pl EGL $(EGL_EXT_SPEC) >> $@
$(BIN)/make_init.pl EGL $(EGL_CORE_SPEC) >> $@
$(BIN)/make_init.pl EGL $(EGL_EXT_SPEC) >> $@
cat $(SRC)/glew_init_egl.c >> $@
$(BIN)/make_list.pl $(EGL_CORE_SPEC) >> $@
$(BIN)/make_list.pl $(EGL_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}" >> $@
echo -e "\n#elif defined(_WIN32)" >> $@
$(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@
$(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@
$(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@
cat $(SRC)/glew_init_wgl.c >> $@
$(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}" >> $@;
echo -e "\n#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@
$(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@
$(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@
echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@
echo -e "GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;" >> $@
$(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@
$(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@
$(BIN)/make_init.pl GLX $(GLX_CORE_SPEC) >> $@
$(BIN)/make_init.pl GLX $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glew_init_glx.c >> $@
$(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@
$(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@
echo -e "\n return GLEW_OK;\n}" >> $@
echo -e "\n#endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */\n" >> $@;
cat $(SRC)/glew_init_tail.c >> $@
cat $(SRC)/glew_str_head.c >> $@
$(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@
cat $(SRC)/glew_str_wgl.c >> $@
$(BIN)/make_str.pl $(WGL_EXT_SPEC) >> $@
cat $(SRC)/glew_str_glx.c >> $@
$(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glew_str_egl.c >> $@
$(BIN)/make_str.pl $(EGL_CORE_SPEC) $(EGL_EXT_SPEC) >> $@
cat $(SRC)/glew_str_tail.c >> $@
perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@
perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(); _glewInit_GL_ARB_vertex_program(); }/g" -pi $@
perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@
rm -f $@.bak
$(S.DEST)/glewinfo.c: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating glewinfo.c"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/glew_license.h $@
cat $(SRC)/glewinfo_head.c >> $@
$(BIN)/make_info.pl $(GL_CORE_SPEC) >> $@
$(BIN)/make_info.pl $(GL_EXT_SPEC) >> $@
echo -e "#if defined(GLEW_EGL)\n" >> $@
$(BIN)/make_info.pl $(EGL_CORE_SPEC) >> $@
$(BIN)/make_info.pl $(EGL_EXT_SPEC) >> $@
echo -e "#elif _WIN32\n" >> $@
$(BIN)/make_info.pl $(WGL_EXT_SPEC) >> $@
echo -e "#else /* _UNIX */\n" >> $@
$(BIN)/make_info.pl $(GLX_CORE_SPEC) >> $@
$(BIN)/make_info.pl $(GLX_EXT_SPEC) >> $@
echo -e "#endif /* _WIN32 */\n" >> $@
cat $(SRC)/glewinfo_gl.c >> $@
$(BIN)/make_info_list.pl $(GL_CORE_SPEC) >> $@
$(BIN)/make_info_list.pl $(GL_EXT_SPEC) >> $@
cat $(SRC)/glewinfo_wgl.c >> $@
$(BIN)/make_info_list.pl $(WGL_EXT_SPEC) >> $@
cat $(SRC)/glewinfo_glx.c >> $@
$(BIN)/make_info_list.pl $(GLX_CORE_SPEC) >> $@
$(BIN)/make_info_list.pl $(GLX_EXT_SPEC) >> $@
cat $(SRC)/glewinfo_egl.c >> $@
$(BIN)/make_info_list.pl $(EGL_CORE_SPEC) >> $@
$(BIN)/make_info_list.pl $(EGL_EXT_SPEC) >> $@
cat $(SRC)/glewinfo_tail.c >> $@
perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc("glColorSubTable"/g' -pi $@
rm -f $@.bak
# Update documentation
$(D.DEST)/%.html: doc/%.html
@echo "--------------------------------------------------------------------"
@echo "Creating $(@F)"
@echo "--------------------------------------------------------------------"
cat $(SRC)/header.html $< $(SRC)/footer.html | \
perl -pe 's#<a href="$(@F)">(.*)</a>#\1#' > $@
$(D.DEST)/glew.html: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating glew.html"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/header.html $@
echo -e "<h2>Supported OpenGL Extensions</h2>\n" >> $@
$(BIN)/make_html.pl $(GL_EXT_SPEC) >> $@
cat $(SRC)/footer.html >> $@
perl -i -pe 's#<a href="$(@F)">(.*)</a>#\1#' $@
$(D.DEST)/wglew.html: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating wglew.html"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/header.html $@
echo -e "<h2>Supported WGL Extensions</h2>\n" >> $@
$(BIN)/make_html.pl $(WGL_EXT_SPEC) >> $@
cat $(SRC)/footer.html >> $@
perl -i -pe 's#<a href="$(@F)">(.*)</a>#\1#' $@
$(D.DEST)/glxew.html: $(EXT)/.dummy
@echo "--------------------------------------------------------------------"
@echo "Creating glxew.html"
@echo "--------------------------------------------------------------------"
cp -f $(SRC)/header.html $@
echo -e "<h2>Supported GLX Extensions</h2>\n" >> $@
$(BIN)/make_html.pl $(GLX_EXT_SPEC) >> $@
cat $(SRC)/footer.html >> $@
perl -i -pe 's#<a href="$(@F)">(.*)</a>#\1#' $@
$(B.DEST)/%.rc: src/%.rc $(EXT)/.dummy
perl -e "s/GLEW_MAJOR/$(GLEW_MAJOR)/g;s/GLEW_MINOR/$(GLEW_MINOR)/g;s/GLEW_MICRO/$(GLEW_MICRO)/g;" -p $< > $@
clean:
rm -rf $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS)
clobber: clean
rm -rf $(EXT)
destroy: clobber
rm -rf registry

View File

@ -0,0 +1,570 @@
#!/bin/bash
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
##
## Parameters:
##
## $1: Extensions directory
set -e
# fix GL_NV_texture_compression_vtc
grep -v EXT $1/GL_NV_texture_compression_vtc > tmp
mv tmp $1/GL_NV_texture_compression_vtc
# remove duplicates from GL_ARB_vertex_program and GL_ARB_fragment_program
tail -n +5 $1/GL_ARB_vertex_program > patterns
grep -v -F -f patterns $1/GL_ARB_fragment_program > tmp
mv tmp $1/GL_ARB_fragment_program
# remove duplicates from GLX_EXT_visual_rating and GLX_EXT_visual_info
tail -n +5 $1/GLX_EXT_visual_info > patterns
grep -v -F -f patterns $1/GLX_EXT_visual_rating > tmp
mv tmp $1/GLX_EXT_visual_rating
# GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetBooleanIndexedvEXT but with different parameter names
grep -v glGetBooleanIndexedvEXT $1/GL_EXT_transform_feedback > tmp
mv tmp $1/GL_EXT_transform_feedback
# GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetIntegerIndexedvEXT but with different parameter names
grep -v glGetIntegerIndexedvEXT $1/GL_EXT_transform_feedback > tmp
mv tmp $1/GL_EXT_transform_feedback
# remove duplicates from GL_NV_video_capture and GLX_NV_video_capture
grep -v glX $1/GL_NV_video_capture > tmp
mv tmp $1/GL_NV_video_capture
# add missing functions to GL_NV_video_capture
cat >> $1/GL_NV_video_capture <<EOT
void glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params)
void glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params)
void glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params)
void glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params)
void glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params)
void glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params)
EOT
# fix WGL_NV_video_capture
cat >> $1/WGL_NV_video_capture <<EOT
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
EOT
# fix GLX_NV_video_capture
cat >> $1/GLX_NV_video_capture <<EOT
typedef XID GLXVideoCaptureDeviceNV
EOT
# remove duplicates from GL_NV_present_video and GLX_NV_present_video
tail -n +5 $1/GLX_NV_present_video > patterns
grep -v -F -f patterns $1/GL_NV_present_video > tmp
mv tmp $1/GL_NV_present_video
# fix WGL_NV_present_video
cat >> $1/WGL_NV_present_video <<EOT
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
EOT
# fix WGL_NV_video_output
cat >> $1/WGL_NV_video_output <<EOT
DECLARE_HANDLE(HPVIDEODEV);
EOT
# fix GL_NV_occlusion_query and GL_HP_occlusion_test
grep -v '_HP' $1/GL_NV_occlusion_query > tmp
mv tmp $1/GL_NV_occlusion_query
perl -e's/OCCLUSION_TEST_HP.*/OCCLUSION_TEST_HP 0x8165/' -pi \
$1/GL_HP_occlusion_test
perl -e's/OCCLUSION_TEST_RESULT_HP.*/OCCLUSION_TEST_RESULT_HP 0x8166/' -pi \
$1/GL_HP_occlusion_test
# add deprecated constants to GL_ATI_fragment_shader
cat >> $1/GL_ATI_fragment_shader <<EOT
GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
GL_NUM_PASSES_ATI 0x8970
GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
GL_COLOR_ALPHA_PAIRING_ATI 0x8975
GL_SWIZZLE_STRQ_ATI 0x897A
GL_SWIZZLE_STRQ_DQ_ATI 0x897B
EOT
# add deprecated constants to GL_NV_texture_shader
cat >> $1/GL_NV_texture_shader <<EOT
GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
EOT
# fix WGL_ATI_pixel_format_float
cat >> $1/WGL_ATI_pixel_format_float <<EOT
GL_RGBA_FLOAT_MODE_ATI 0x8820
GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
EOT
# fix WGL_ARB_make_current_read
cat >> $1/WGL_ARB_make_current_read <<EOT
ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
EOT
# fix WGL_EXT_make_current_read
cat >> $1/WGL_EXT_make_current_read <<EOT
ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
EOT
# add typedefs to GL_ARB_vertex_buffer_object; (from personal communication
# with Marco Fabbricatore).
#
# Rationale. The spec says:
#
# "Both types are defined as signed integers large enough to contain
# any pointer value [...] The idea of making these types unsigned was
# considered, but was ultimately rejected ..."
cat >> $1/GL_ARB_vertex_buffer_object <<EOT
typedef ptrdiff_t GLsizeiptrARB
typedef ptrdiff_t GLintptrARB
EOT
# add typedefs to GLX_EXT_import_context
cat >> $1/GLX_EXT_import_context <<EOT
typedef XID GLXContextID
EOT
# add tokens to GLX_OML_swap_method
cat >> $1/GLX_OML_swap_method <<EOT
GLX_SWAP_EXCHANGE_OML 0x8061
GLX_SWAP_COPY_OML 0x8062
GLX_SWAP_UNDEFINED_OML 0x8063
EOT
# add typedefs to GLX_SGIX_fbconfig
cat >> $1/GLX_SGIX_fbconfig <<EOT
typedef XID GLXFBConfigIDSGIX
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX
EOT
# add typedefs to GLX_SGIX_pbuffer
cat >> $1/GLX_SGIX_pbuffer <<EOT
typedef XID GLXPbufferSGIX
typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX
EOT
# add typedef to GL_NV_half_float
cat >> $1/GL_NV_half_float <<EOT
typedef unsigned short GLhalf
EOT
# add handle to WGL_ARB_pbuffer
cat >> $1/WGL_ARB_pbuffer <<EOT
DECLARE_HANDLE(HPBUFFERARB);
EOT
# add handle to WGL_EXT_pbuffer
cat >> $1/WGL_EXT_pbuffer <<EOT
DECLARE_HANDLE(HPBUFFEREXT);
EOT
# get rid of GL_SUN_multi_draw_arrays
rm -f $1/GL_SUN_multi_draw_arrays
# change variable names in GL_ARB_vertex_shader
perl -e 's/v0/x/g' -pi $1/GL_ARB_vertex_shader
perl -e 's/v1/y/g' -pi $1/GL_ARB_vertex_shader
perl -e 's/v2/z/g' -pi $1/GL_ARB_vertex_shader
perl -e 's/v3/w/g' -pi $1/GL_ARB_vertex_shader
# remove triplicates in GL_ARB_shader_objects, GL_ARB_fragment_shader,
# and GL_ARB_vertex_shader
tail -n +5 $1/GL_ARB_shader_objects > patterns
grep -v -F -f patterns $1/GL_ARB_fragment_shader > tmp
mv tmp $1/GL_ARB_fragment_shader
grep -v -F -f patterns $1/GL_ARB_vertex_shader > tmp
mv tmp $1/GL_ARB_vertex_shader
# remove duplicates in GL_ARB_vertex_program and GL_ARB_vertex_shader
tail -n +5 $1/GL_ARB_vertex_program > patterns
grep -v -F -f patterns $1/GL_ARB_vertex_shader > tmp
mv tmp $1/GL_ARB_vertex_shader
# remove triplicates in GL_ARB_fragment_program, GL_ARB_fragment_shader,
# and GL_ARB_vertex_shader
tail -n +5 $1/GL_ARB_fragment_program > patterns
grep -v -F -f patterns $1/GL_ARB_fragment_shader > tmp
mv tmp $1/GL_ARB_fragment_shader
grep -v -F -f patterns $1/GL_ARB_vertex_shader > tmp
mv tmp $1/GL_ARB_vertex_shader
# remove duplicates in GL_EXT_direct_state_access
grep -v "glGetBooleanIndexedvEXT" $1/GL_EXT_direct_state_access > tmp
mv tmp $1/GL_EXT_direct_state_access
grep -v "glGetIntegerIndexedvEXT" $1/GL_EXT_direct_state_access > tmp
mv tmp $1/GL_EXT_direct_state_access
grep -v "glDisableIndexedEXT" $1/GL_EXT_direct_state_access > tmp
mv tmp $1/GL_EXT_direct_state_access
grep -v "glEnableIndexedEXT" $1/GL_EXT_direct_state_access > tmp
mv tmp $1/GL_EXT_direct_state_access
grep -v "glIsEnabledIndexedEXT" $1/GL_EXT_direct_state_access > tmp
mv tmp $1/GL_EXT_direct_state_access
# remove duplicates in GL_NV_explicit_multisample
grep -v "glGetBooleanIndexedvEXT" $1/GL_NV_explicit_multisample > tmp
mv tmp $1/GL_NV_explicit_multisample
grep -v "glGetIntegerIndexedvEXT" $1/GL_NV_explicit_multisample > tmp
mv tmp $1/GL_NV_explicit_multisample
# fix bugs in GL_ARB_vertex_shader
grep -v "GL_FLOAT" $1/GL_ARB_vertex_shader > tmp
mv tmp $1/GL_ARB_vertex_shader
perl -e 's/handle /GLhandleARB /g' -pi $1/GL_ARB_vertex_shader
# fix bugs in GL_ARB_shader_objects
grep -v "GL_FLOAT " $1/GL_ARB_shader_objects > tmp
mv tmp $1/GL_ARB_shader_objects
grep -v "GL_INT " $1/GL_ARB_shader_objects > tmp
mv tmp $1/GL_ARB_shader_objects
# add typedefs to GL_ARB_shader_objects
cat >> $1/GL_ARB_shader_objects <<EOT
typedef char GLcharARB
typedef unsigned int GLhandleARB
EOT
# add missing functions to GL_ARB_transpose_matrix
cat >> $1/GL_ARB_transpose_matrix <<EOT
void glLoadTransposeMatrixfARB (GLfloat m[16])
void glLoadTransposeMatrixdARB (GLdouble m[16])
void glMultTransposeMatrixfARB (GLfloat m[16])
void glMultTransposeMatrixdARB (GLdouble m[16])
EOT
# add missing tokens to GL_EXT_framebuffer_multisample
cat >> $1/GL_EXT_framebuffer_multisample <<EOT
GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
GL_MAX_SAMPLES_EXT 0x8D57
EOT
# Filter out GL_NV_gpu_program_fp64 enums and functions
head -n4 $1/GL_NV_gpu_program_fp64 > tmp
mv tmp $1/GL_NV_gpu_program_fp64
# Filter glGetUniformui64vNV from GL_NV_shader_buffer_load
grep -v "glGetUniformui64vNV" $1/GL_NV_shader_buffer_load > tmp
mv tmp $1/GL_NV_shader_buffer_load
# Filter out profile enumerations from GLX_ARB_create_context
grep -v "_PROFILE_" $1/GLX_ARB_create_context > tmp
mv tmp $1/GLX_ARB_create_context
# Filter only profile related enumerations for GLX_ARB_create_context_profile
head -n4 $1/GLX_ARB_create_context_profile > tmp
grep "_PROFILE_" $1/GLX_ARB_create_context_profile >> tmp
mv tmp $1/GLX_ARB_create_context_profile
# Filter out profile enumerations from WGL_ARB_create_context
grep -v "_PROFILE_" $1/WGL_ARB_create_context > tmp
mv tmp $1/WGL_ARB_create_context
# Filter only profile related enumerations for WGL_ARB_create_context_profile
head -n4 $1/WGL_ARB_create_context_profile > tmp
grep "_PROFILE_" $1/WGL_ARB_create_context_profile >> tmp
mv tmp $1/WGL_ARB_create_context_profile
# add missing function to GLX_NV_copy_image
cat >> $1/GLX_NV_copy_image <<EOT
void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth)
EOT
# add missing function to WGL_NV_copy_image
cat >> $1/WGL_NV_copy_image <<EOT
BOOL wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth)
EOT
# Filter glProgramParameteri from GL_ARB_separate_shader_objects
# grep -v "glProgramParameteri" $1/GL_ARB_separate_shader_objects > tmp
# mv tmp $1/GL_ARB_separate_shader_objects
# Filter out EXT functions from GL_ARB_viewport_array
grep -v "EXT" $1/GL_ARB_viewport_array > tmp
mv tmp $1/GL_ARB_viewport_array
# Additional enumerations for GL_NV_vertex_buffer_unified_memory
# These are mentioned in GL_ARB_draw_indirect.txt
cat >> $1/GL_NV_vertex_buffer_unified_memory <<EOT
GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
EOT
# Filter glGetPointerv from GL_ARB_debug_output
# It's part of OpenGL 1.1, after all
grep -v "glGetPointerv" $1/GL_ARB_debug_output > tmp
mv tmp $1/GL_ARB_debug_output
# Filter glGetPointerv from GL_EXT_vertex_array
# It's part of OpenGL 1.1, after all
grep -v "glGetPointerv" $1/GL_EXT_vertex_array > tmp
mv tmp $1/GL_EXT_vertex_array
# add typedef to GL_AMD_debug_output
# parse_spec.pl can't parse typedefs from New Types section, but ought to
cat >> $1/GL_AMD_debug_output <<EOT
typedef void (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam)
EOT
# add typedef to GL_ARB_debug_output
# parse_spec.pl can't parse typedefs from New Types section, but ought to
cat >> $1/GL_ARB_debug_output <<EOT
typedef void (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam)
EOT
# add typedef to GL_KHR_debug
# parse_spec.pl can't parse typedefs from New Types section, but ought to
cat >> $1/GL_KHR_debug <<EOT
typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam)
EOT
# Remove glGetPointerv from GL_KHR_debug
grep -v "glGetPointerv" $1/GL_KHR_debug > tmp
mv tmp $1/GL_KHR_debug
# Remove GL_ARB_debug_group, GL_ARB_debug_label and GL_ARB_debug_output2, for now
rm -f $1/GL_ARB_debug_group
rm -f $1/GL_ARB_debug_label
rm -f $1/GL_ARB_debug_output2
# add typedefs to GL_ARB_cl_event
# parse_spec.pl can't parse typedefs from New Types section, but ought to
cat >> $1/GL_ARB_cl_event <<EOT
typedef struct _cl_context *cl_context
typedef struct _cl_event *cl_event
EOT
# Filter out EXT functions from GL_ARB_gpu_shader_fp64
grep -v 'EXT ' $1/GL_ARB_gpu_shader_fp64 > tmp
mv tmp $1/GL_ARB_gpu_shader_fp64
# add missing functions to GL_EXT_direct_state_access (GL_ARB_gpu_shader_fp64 related)
cat >> $1/GL_EXT_direct_state_access <<EOT
void glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x)
void glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y)
void glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z)
void glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
void glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value)
void glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value)
void glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value)
void glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value)
void glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
void glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)
EOT
# add missing functions to GL_EXT_direct_state_access (GL_ARB_instanced_arrays related)
# https://sourceforge.net/p/glew/bugs/242/
cat >> $1/GL_EXT_direct_state_access <<EOT
void glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor)
EOT
# Filter out GL_UNSIGNED_INT and GL_FLOAT from GL_AMD_performance_monitor
grep -v 'GL_UNSIGNED_INT ' $1/GL_AMD_performance_monitor > tmp
mv tmp $1/GL_AMD_performance_monitor
grep -v 'GL_FLOAT ' $1/GL_AMD_performance_monitor > tmp
mv tmp $1/GL_AMD_performance_monitor
# Filter out GL_STORAGE_CACHED_APPLE and GL_STORAGE_SHARED_APPLE from GL_APPLE_texture_range
grep -v 'GL_STORAGE_CACHED_APPLE ' $1/GL_APPLE_texture_range > tmp
mv tmp $1/GL_APPLE_texture_range
grep -v 'GL_STORAGE_SHARED_APPLE ' $1/GL_APPLE_texture_range > tmp
mv tmp $1/GL_APPLE_texture_range
# Filter out GL_RED from GL_ARB_texture_rg
grep -v 'GL_RED ' $1/GL_ARB_texture_rg > tmp
mv tmp $1/GL_ARB_texture_rg
# Filter out _EXT enums from GL_ARB_texture_storage
grep -v '_EXT ' $1/GL_ARB_texture_storage > tmp
mv tmp $1/GL_ARB_texture_storage
# Filter out TEXTURE_3D enums from GL_EXT_paletted_texture
grep -v 'TEXTURE_3D' $1/GL_EXT_paletted_texture > tmp
mv tmp $1/GL_EXT_paletted_texture
# Filter out GL_VERSION_1_1 enums from GL_AMD_stencil_operation_extended
grep -v '0x150' $1/GL_AMD_stencil_operation_extended > tmp
mv tmp $1/GL_AMD_stencil_operation_extended
# Filter out from GL_APPLE_ycbcr_422
grep -v 'GL_UNSIGNED_SHORT_8_8_APPLE' $1/GL_APPLE_ycbcr_422 > tmp
mv tmp $1/GL_APPLE_ycbcr_422
grep -v 'GL_UNSIGNED_SHORT_8_8_REV_APPLE' $1/GL_APPLE_ycbcr_422 > tmp
mv tmp $1/GL_APPLE_ycbcr_422
# Filter out GL_FRAGMENT_DEPTH_EXT from GL_EXT_light_texture
grep -v 'GL_FRAGMENT_DEPTH_EXT' $1/GL_EXT_light_texture > tmp
mv tmp $1/GL_EXT_light_texture
# Filter out GL_MULTISAMPLE_BIT_EXT from GL_SGIS_multisample
grep -v 'GL_MULTISAMPLE_BIT_EXT' $1/GL_SGIS_multisample > tmp
mv tmp $1/GL_SGIS_multisample
# Filter out GL_COMPRESSED_RGB_S3TC_DXT1_EXT from GL_EXT_texture_compression_dxt1
grep -v 'GL_COMPRESSED_RGB_S3TC_DXT1_EXT' $1/GL_EXT_texture_compression_dxt1 > tmp
mv tmp $1/GL_EXT_texture_compression_dxt1
# Filter out GL_COMPRESSED_RGBA_S3TC_DXT1_EXT from GL_EXT_texture_compression_dxt1
grep -v 'GL_COMPRESSED_RGBA_S3TC_DXT1_EXT' $1/GL_EXT_texture_compression_dxt1 > tmp
mv tmp $1/GL_EXT_texture_compression_dxt1
# Append GLfixed to GL_ARB_ES2_compatibility
# Probably ought to be explicitly mentioned in the spec language
cat >> $1/GL_ARB_ES2_compatibility <<EOT
typedef int GLfixed
EOT
# Append GLclampx to GL_REGAL_ES1_0_compatibility
# Probably ought to be explicitly mentioned in the spec language
cat >> $1/GL_REGAL_ES1_0_compatibility <<EOT
typedef int GLclampx
EOT
# Append GLLOGPROCREGAL to GL_REGAL_log
# Probably ought to be explicitly mentioned in the spec language
cat >> $1/GL_REGAL_log <<EOT
typedef void (APIENTRY *LOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context)
EOT
# Fixup LOGPROCREGAL -> GLLOGPROCREGAL
perl -e 's/LOGPROCREGAL/GLLOGPROCREGAL/g' -pi $1/GL_REGAL_log
# Filter out GL_BYTE from GL_OES_byte_coordinates
grep -v 'GL_BYTE' $1/GL_OES_byte_coordinates > tmp
mv tmp $1/GL_OES_byte_coordinates
# Filter out fp64 (not widely supported) from GL_EXT_direct_state_access
egrep -v 'glProgramUniform.*[1234]d[v]?EXT' $1/GL_EXT_direct_state_access > tmp
mv tmp $1/GL_EXT_direct_state_access
# Filter out all enums from GL_ANGLE_depth_texture
grep -v '0x' $1/GL_ANGLE_depth_texture > tmp
mv tmp $1/GL_ANGLE_depth_texture
# Filter out GL_NONE enum from GL_ANGLE_depth_texture
grep -v 'GL_NONE' $1/GL_ANGLE_texture_usage > tmp
mv tmp $1/GL_ANGLE_texture_usage
# Fixup REGAL and ANGLE urls
for i in $1/GL_REGAL_*; do perl -e 's#http://www.opengl.org/registry/specs/REGAL/.*#https://github.com/p3/regal/tree/master/doc/extensions#g' -pi $i; done
for i in $1/GL_ANGLE_*; do perl -e 's#http://www.opengl.org/registry/specs/ANGLE/.*#https://code.google.com/p/angleproject/source/browse/\#git%2Fextensions#g' -pi $i; done
# Filter out GL_NV_blend_equation_advanced_coherent enums and functions
head -n4 $1/GL_NV_blend_equation_advanced_coherent > tmp
mv tmp $1/GL_NV_blend_equation_advanced_coherent
# Filter out GL_AMD_gpu_shader_int64 enums and functions
head -n4 $1/GL_AMD_gpu_shader_int64 > tmp
mv tmp $1/GL_AMD_gpu_shader_int64
# Filter out GL_NO_ERROR enum from GL_KHR_robustness
grep -v 'GL_NO_ERROR' $1/GL_KHR_robustness > tmp
mv tmp $1/GL_KHR_robustness
# Filter out all enums from GL_KHR_blend_equation_advanced_coherent
grep -v '0x' $1/GL_KHR_blend_equation_advanced_coherent > tmp
mv tmp $1/GL_KHR_blend_equation_advanced_coherent
# Filter out glBlendBarrierKHR enum from GL_KHR_blend_equation_advanced_coherent
grep -v 'glBlendBarrierKHR' $1/GL_KHR_blend_equation_advanced_coherent > tmp
mv tmp $1/GL_KHR_blend_equation_advanced_coherent
# Filter out GL_NONE enum from GL_KHR_context_flush_control
grep -v 'GL_NONE' $1/GL_KHR_context_flush_control > tmp
mv tmp $1/GL_KHR_context_flush_control
# Filter out GL_NONE enum from GL_EGL_KHR_context_flush_control
grep -v 'GL_NONE' $1/GL_EGL_KHR_context_flush_control > tmp
mv tmp $1/GL_EGL_KHR_context_flush_control
# Filter out CoverageModulation from NV_framebuffer_mixed_samples
# Superset of EXT_raster_multisample
grep -v "CoverageModulation" $1/GL_NV_framebuffer_mixed_samples > tmp
mv tmp $1/GL_NV_framebuffer_mixed_samples
# Filter out glRasterSamplesEXT from NV_framebuffer_mixed_samples
# Superset of EXT_raster_multisample
grep -v "RasterSamplesEXT" $1/GL_NV_framebuffer_mixed_samples > tmp
mv tmp $1/GL_NV_framebuffer_mixed_samples
# Filter out glNamedBufferStorageEXT from GL_ARB_buffer_storage
grep -v "glNamedBufferStorageEXT" $1/GL_ARB_buffer_storage > tmp
mv tmp $1/GL_ARB_buffer_storage
# Filter out glFramebufferTextureEXT from GL_EXT_geometry_point_size
# and GL_EXT_geometry_shader
grep -v "glFramebufferTextureEXT" $1/GL_EXT_geometry_point_size > tmp
mv tmp $1/GL_EXT_geometry_point_size
grep -v "glFramebufferTextureEXT" $1/GL_EXT_geometry_shader > tmp
mv tmp $1/GL_EXT_geometry_shader
# Filter out glBindFragDataLocationEXT from GL_EXT_blend_func_extended
grep -v "glBindFragDataLocationEXT" $1/GL_EXT_blend_func_extended > tmp
mv tmp $1/GL_EXT_blend_func_extended
# Filter out glDrawArraysInstancedEXT and glDrawElementsInstancedEXT from GL_EXT_blend_func_extended
grep -v "glDrawArraysInstancedEXT" $1/GL_EXT_instanced_arrays > tmp
mv tmp $1/GL_EXT_instanced_arrays
grep -v "glDrawElementsInstancedEXT" $1/GL_EXT_instanced_arrays > tmp
mv tmp $1/GL_EXT_instanced_arrays
# Filter out glRenderbufferStorageMultisampleEXT from GL_EXT_multisampled_render_to_texture
grep -v "glRenderbufferStorageMultisampleEXT" $1/GL_EXT_multisampled_render_to_texture > tmp
mv tmp $1/GL_EXT_multisampled_render_to_texture
# Filter out glTexturePageCommitmentEXT from GL_ARB_sparse_texture
grep -v "glTexturePageCommitmentEXT" $1/GL_ARB_sparse_texture > tmp
mv tmp $1/GL_ARB_sparse_texture
# Filter out TextureStorage* from GL_ARB_texture_storage
grep -v "TextureStorage" $1/GL_ARB_texture_storage > tmp
mv tmp $1/GL_ARB_texture_storage
# Append GLVULKANPROCNV to GL_NV_draw_vulkan_image
# Probably ought to be explicitly mentioned in the spec language
cat >> $1/GL_NV_draw_vulkan_image <<EOT
typedef void (APIENTRY *GLVULKANPROCNV)(void)
EOT
# clean up
rm -f patterns $1/*.bak

View File

@ -0,0 +1,19 @@
#!/bin/bash
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
##
## Parameters:
##
## $1: Extensions directory
## $2: Registry directory
## $3: The black list
set -e
# clean up
rm -f $1/*.bak

View File

@ -0,0 +1,38 @@
#!/usr/bin/python
import re
section = re.compile('^(Name|Name Strings?|Contact|Notice|Number|Dependencies|Overview|Issues|IP Status|Status|Version|New Procedures and Functions|New Tokens|Additions to .*|Changes to .*|Modifications to .*|Add new Section .*)\s*$')
token = re.compile('^\s+(([A-Z0-9][A-Z0-9_x]*):?\s+((?:0x)?[0-9A-F]+)([^\?]*))?\s*$')
match = [ 'Name', 'Name String', 'Contact', 'Notice', 'Name Strings', 'Version', 'Number', 'Dependencies', 'New Procedures and Functions', 'New Tokens']
if __name__ == '__main__':
from optparse import OptionParser
import os
parser = OptionParser('usage: %prog [options] [SOURCES...]')
(options, args) = parser.parse_args()
for i in args:
lines = open(i).readlines()
f = open(i,'w')
# Keep track of the current section as we iterate over the input
current = ''
for j in lines:
# Detect the start of a new section
m = section.match(j)
if m:
current = m.group(1).strip()
if current in match:
print >>f, j,
continue
if current=='New Tokens':
if token.match(j):
print >>f, j,
elif current in match:
print >>f, j,

View File

@ -0,0 +1,223 @@
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
my %regex = (
extname => qr/^[A-Z][A-Za-z0-9_]+$/,
exturl => qr/^http.+$/,
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
token => qr/^([A-Z][A-Z0-9_x]*)\s+((?:0x)?[0-9A-Fa-f]+(u(ll)?)?|[A-Z][A-Z0-9_]*)$/,
type => qr/^typedef\s+(.+)$/,
exact => qr/.*;$/,
);
# prefix function name with glew
sub prefixname($)
{
my $name = $_[0];
$name =~ s/^(.*?)gl/__$1glew/;
return $name;
}
# prefix function name with glew
sub prefix_varname($)
{
my $name = $_[0];
$name =~ s/^(.*?)GL(X*?)EW/__$1GL$2EW/;
return $name;
}
#---------------------------------------------------------------------------------------
sub make_exact($)
{
my $exact = $_[0];
$exact =~ s/(; |{)/$1\n/g;
return $exact;
}
sub make_separator($)
{
my $extname = $_[0];
my $l = length $extname;
my $s = (71 - $l)/2;
print "/* ";
my $j = 3;
for (my $i = 0; $i < $s; $i++)
{
print "-";
$j++;
}
print " $_[0] ";
$j += $l + 2;
while ($j < 76)
{
print "-";
$j++;
}
print " */\n\n";
}
#---------------------------------------------------------------------------------------
sub parse_ext($)
{
my $filename = shift;
my %functions = ();
my %tokens = ();
my @reuse = (); # Extensions to reuse
my @types = ();
my @exacts = ();
my $extname = ""; # Full extension name GL_FOO_extension
my $exturl = ""; # Info URL
my $extstring = ""; # Relevant extension string
open EXT, "<$filename" or return;
# As of GLEW 1.14.0 the first four lines _must_ be
# the extension name, the URL and the GL extension
# string (which might be different to the name),
# and the reused extensions
#
# For example GL_NV_geometry_program4 is available
# iff GL_NV_gpu_program4 appears in the extension
# string.
#
# For core OpenGL versions, the third line should
# be blank.
#
# If the URL is unknown, the second line should be
# blank.
$extname = readline(*EXT);
$exturl = readline(*EXT);
$extstring = readline(*EXT);
@reuse = split(" ", readline(*EXT));
chomp($extname);
chomp($exturl);
chomp($extstring);
while(<EXT>)
{
chomp;
if (s/^\s+//)
{
if (/$regex{exact}/)
{
push @exacts, $_;
}
elsif (/$regex{type}/)
{
push @types, $_;
}
elsif (/$regex{token}/)
{
my ($name, $value) = ($1, $2);
$tokens{$name} = $value;
}
elsif (/$regex{function}/)
{
my ($return, $name, $parms) = ($1, $2, $3);
$functions{$name} = {
rtype => $return,
parms => $parms,
};
} else {
print STDERR "'$_' matched no regex.\n";
}
}
}
close EXT;
return ($extname, $exturl, $extstring, \@reuse, \@types, \%tokens, \%functions, \@exacts);
}
sub output_tokens($$)
{
my ($tbl, $fnc) = @_;
if (keys %{$tbl})
{
local $, = "\n";
print "\n";
print map { &{$fnc}($_, $tbl->{$_}) } sort {
if (${$tbl}{$a} eq ${$tbl}{$b}) {
$a cmp $b
} else {
if (${$tbl}{$a} =~ /_/) {
if (${$tbl}{$b} =~ /_/) {
$a cmp $b
} else {
-1
}
} else {
if (${$tbl}{$b} =~ /_/) {
1
} else {
if (hex ${$tbl}{$a} eq hex ${$tbl}{$b}) {
$a cmp $b
} else {
hex ${$tbl}{$a} <=> hex ${$tbl}{$b}
}
}
}
}
} keys %{$tbl};
print "\n";
} else {
print STDERR "no keys in table!\n";
}
}
sub output_types($$)
{
my ($tbl, $fnc) = @_;
if (scalar @{$tbl})
{
local $, = "\n";
print "\n";
print map { &{$fnc}($_) } sort @{$tbl};
print "\n";
}
}
sub output_decls($$)
{
my ($tbl, $fnc) = @_;
if (keys %{$tbl})
{
local $, = "\n";
print "\n";
print map { &{$fnc}($_, $tbl->{$_}) } sort keys %{$tbl};
print "\n";
}
}
sub output_exacts($$)
{
my ($tbl, $fnc) = @_;
if (scalar @{$tbl})
{
local $, = "\n";
print "\n";
print map { &{$fnc}($_) } sort @{$tbl};
print "\n";
}
}
sub output_reuse($$)
{
my ($tbl, $fnc) = @_;
if (scalar @{$tbl})
{
local $, = "\n";
print "\n";
print map { &{$fnc}($_) } sort @{$tbl};
print "\n";
}
}

View File

@ -0,0 +1,36 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
# function pointer declaration
sub make_pfn_decl($%)
{
return "PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . " = NULL;";
}
my @extlist = ();
my %extensions = ();
our $type = shift;
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
output_decls($functions, \&make_pfn_decl);
}
}

View File

@ -0,0 +1,32 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
my @extlist = ();
my %extensions = ();
our $type = shift;
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n";
}
}

View File

@ -0,0 +1,46 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
##
## Make Extension-enabled Index
##
my @extlist = ();
if (@ARGV)
{
@extlist = @ARGV;
print "/* Detected in the extension string or strings */\n";
print "static GLboolean _glewExtensionString[" . scalar @extlist . "];\n";
print "/* Detected via extension string or experimental mode */\n";
print "static GLboolean* _glewExtensionEnabled[] = {\n";;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
print "#ifdef $extname\n";
print " &__$extvar,\n";
print "#endif\n";
}
print " NULL\n};\n";
}

View File

@ -0,0 +1,72 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
# token
sub make_define($$)
{
return "#define $_[0] $_[1]"
}
# type declaration
sub make_type($$)
{
return "@_;"
}
# function pointer type declaration
sub make_pfn_type($%)
{
our $api;
return join(' ', "typedef", $_[1]->{rtype},
"($api * PFN" . (uc $_[0]) . "PROC)",
"(" . $_[1]->{parms} . ")") . ";";
}
# function name alias
sub make_pfn_alias($%)
{
our $type;
return join(" ", "#define", $_[0], $type . "EW_GET_FUN(" . prefixname($_[0]) . ")")
}
my @extlist = ();
my %extensions = ();
our $api = shift;
our $type = shift;
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
make_separator($extname);
print "#ifndef $extname\n#define $extname 1\n";
output_tokens($tokens, \&make_define);
output_types($types, \&make_type);
output_exacts($exacts, \&make_exact);
output_decls($functions, \&make_pfn_type);
output_decls($functions, \&make_pfn_alias);
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
print "\n#define $extvar " . $type . "EW_GET_VAR(" . prefix_varname($extvar) . ")\n";
print "\n#endif /* $extname */\n\n";
}
}

View File

@ -0,0 +1,56 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
#---------------------------------------------------------------------------------------
my @extlist = ();
my %extensions = ();
my $group = "";
my $cur_group = "";
if (@ARGV)
{
@extlist = @ARGV;
my $n = 1;
print "<table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" align=\"center\">\n";
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
$cur_group = $extname;
$cur_group =~ s/^(?:W?)GL(?:X?)_([A-Z0-9]+?)_.*$/$1/;
$extname =~ s/^(?:W?)GL(?:X?)_(.*)$/$1/;
if ($cur_group ne $group)
{
if ($group ne "")
{
print "<tr><td><br></td><td></td><td></td></tr>\n";
}
$group = $cur_group;
}
{
if ($exturl)
{
print "<tr><td class=\"num\">$n</td><td>&nbsp;</td><td><a href=\"$exturl\">$extname</a></td></tr>\n";
}
else
{
print "<tr><td class=\"num\">$n</td><td>&nbsp;</td><td>$extname</td></tr>\n";
}
$n++;
}
}
print "</table>\n"
}

View File

@ -0,0 +1,39 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
##
## Make Index
##
## Output sorted array of extension strings for indexing into extension
## enable/disable flags. This provides a way to convert an extension string
## into an integer index.
##
my @extlist = ();
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
print "#ifdef $extname\n";
print " \"$extname\",\n";
print "#endif\n";
}
}

View File

@ -0,0 +1,60 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
#---------------------------------------------------------------------------------------
# function pointer definition
sub make_pfn_info($%)
{
my $name = $_[0];
return " glewInfoFunc(\"$_[0]\", $name == NULL);";
}
#---------------------------------------------------------------------------------------
my @extlist = ();
my %extensions = ();
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
my $extpre = $extname;
$extpre =~ s/(GLX|GLW|GL).*/$1/;
$extpre = lc $extpre;
#make_separator($extname);
print "#ifdef $extname\n\n";
print "static void _glewInfo_$extname (void)\n{\n";
if ($extvar =~ /VERSION/)
{
print " glewPrintExt(\"$extname\", $extvar, $extvar, $extvar);\n";
}
else
{
print " glewPrintExt(\"$extname\", $extvar, $extpre" .
"ewIsSupported(\"$extname\"), $extpre" .
"ewGetExtension(\"$extstring\"));\n";
}
output_decls($functions, \&make_pfn_info);
print "}\n\n";
print "#endif /* $extname */\n\n";
}
}

View File

@ -0,0 +1,48 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
#---------------------------------------------------------------------------------------
# function pointer definition
sub make_pfn_def($%)
{
return "PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . " = NULL;";
}
# function pointer definition
sub make_init_call($%)
{
my $name = prefixname($_[0]);
return " r = r || (" . $name . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $name . "\")) == NULL;";
}
#---------------------------------------------------------------------------------------
my @extlist = ();
my %extensions = ();
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
print "#ifdef $extname\n";
print " _glewInfo_$extname();\n";
print "#endif /* $extname */\n";
}
}

View File

@ -0,0 +1,60 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
#-------------------------------------------------------------------------------
# function pointer definition
sub make_pfn_def_init($%)
{
#my $name = prefixname($_[0]);
return " r = ((" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $_[0] . "\")) == NULL) || r;";
}
sub make_reuse_call($%)
{
return " r = _glewInit_" . $_[0] . "() || r;";
}
#-------------------------------------------------------------------------------
my @extlist = ();
my %extensions = ();
our $type = shift;
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
#make_separator($extname);
my $extvar = $extname;
my $extvardef = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
if (keys %$functions or keys @$reuse)
{
print "#ifdef $extname\n\n";
print "static GLboolean _glewInit_$extname ()\n{\n GLboolean r = GL_FALSE;\n";
output_reuse($reuse, \&make_reuse_call);
output_decls($functions, \&make_pfn_def_init);
print "\n return r;\n}\n\n";
print "#endif /* $extname */\n\n";
}
}
}

View File

@ -0,0 +1,44 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
## Output declarations for the _glewInit_[extension] functions defined
## by make_init.pl script. These are necessary for for initializers to
## call each other, such as a core GL 3 context that depends on certain
## extensions.
#-------------------------------------------------------------------------------
my @extlist = ();
my %extensions = ();
our $type = shift;
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) =
parse_ext($ext);
#print "#ifdef $extname\n\n";
if (keys %$functions)
{
print "static GLboolean _glewInit_$extname ();\n";
}
#print "#endif /* $extname */\n\n";
}
}

View File

@ -0,0 +1,74 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
#---------------------------------------------------------------------------------------
# function pointer definition
sub make_init_call($%)
{
my $name = prefixname($_[0]);
return " r = r || (" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $name . "\")) == NULL;";
}
#---------------------------------------------------------------------------------------
my @extlist = ();
my %extensions = ();
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
my $extpre = $extname;
$extpre =~ s/^(W?E?)GL(X?).*$/\l$1gl\l$2ew/;
#my $pextvar = prefix_varname($extvar);
if (length($extstring) && $extstring !~ /^GL_/ || keys %$functions)
{
print "#ifdef $extname\n";
}
if (length($extstring) && $extstring !~ /^GL_/)
{
print " " . $extvar . " = _glewSearchExtension(\"$extstring\", extStart, extEnd);\n";
}
if (keys %$functions)
{
if ($extname =~ /WGL_.*/)
{
print " if (glewExperimental || " . $extvar . "|| crippled) " . $extvar . "= !_glewInit_$extname();\n";
}
else
{
print " if (glewExperimental || " . $extvar . ") " . $extvar . " = !_glewInit_$extname();\n";
}
}
if (length($extstring) && $extstring !~ /^GL_/ || keys %$functions)
{
print "#endif /* $extname */\n";
}
}
}

View File

@ -0,0 +1,45 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
#---------------------------------------------------------------------------------------
# Extensions that depend on others can be enabled once we know
# if the one it depends on, is enabled.
my @extlist = ();
my %extensions = ();
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
if ($extname ne $extstring && length($extstring))
{
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
my $parent = $extstring;
$parent =~ s/GL(X*)_/GL$1EW_/;
print "#ifdef $extname\n";
print " $extvar = $parent;\n";
print "#endif /* $extname */\n";
}
}
}

View File

@ -0,0 +1,54 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
my @extlist = ();
my %extensions = ();
if (@ARGV)
{
@extlist = @ARGV;
my $curexttype = "";
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $exttype = $extname;
$exttype =~ s/(W?E?)GL(X?)_(.*?_)(.*)/$3/;
my $extrem = $extname;
$extrem =~ s/(W?E?)GL(X?)_(.*?_)(.*)/$4/;
my $extvar = $extname;
$extvar =~ s/(W?E?)GL(X?)_/$1GL$2EW_/;
if(!($exttype =~ $curexttype))
{
if(length($curexttype) > 0)
{
print " }\n";
}
print " if (_glewStrSame2(&pos, &len, (const GLubyte*)\"$exttype\", " . length($exttype) . "))\n";
print " {\n";
$curexttype = $exttype;
}
print "#ifdef $extname\n";
print " if (_glewStrSame3(&pos, &len, (const GLubyte*)\"$extrem\", ". length($extrem) . "))\n";
#print " return $extvar;\n";
print " {\n";
print " ret = $extvar;\n";
print " continue;\n";
print " }\n";
print "#endif\n";
}
print " }\n";
}

View File

@ -0,0 +1,37 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
# function pointer declaration
sub make_pfn_decl($%)
{
our $export;
return $export . " PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . ";";
}
my @extlist = ();
my %extensions = ();
our $export = shift;
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
output_decls($functions, \&make_pfn_decl);
}
}

View File

@ -0,0 +1,32 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
use lib '.';
do 'bin/make.pl';
my @extlist = ();
my %extensions = ();
our $export = shift;
if (@ARGV)
{
@extlist = @ARGV;
foreach my $ext (sort @extlist)
{
my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
my $extvar = $extname;
$extvar =~ s/GL(X*)_/GL$1EW_/;
print $export . " GLboolean " . prefix_varname($extvar) . ";\n";
}
}

View File

@ -0,0 +1,393 @@
#!/usr/bin/perl
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
use strict;
use warnings;
sub compile_regex
{
my $regex = join('', @_);
return qr/$regex/
}
my @sections = (
"Name",
"Name Strings?",
"New Procedures and Functions",
"New Tokens.*", # Optional (GL/WGL/GLX/...) suffix
"Additions to Chapter.*",
);
my %typemap = (
bitfield => "GLbitfield",
boolean => "GLboolean",
# fsck up in EXT_vertex_array
Boolean => "GLboolean",
byte => "GLbyte",
clampd => "GLclampd",
clampf => "GLclampf",
double => "GLdouble",
enum => "GLenum",
# Intel fsck up
Glenum => "GLenum",
float => "GLfloat",
half => "GLhalf",
int => "GLint",
short => "GLshort",
sizei => "GLsizei",
ubyte => "GLubyte",
uint => "GLuint",
ushort => "GLushort",
DMbuffer => "void *",
# Nvidia video output fsck up
int64EXT => "GLint64EXT",
uint64EXT=> "GLuint64EXT",
# ARB VBO introduces these.
sizeiptr => "GLsizeiptr",
intptr => "GLintptr",
sizeiptrARB => "GLsizeiptrARB",
intptrARB => "GLintptrARB",
# ARB shader objects introduces these, charARB is at least 8 bits,
# handleARB is at least 32 bits
charARB => "GLcharARB",
handleARB => "GLhandleARB",
char => "GLchar",
# OpenGL 3.2 and GL_ARB_sync
int64 => "GLint64",
uint64 => "GLuint64",
sync => "GLsync",
# AMD_debug_output
DEBUGPROCAMD => "GLDEBUGPROCAMD",
# ARB_debug_output
DEBUGPROCARB => "GLDEBUGPROCARB",
# KHR_debug
DEBUGPROC => "GLDEBUGPROC",
VULKANPROCNV => "GLVULKANPROCNV",
vdpauSurfaceNV => "GLvdpauSurfaceNV",
# GLX 1.3 defines new types which might not be available at compile time
#GLXFBConfig => "void*",
#GLXFBConfigID => "XID",
#GLXContextID => "XID",
#GLXWindow => "XID",
#GLXPbuffer => "XID",
# Weird stuff to some SGIX extension
#GLXFBConfigSGIX => "void*",
#GLXFBConfigIDSGIX => "XID",
);
my %voidtypemap = (
void => "GLvoid",
);
my %taboo_tokens = (
GL_ZERO => 1,
);
# list of function definitions to be ignored, unless they are being defined in
# the given spec. This is an ugly hack arround the fact that people writing
# spec files seem to shut down all brain activity while they are at this task.
#
# This will be moved to its own file eventually.
#
# (mem, 2003-03-19)
my %fnc_ignore_list = (
"BindProgramARB" => "ARB_vertex_program",
"ColorSubTableEXT" => "EXT_color_subtable",
"DeleteProgramsARB" => "ARB_vertex_program",
"GenProgramsARB" => "ARB_vertex_program",
"GetProgramEnvParameterdvARB" => "ARB_vertex_program",
"GetProgramEnvParameterfvARB" => "ARB_vertex_program",
"GetProgramLocalParameterdvARB" => "ARB_vertex_program",
"GetProgramLocalParameterfvARB" => "ARB_vertex_program",
"GetProgramStringARB" => "ARB_vertex_program",
"GetProgramivARB" => "ARB_vertex_program",
"IsProgramARB" => "ARB_vertex_program",
"ProgramEnvParameter4dARB" => "ARB_vertex_program",
"ProgramEnvParameter4dvARB" => "ARB_vertex_program",
"ProgramEnvParameter4fARB" => "ARB_vertex_program",
"ProgramEnvParameter4fvARB" => "ARB_vertex_program",
"ProgramLocalParameter4dARB" => "ARB_vertex_program",
"ProgramLocalParameter4dvARB" => "ARB_vertex_program",
"ProgramLocalParameter4fARB" => "ARB_vertex_program",
"ProgramLocalParameter4fvARB" => "ARB_vertex_program",
"ProgramStringARB" => "ARB_vertex_program",
"glXCreateContextAttribsARB" => "ARB_create_context_profile",
"wglCreateContextAttribsARB" => "WGL_ARB_create_context_profile",
);
my %regex = (
eofnc => qr/(?:\);?$|^$)/, # )$ | );$ | ^$
extname => qr/^[A-Z][A-Za-z0-9_]+$/,
none => qr/^\(none\)$/,
function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i,
prefix => qr/^(?:[aw]?gl|glX)/, # gl | agl | wgl | glX
tprefix => qr/^(?:[AW]?GL|GLX)_/, # GL_ | AGL_ | WGL_ | GLX_
section => compile_regex('^(', join('|', @sections), ')$'), # sections in spec
token => qr/^([A-Z0-9][A-Z0-9_x]*):?\s+((?:0x)?[0-9A-Fa-f]+(u(ll)?)?)(|\s[^\?]*)$/, # define tokens
types => compile_regex('\b(', join('|', keys %typemap), ')\b'), # var types
voidtype => compile_regex('\b(', keys %voidtypemap, ')\b '), # void type
);
# reshapes the the function declaration from multiline to single line form
sub normalize_prototype
{
local $_ = join(" ", @_);
s/\s+/ /g; # multiple whitespace -> single space
s/\<.*\>//g; # remove <comments> from direct state access extension
s/\<.*$//g; # remove incomplete <comments> from direct state access extension
s#/\*.*\*/##g; # remove /* ... */ comments
s/\s*\(\s*/ \(/; # exactly one space before ( and none after
s/\s*\)\s*/\)/; # no space before or after )
s/\s*\*([a-zA-Z])/\* $1/; # "* identifier"
s/\*wgl/\* wgl/; # "* wgl"
s/\*glX/\* glX/; # "* glX"
s/\.\.\./void/; # ... -> void
s/;$//; # remove ; at the end of the line
return $_;
}
# Ugly hack to work arround the fact that functions are declared in more
# than one spec file.
sub ignore_function($$)
{
return exists($fnc_ignore_list{$_[0]}) && $fnc_ignore_list{$_[0]} ne $_[1]
}
sub parse_spec($)
{
my $filename = shift;
my $extname = "";
my $vendortag = "";
my @extnames = ();
my %functions = ();
my %tokens = ();
my $section = "";
my @fnc = ();
my %proc = (
"Name" => sub {
if (/^([a-z0-9]+)_([a-z0-9_]+)/i)
{
$extname = "$1_$2";
$vendortag = $1;
}
},
"Name Strings" => sub {
# Add extension name to extension list
# Initially use $extname if (none) specified
if (/$regex{none}/)
{
$_ = $extname;
}
if (/$regex{extname}/)
{
# prefix with "GL_" if prefix not present
s/^/GL_/ unless /$regex{tprefix}/o;
# Add extension name to extension list
push @extnames, $_;
}
},
"New Procedures and Functions" => sub {
# if line matches end of function
if (/$regex{eofnc}/)
{
# add line to function declaration
push @fnc, $_;
# if normalized version of function looks like a function
if (normalize_prototype(@fnc) =~ /$regex{function}/)
{
# get return type, name, and arguments from regex
my ($return, $name, $parms) = ($1, $2, $3);
if (!ignore_function($name, $extname))
{
# prefix with "gl" if prefix not present
$name =~ s/^/gl/ unless $name =~ /$regex{prefix}/;
# is this a pure GL function?
if ($name =~ /^gl/ && $name !~ /^glX/)
{
# apply typemaps
$return =~ s/$regex{types}/$typemap{$1}/og;
$return =~ s/GLvoid/void/og;
$return =~ s/void\*/void */og;
$parms =~ s/$regex{types}/$typemap{$1}/og;
$parms =~ s/$regex{voidtype}/$voidtypemap{$1}/og;
$parms =~ s/GLvoid/void/og;
$parms =~ s/ void\* / void */og;
}
# add to functions hash
$functions{$name} = {
rtype => $return,
parms => $parms,
};
}
}
# reset function declaration
@fnc = ();
} elsif ($_ ne "" and $_ ne "None") {
# if not eof, add line to function declaration
push @fnc, $_
}
},
"New Tokens" => sub {
if (/$regex{token}/)
{
my ($name, $value) = ($1, $2);
# prefix with "GL_" if prefix not present
$name =~ s/^/GL_/ unless $name =~ /$regex{tprefix}/;
# Add (name, value) pair to tokens hash, unless it's taboo
$tokens{$name} = $value unless exists $taboo_tokens{$name};
}
},
);
# Some people can't read, the template clearly says "Name String_s_"
$proc{"Name String"} = $proc{"Name Strings"};
# Open spec file
open SPEC, "<$filename" or return;
# For each line of SPEC
while(<SPEC>)
{
# Delete trailing newline character
chomp;
# Remove trailing white spaces
s/\s+$//;
# If starts with a capital letter, it must be a new section
if (/^[A-Z]/)
{
# Match section name with one of the predefined names
$section = /$regex{section}/o ? $1 : "default";
} else {
# Line is internal to a section
# Remove leading whitespace
s/^\s+//;
# Call appropriate section processing function if it exists
&{$proc{$section}} if exists $proc{$section};
}
}
close SPEC;
return ($extname, \@extnames, \%tokens, \%functions);
}
#----------------------------------------------------------------------------------------
my @speclist = ();
my %extensions = ();
my $ext_dir = shift;
my $reg_http = "http://www.opengl.org/registry/specs/";
# Take command line arguments or read list from file
if (@ARGV)
{
@speclist = @ARGV;
} else {
local $/; #???
@speclist = split "\n", (<>);
}
foreach my $spec (sort @speclist)
{
my ($extname, $extnames, $tokens, $functions) = parse_spec($spec);
foreach my $ext (@{$extnames})
{
my $info = "$ext_dir/" . $ext;
open EXT, ">$info";
print EXT $ext . "\n"; # Extension name
my $specname = $spec;
$specname =~ s/registry\/gl\/specs\///;
print EXT $reg_http . $specname . "\n"; # Extension info URL
print EXT $ext . "\n"; # Extension string
print EXT "\n"; # Resuses nothing by default
my $prefix = $ext;
$prefix =~ s/^(.+?)(_.+)$/$1/;
foreach my $token (sort {
if (${$tokens}{$a} eq ${$tokens}{$b}) {
$a cmp $b
} else {
if (${$tokens}{$a} =~ /_/) {
if (${$tokens}{$b} =~ /_/) {
$a cmp $b
} else {
-1
}
} else {
if (${$tokens}{$b} =~ /_/) {
1
} else {
if (${$tokens}{$a} =~ /u(ll)?$/) {
if (${$tokens}{$b} =~ /u(ll)?$/) {
$a cmp $b
} else {
-1
}
} else {
if (${$tokens}{$b} =~ /u(ll)?$/) {
1
} else {
if (hex ${$tokens}{$a} eq hex ${$tokens}{$b})
{
$a cmp $b
} else {
hex ${$tokens}{$a} <=> hex ${$tokens}{$b}
}
}
}
}
}
}
} keys %{$tokens})
{
if ($token =~ /^$prefix\_.*/i)
{
print EXT "\t" . $token . " " . ${\%{$tokens}}{$token} . "\n";
}
}
foreach my $function (sort keys %{$functions})
{
if ($function =~ /^$prefix.*/i)
{
print EXT "\t" . ${$functions}{$function}{rtype} . " " . $function . " (" . ${$functions}{$function}{parms} . ")" . "\n";
}
}
close EXT;
}
}

View File

@ -0,0 +1,131 @@
#!/usr/bin/python
import re
import sys
from xml.dom.minidom import parse, Node
def findChildren(node, path):
result = []
if len(path)==1:
for i in node.childNodes:
if i.nodeType==Node.ELEMENT_NODE:
if i.tagName==path[0]:
result.append(i)
else:
for i in node.childNodes:
if i.nodeType==Node.ELEMENT_NODE:
if i.tagName==path[0]:
result.extend(findChildren(i, path[1:]))
return result
def findData(node, path):
return [ i.firstChild.data for i in findChildren(node, path) ]
def findParams(node):
n = findData(node, ['name'])[0]
t = ''
for i in node.childNodes:
if i.nodeType==Node.TEXT_NODE:
t += i.data
if i.nodeType==Node.ELEMENT_NODE and i.tagName=='ptype':
t += i.firstChild.data
return ( t, n)
def findEnums(dom):
ret = {}
for i in findChildren(dom, [ 'registry', 'enums', 'enum' ]):
n = i.getAttribute('name')
v = i.getAttribute('value')
ret[n] = v
return ret
def findCommands(dom):
ret = {}
for i in findChildren(dom, [ 'registry', 'commands', 'command' ]):
r,n = findParams(findChildren(i, ['proto'])[0])
p = [ findParams(j) for j in findChildren(i, ['param'])]
ret[n] = (r, p)
return ret
def findFeatures(dom):
ret = {}
for i in findChildren(dom, [ 'registry', 'feature' ]):
n = i.getAttribute('name')
e = []
c = []
for j in findChildren(i, [ 'require', 'enum' ]):
e.append(j.getAttribute("name"))
for j in findChildren(i, [ 'require', 'command' ]):
c.append(j.getAttribute("name"))
ret[n] = (e,c)
return ret
def findExtensions(dom):
ret = {}
for i in findChildren(dom, [ 'registry', 'extensions', 'extension' ]):
n = i.getAttribute('name')
e = []
c = []
for j in findChildren(i, [ 'require', 'enum' ]):
e.append(j.getAttribute("name"))
for j in findChildren(i, [ 'require', 'command' ]):
c.append(j.getAttribute("name"))
ret[n] = (e,c)
return ret
def findApi(dom, name):
enums = findEnums(dom)
commands = findCommands(dom)
features = findFeatures(dom)
extensions = findExtensions(dom)
return (enums, commands, features, extensions)
def writeExtension(f, name, extension, enums, commands):
f.write('%s\n'%name)
f.write('%s\n'%'https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf')
if name.find('_VERSION_')==-1:
f.write('%s\n'%name)
else:
f.write('\n')
f.write('\n')
enums = [ (j, enums[j]) for j in extension[0] ]
for e in sorted(enums, key=lambda i: i[1]):
f.write('\t%s %s\n'%(e[0], e[1]))
commands = [ (j, commands[j]) for j in extension[1] ]
for c in sorted(commands):
params = ', '.join( [ '%s %s'%(j[0], j[1]) for j in c[1][1] ] )
if len(params)==0:
params = ' void '
f.write('\t%s %s (%s)\n'%(c[1][0], c[0], params))
if __name__ == '__main__':
from optparse import OptionParser
import os
parser = OptionParser('usage: %prog [options] [XML specs...]')
parser.add_option("--core", dest="core", help="location for core outputs", default='')
parser.add_option("--extensions", dest="extensions", help="location for extensions outputs", default='')
(options, args) = parser.parse_args()
for i in args:
dom = parse(i)
api = findApi(dom, 'egl')
print('Found {} enums, {} commands, {} features and {} extensions.'.format(
len(api[0]), len(api[1]), len(api[2]), len(api[3])))
if len(options.core):
for i in api[2].keys():
f = open('%s/%s'%(options.core, i), 'w')
writeExtension(f, i, api[2][i], api[0], api[1])
f.close()
if len(options.extensions):
for i in api[3].keys():
f = open('%s/%s'%(options.extensions, i), 'w')
writeExtension(f, i, api[3][i], api[0], api[1])
f.close()

View File

@ -0,0 +1,25 @@
#!/bin/bash
##
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
##
## Parameters:
##
## $1: Extensions directory
## $2: Registry directory
## $3: The black list
set -e
if [ ! -d $1 ] ; then
mkdir -p $1
# Parse each of the extensions in the registry
find $2 -name doc -type d -prune -o -name "*.txt" -print | \
grep -v -f $3 | sort | bin/parse_spec.pl $1
fi

View File

@ -0,0 +1,14 @@
EXT/draw_range_elements.txt
EXT/static_vertex_array.txt
EXT/vertex_array_set.alt.txt
EXT/vertex_array_set.txt
EXT/nurbs_tessellator.txt
EXT/object_space_tess.txt
SGI/filter4_parameters.txt
SGIS/texture_color_mask.txt
SGIX/dmbuffer.txt
SGIX/instruments.txt
SGIX/video_source.txt
SGIX/hyperpipe_group.txt
OES/OES_fixed_point.txt
OES/OES_query_matrix.txt

View File

@ -0,0 +1,86 @@
EGL_VERSION_1_0
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_NO_CONTEXT ((EGLContext)0)
EGL_NO_DISPLAY ((EGLDisplay)0)
EGL_NO_SURFACE ((EGLSurface)0)
EGL_DONT_CARE ((EGLint)-1)
EGL_FALSE 0
EGL_PBUFFER_BIT 0x0001
EGL_PIXMAP_BIT 0x0002
EGL_WINDOW_BIT 0x0004
EGL_SUCCESS 0x3000
EGL_NOT_INITIALIZED 0x3001
EGL_BAD_ACCESS 0x3002
EGL_BAD_ALLOC 0x3003
EGL_BAD_ATTRIBUTE 0x3004
EGL_BAD_CONFIG 0x3005
EGL_BAD_CONTEXT 0x3006
EGL_BAD_CURRENT_SURFACE 0x3007
EGL_BAD_DISPLAY 0x3008
EGL_BAD_MATCH 0x3009
EGL_BAD_NATIVE_PIXMAP 0x300A
EGL_BAD_NATIVE_WINDOW 0x300B
EGL_BAD_PARAMETER 0x300C
EGL_BAD_SURFACE 0x300D
EGL_BUFFER_SIZE 0x3020
EGL_ALPHA_SIZE 0x3021
EGL_BLUE_SIZE 0x3022
EGL_GREEN_SIZE 0x3023
EGL_RED_SIZE 0x3024
EGL_DEPTH_SIZE 0x3025
EGL_STENCIL_SIZE 0x3026
EGL_CONFIG_CAVEAT 0x3027
EGL_CONFIG_ID 0x3028
EGL_LEVEL 0x3029
EGL_MAX_PBUFFER_HEIGHT 0x302A
EGL_MAX_PBUFFER_PIXELS 0x302B
EGL_MAX_PBUFFER_WIDTH 0x302C
EGL_NATIVE_RENDERABLE 0x302D
EGL_NATIVE_VISUAL_ID 0x302E
EGL_NATIVE_VISUAL_TYPE 0x302F
EGL_SAMPLES 0x3031
EGL_SAMPLE_BUFFERS 0x3032
EGL_SURFACE_TYPE 0x3033
EGL_TRANSPARENT_TYPE 0x3034
EGL_TRANSPARENT_BLUE_VALUE 0x3035
EGL_TRANSPARENT_GREEN_VALUE 0x3036
EGL_TRANSPARENT_RED_VALUE 0x3037
EGL_NONE 0x3038
EGL_SLOW_CONFIG 0x3050
EGL_NON_CONFORMANT_CONFIG 0x3051
EGL_TRANSPARENT_RGB 0x3052
EGL_VENDOR 0x3053
EGL_VERSION 0x3054
EGL_EXTENSIONS 0x3055
EGL_HEIGHT 0x3056
EGL_WIDTH 0x3057
EGL_LARGEST_PBUFFER 0x3058
EGL_DRAW 0x3059
EGL_READ 0x305A
EGL_CORE_NATIVE_ENGINE 0x305B
EGL_TRUE 1
EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config)
EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint * attrib_list)
EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint * attrib_list)
EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint * attrib_list)
EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list)
EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx)
EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface)
EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value)
EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig * configs, EGLint config_size, EGLint * num_config)
EGLDisplay eglGetCurrentDisplay ( void )
EGLSurface eglGetCurrentSurface (EGLint readdraw)
EGLDisplay eglGetDisplay (EGLNativeDisplayType display_id)
EGLint eglGetError ( void )
EGLBoolean eglInitialize (EGLDisplay dpy, EGLint * major, EGLint * minor)
EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint * value)
const char * eglQueryString (EGLDisplay dpy, EGLint name)
EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint * value)
EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface surface)
EGLBoolean eglTerminate (EGLDisplay dpy)
EGLBoolean eglWaitGL ( void )
EGLBoolean eglWaitNative (EGLint engine)

View File

@ -0,0 +1,22 @@
EGL_VERSION_1_1
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_CONTEXT_LOST 0x300E
EGL_BIND_TO_TEXTURE_RGB 0x3039
EGL_BIND_TO_TEXTURE_RGBA 0x303A
EGL_MIN_SWAP_INTERVAL 0x303B
EGL_MAX_SWAP_INTERVAL 0x303C
EGL_NO_TEXTURE 0x305C
EGL_TEXTURE_RGB 0x305D
EGL_TEXTURE_RGBA 0x305E
EGL_TEXTURE_2D 0x305F
EGL_TEXTURE_FORMAT 0x3080
EGL_TEXTURE_TARGET 0x3081
EGL_MIPMAP_TEXTURE 0x3082
EGL_MIPMAP_LEVEL 0x3083
EGL_BACK_BUFFER 0x3084
EGLBoolean eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer)
EGLBoolean eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer)
EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
EGLBoolean eglSwapInterval (EGLDisplay dpy, EGLint interval)

View File

@ -0,0 +1,38 @@
EGL_VERSION_1_2
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_UNKNOWN ((EGLint)-1)
EGL_OPENGL_ES_BIT 0x0001
EGL_OPENVG_BIT 0x0002
EGL_LUMINANCE_SIZE 0x303D
EGL_ALPHA_MASK_SIZE 0x303E
EGL_COLOR_BUFFER_TYPE 0x303F
EGL_RENDERABLE_TYPE 0x3040
EGL_SINGLE_BUFFER 0x3085
EGL_RENDER_BUFFER 0x3086
EGL_COLORSPACE 0x3087
EGL_ALPHA_FORMAT 0x3088
EGL_COLORSPACE_sRGB 0x3089
EGL_COLORSPACE_LINEAR 0x308A
EGL_ALPHA_FORMAT_NONPRE 0x308B
EGL_ALPHA_FORMAT_PRE 0x308C
EGL_CLIENT_APIS 0x308D
EGL_RGB_BUFFER 0x308E
EGL_LUMINANCE_BUFFER 0x308F
EGL_HORIZONTAL_RESOLUTION 0x3090
EGL_VERTICAL_RESOLUTION 0x3091
EGL_PIXEL_ASPECT_RATIO 0x3092
EGL_SWAP_BEHAVIOR 0x3093
EGL_BUFFER_PRESERVED 0x3094
EGL_BUFFER_DESTROYED 0x3095
EGL_OPENVG_IMAGE 0x3096
EGL_CONTEXT_CLIENT_TYPE 0x3097
EGL_OPENGL_ES_API 0x30A0
EGL_OPENVG_API 0x30A1
EGL_DISPLAY_SCALING 10000
EGLBoolean eglBindAPI (EGLenum api)
EGLSurface eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint * attrib_list)
EGLenum eglQueryAPI ( void )
EGLBoolean eglReleaseThread ( void )
EGLBoolean eglWaitClient ( void )

View File

@ -0,0 +1,16 @@
EGL_VERSION_1_3
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_OPENGL_ES2_BIT 0x0004
EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
EGL_MATCH_NATIVE_PIXMAP 0x3041
EGL_CONFORMANT 0x3042
EGL_VG_COLORSPACE 0x3087
EGL_VG_ALPHA_FORMAT 0x3088
EGL_VG_COLORSPACE_sRGB 0x3089
EGL_VG_COLORSPACE_LINEAR 0x308A
EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
EGL_VG_ALPHA_FORMAT_PRE 0x308C
EGL_CONTEXT_CLIENT_VERSION 0x3098

View File

@ -0,0 +1,13 @@
EGL_VERSION_1_4
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
EGL_OPENGL_BIT 0x0008
EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
EGL_MULTISAMPLE_RESOLVE 0x3099
EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
EGL_OPENGL_API 0x30A2
EGLContext eglGetCurrentContext ( void )

View File

@ -0,0 +1,59 @@
EGL_VERSION_1_5
https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf
EGL_NO_IMAGE ((EGLImage)0)
EGL_NO_SYNC ((EGLSync)0)
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
EGL_OPENGL_ES3_BIT 0x00000040
EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
EGL_GL_COLORSPACE_SRGB 0x3089
EGL_GL_COLORSPACE_LINEAR 0x308A
EGL_CONTEXT_MAJOR_VERSION 0x3098
EGL_CL_EVENT_HANDLE 0x309C
EGL_GL_COLORSPACE 0x309D
EGL_GL_TEXTURE_2D 0x30B1
EGL_GL_TEXTURE_3D 0x30B2
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
EGL_GL_RENDERBUFFER 0x30B9
EGL_GL_TEXTURE_LEVEL 0x30BC
EGL_GL_TEXTURE_ZOFFSET 0x30BD
EGL_IMAGE_PRESERVED 0x30D2
EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
EGL_SYNC_STATUS 0x30F1
EGL_SIGNALED 0x30F2
EGL_UNSIGNALED 0x30F3
EGL_TIMEOUT_EXPIRED 0x30F5
EGL_CONDITION_SATISFIED 0x30F6
EGL_SYNC_TYPE 0x30F7
EGL_SYNC_CONDITION 0x30F8
EGL_SYNC_FENCE 0x30F9
EGL_CONTEXT_MINOR_VERSION 0x30FB
EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
EGL_SYNC_CL_EVENT 0x30FE
EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
EGL_CONTEXT_OPENGL_DEBUG 0x31B0
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
EGL_NO_RESET_NOTIFICATION 0x31BE
EGL_LOSE_CONTEXT_ON_RESET 0x31BF
EGL_FOREVER 0xFFFFFFFFFFFFFFFF
EGLint eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
EGLImage eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib * attrib_list)
EGLSurface eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLAttrib * attrib_list)
EGLSurface eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list)
EGLSync eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib * attrib_list)
EGLBoolean eglDestroyImage (EGLDisplay dpy, EGLImage image)
EGLBoolean eglDestroySync (EGLDisplay dpy, EGLSync sync)
EGLDisplay eglGetPlatformDisplay (EGLenum platform, void * native_display, const EGLAttrib * attrib_list)
EGLBoolean eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib * value)
EGLBoolean eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags)

View File

@ -0,0 +1,23 @@
GLX_AMD_gpu_association
http://www.opengl.org/registry/specs/AMD/glx_gpu_association.txt
GLX_AMD_gpu_association
GLX_GPU_VENDOR_AMD 0x1F00
GLX_GPU_RENDERER_STRING_AMD 0x1F01
GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
GLX_GPU_RAM_AMD 0x21A3
GLX_GPU_CLOCK_AMD 0x21A4
GLX_GPU_NUM_PIPES_AMD 0x21A5
GLX_GPU_NUM_SIMD_AMD 0x21A6
GLX_GPU_NUM_RB_AMD 0x21A7
GLX_GPU_NUM_SPI_AMD 0x21A8
void glXBlitContextFramebufferAMD (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
GLXContext glXCreateAssociatedContextAMD (unsigned int id, GLXContext share_list)
GLXContext glXCreateAssociatedContextAttribsAMD (unsigned int id, GLXContext share_context, const int* attribList)
Bool glXDeleteAssociatedContextAMD (GLXContext ctx)
unsigned int glXGetContextGPUIDAMD (GLXContext ctx)
GLXContext glXGetCurrentAssociatedContextAMD (void)
unsigned int glXGetGPUIDsAMD (unsigned int maxCount, unsigned int* ids)
int glXGetGPUInfoAMD (unsigned int id, int property, GLenum dataType, unsigned int size, void* data)
Bool glXMakeAssociatedContextCurrentAMD (GLXContext ctx)

View File

@ -0,0 +1,5 @@
GLX_ARB_get_proc_address
http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt
GLX_ARB_get_proc_address
extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);

View File

@ -0,0 +1,5 @@
GLX_ATI_pixel_format_float
GLX_ATI_pixel_format_float
GLX_RGBA_FLOAT_ATI_BIT 0x00000100

View File

@ -0,0 +1,42 @@
GLX_ATI_render_texture
GLX_ATI_render_texture
GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800
GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801
GLX_TEXTURE_FORMAT_ATI 0x9802
GLX_TEXTURE_TARGET_ATI 0x9803
GLX_MIPMAP_TEXTURE_ATI 0x9804
GLX_TEXTURE_RGB_ATI 0x9805
GLX_TEXTURE_RGBA_ATI 0x9806
GLX_NO_TEXTURE_ATI 0x9807
GLX_TEXTURE_CUBE_MAP_ATI 0x9808
GLX_TEXTURE_1D_ATI 0x9809
GLX_TEXTURE_2D_ATI 0x980A
GLX_MIPMAP_LEVEL_ATI 0x980B
GLX_CUBE_MAP_FACE_ATI 0x980C
GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D
GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E
GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F
GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810
GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811
GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812
GLX_FRONT_LEFT_ATI 0x9813
GLX_FRONT_RIGHT_ATI 0x9814
GLX_BACK_LEFT_ATI 0x9815
GLX_BACK_RIGHT_ATI 0x9816
GLX_AUX0_ATI 0x9817
GLX_AUX1_ATI 0x9818
GLX_AUX2_ATI 0x9819
GLX_AUX3_ATI 0x981A
GLX_AUX4_ATI 0x981B
GLX_AUX5_ATI 0x981C
GLX_AUX6_ATI 0x981D
GLX_AUX7_ATI 0x981E
GLX_AUX8_ATI 0x981F
GLX_AUX9_ATI 0x9820
GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821
GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822
void glXBindTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer)
void glXReleaseTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer)
void glXDrawableAttribATI (Display *dpy, GLXDrawable draw, const int *attrib_list)

View File

@ -0,0 +1,5 @@
GLX_EXT_create_context_es2_profile
http://www.opengl.org/registry/specs/EXT/glx_create_context_es2_profile.txt
GLX_EXT_create_context_es2_profile
GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004

View File

@ -0,0 +1,5 @@
GLX_EXT_create_context_es_profile
http://www.opengl.org/registry/specs/EXT/glx_create_context_es_profile.txt
GLX_EXT_create_context_es_profile
GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004

View File

@ -0,0 +1,6 @@
GLX_EXT_fbconfig_packed_float
http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt
GLX_EXT_fbconfig_packed_float
GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008

View File

@ -0,0 +1,5 @@
GLX_EXT_framebuffer_sRGB
http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt
GLX_EXT_framebuffer_sRGB
GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2

View File

@ -0,0 +1,6 @@
GLX_MESA_swap_control
http://cgit.freedesktop.org/mesa/mesa/plain/docs/MESA_swap_control.spec
GLX_MESA_swap_control
int glXGetSwapIntervalMESA (void)
int glXSwapIntervalMESA (unsigned int interval)

View File

@ -0,0 +1,5 @@
GLX_NV_float_buffer
http://cvs1.nvidia.com/inc/GL/glxtokens.h
GLX_NV_float_buffer
GLX_FLOAT_COMPONENTS_NV 0x20B0

View File

@ -0,0 +1,6 @@
GLX_NV_vertex_array_range
http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt
GLX_NV_vertex_array_range
void * glXAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority)
void glXFreeMemoryNV (void *pointer)

View File

@ -0,0 +1,6 @@
GLX_SGIS_shared_multisample
GLX_SGIS_shared_multisample
GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027

View File

@ -0,0 +1,26 @@
GLX_SGIX_hyperpipe
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt
GLX_SGIX_hyperpipe
GLX_HYPERPIPE_ID_SGIX 0x8030
GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
GLX_PIPE_RECT_SGIX 0x00000001
GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
GLX_HYPERPIPE_STEREO_SGIX 0x00000003
GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
GLX_BAD_HYPERPIPE_SGIX 92
typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int networkId; } GLXHyperpipeNetworkSGIX;
typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int channel; unsigned int participationType; int timeSlice; } GLXHyperpipeConfigSGIX;
typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int srcXOrigin; int srcYOrigin; int srcWidth; int srcHeight; int destXOrigin; int destYOrigin; int destWidth; int destHeight; } GLXPipeRect;
typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int XOrigin; int YOrigin; int maxHeight; int maxWidth; } GLXPipeRectLimits;
GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes)
int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId)
GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes)
int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId)
int glXBindHyperpipeSGIX (Display *dpy, int hpId)
int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList)
int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList)
int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList)

View File

@ -0,0 +1,6 @@
GLX_SGIX_swap_barrier
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt
GLX_SGIX_swap_barrier
void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier)
Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max)

View File

@ -0,0 +1,5 @@
GLX_SGIX_swap_group
http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_group.txt
GLX_SGIX_swap_group
void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member)

View File

@ -0,0 +1,6 @@
GLX_SGI_video_sync
http://www.opengl.org/registry/specs/SGI/video_sync.txt
GLX_SGI_video_sync
int glXGetVideoSyncSGI (unsigned int* count)
int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int* count)

View File

@ -0,0 +1,8 @@
GLX_SUN_video_resize
http://wwws.sun.com/software/graphics/opengl/extensions/glx_sun_video_resize.txt
GLX_SUN_video_resize
GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD
GLX_VIDEO_RESIZE_SUN 0x8171
int glXVideoResizeSUN (Display* display, GLXDrawable window, float factor)
int glXGetVideoResizeSUN (Display* display, GLXDrawable window, float* factor)

View File

@ -0,0 +1,5 @@
GLX_VERSION_1_2
http://www.opengl.org/documentation/specs/glx/glx1.2.ps
GLX_VERSION_1_2
Display* glXGetCurrentDisplay (void)

View File

@ -0,0 +1,83 @@
GLX_VERSION_1_3
http://www.opengl.org/documentation/specs/glx/glx1.3.pdf
GLX_VERSION_1_3
GLX_WINDOW_BIT 0x00000001
GLX_PIXMAP_BIT 0x00000002
GLX_PBUFFER_BIT 0x00000004
GLX_RGBA_BIT 0x00000001
GLX_COLOR_INDEX_BIT 0x00000002
GLX_PBUFFER_CLOBBER_MASK 0x08000000
GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
GLX_BACK_LEFT_BUFFER_BIT 0x00000004
GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
GLX_AUX_BUFFERS_BIT 0x00000010
GLX_DEPTH_BUFFER_BIT 0x00000020
GLX_STENCIL_BUFFER_BIT 0x00000040
GLX_ACCUM_BUFFER_BIT 0x00000080
GLX_CONFIG_CAVEAT 0x20
GLX_X_VISUAL_TYPE 0x22
GLX_TRANSPARENT_TYPE 0x23
GLX_TRANSPARENT_INDEX_VALUE 0x24
GLX_TRANSPARENT_RED_VALUE 0x25
GLX_TRANSPARENT_GREEN_VALUE 0x26
GLX_TRANSPARENT_BLUE_VALUE 0x27
GLX_TRANSPARENT_ALPHA_VALUE 0x28
GLX_DONT_CARE 0xFFFFFFFF
GLX_NONE 0x8000
GLX_SLOW_CONFIG 0x8001
GLX_TRUE_COLOR 0x8002
GLX_DIRECT_COLOR 0x8003
GLX_PSEUDO_COLOR 0x8004
GLX_STATIC_COLOR 0x8005
GLX_GRAY_SCALE 0x8006
GLX_STATIC_GRAY 0x8007
GLX_TRANSPARENT_RGB 0x8008
GLX_TRANSPARENT_INDEX 0x8009
GLX_VISUAL_ID 0x800B
GLX_SCREEN 0x800C
GLX_NON_CONFORMANT_CONFIG 0x800D
GLX_DRAWABLE_TYPE 0x8010
GLX_RENDER_TYPE 0x8011
GLX_X_RENDERABLE 0x8012
GLX_FBCONFIG_ID 0x8013
GLX_RGBA_TYPE 0x8014
GLX_COLOR_INDEX_TYPE 0x8015
GLX_MAX_PBUFFER_WIDTH 0x8016
GLX_MAX_PBUFFER_HEIGHT 0x8017
GLX_MAX_PBUFFER_PIXELS 0x8018
GLX_PRESERVED_CONTENTS 0x801B
GLX_LARGEST_PBUFFER 0x801C
GLX_WIDTH 0x801D
GLX_HEIGHT 0x801E
GLX_EVENT_MASK 0x801F
GLX_DAMAGED 0x8020
GLX_SAVED 0x8021
GLX_WINDOW 0x8022
GLX_PBUFFER 0x8023
GLX_PBUFFER_HEIGHT 0x8040
GLX_PBUFFER_WIDTH 0x8041
GLXFBConfig* glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements)
GLXFBConfig* glXGetFBConfigs (Display *dpy, int screen, int *nelements)
XVisualInfo* glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config)
int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value)
GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list)
void glXDestroyWindow (Display *dpy, GLXWindow win)
GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list)
void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap)
GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list)
void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf)
void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)
GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
Bool glXMakeContextCurrent (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
GLXDrawable glXGetCurrentReadDrawable (void)
int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value)
void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask)
void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask)
typedef XID GLXWindow
typedef XID GLXPbuffer
typedef XID GLXFBConfigID
typedef struct __GLXFBConfigRec *GLXFBConfig
typedef struct { int event_type; int draw_type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; unsigned int buffer_mask; unsigned int aux_buffer; int x, y; int width, height; int count; } GLXPbufferClobberEvent;
typedef union __GLXEvent { GLXPbufferClobberEvent glxpbufferclobber; long pad[24]; } GLXEvent;

View File

@ -0,0 +1,7 @@
GLX_VERSION_1_4
http://www.opengl.org/documentation/specs/glx/glx1.4.pdf
GLX_VERSION_1_4
GLX_SAMPLE_BUFFERS 100000
GLX_SAMPLES 100001
extern void ( * glXGetProcAddress (const GLubyte *procName)) (void);

View File

@ -0,0 +1,18 @@
GL_APPLE_float_pixels
http://www.opengl.org/registry/specs/APPLE/float_pixels.txt
GL_APPLE_float_pixels
GL_HALF_APPLE 0x140B
GL_COLOR_FLOAT_APPLE 0x8A0F
GL_RGBA_FLOAT32_APPLE 0x8814
GL_RGB_FLOAT32_APPLE 0x8815
GL_ALPHA_FLOAT32_APPLE 0x8816
GL_INTENSITY_FLOAT32_APPLE 0x8817
GL_LUMINANCE_FLOAT32_APPLE 0x8818
GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
GL_RGBA_FLOAT16_APPLE 0x881A
GL_RGB_FLOAT16_APPLE 0x881B
GL_ALPHA_FLOAT16_APPLE 0x881C
GL_INTENSITY_FLOAT16_APPLE 0x881D
GL_LUMINANCE_FLOAT16_APPLE 0x881E
GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F

View File

@ -0,0 +1,5 @@
GL_APPLE_pixel_buffer
GL_APPLE_pixel_buffer
GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10

View File

@ -0,0 +1,13 @@
GL_APPLE_texture_range
http://www.opengl.org/registry/specs/APPLE/texture_range.txt
GL_APPLE_texture_range
GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
GL_STORAGE_PRIVATE_APPLE 0x85BD
GL_STORAGE_CACHED_APPLE 0x85BE
GL_STORAGE_SHARED_APPLE 0x85BF
GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
void glTextureRangeAPPLE (GLenum target, GLsizei length, void *pointer)
void glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params)

View File

@ -0,0 +1,4 @@
GL_ARB_draw_instanced
http://www.opengl.org/registry/specs/ARB/draw_instanced.txt
GL_ARB_draw_instanced

View File

@ -0,0 +1,113 @@
GL_ARB_imaging
GL_ARB_imaging
GL_CONSTANT_COLOR 0x8001
GL_ONE_MINUS_CONSTANT_COLOR 0x8002
GL_CONSTANT_ALPHA 0x8003
GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
GL_BLEND_COLOR 0x8005
GL_FUNC_ADD 0x8006
GL_MIN 0x8007
GL_MAX 0x8008
GL_BLEND_EQUATION 0x8009
GL_FUNC_SUBTRACT 0x800A
GL_FUNC_REVERSE_SUBTRACT 0x800B
GL_CONVOLUTION_1D 0x8010
GL_CONVOLUTION_2D 0x8011
GL_SEPARABLE_2D 0x8012
GL_CONVOLUTION_BORDER_MODE 0x8013
GL_CONVOLUTION_FILTER_SCALE 0x8014
GL_CONVOLUTION_FILTER_BIAS 0x8015
GL_REDUCE 0x8016
GL_CONVOLUTION_FORMAT 0x8017
GL_CONVOLUTION_WIDTH 0x8018
GL_CONVOLUTION_HEIGHT 0x8019
GL_MAX_CONVOLUTION_WIDTH 0x801A
GL_MAX_CONVOLUTION_HEIGHT 0x801B
GL_POST_CONVOLUTION_RED_SCALE 0x801C
GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
GL_POST_CONVOLUTION_RED_BIAS 0x8020
GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
GL_HISTOGRAM 0x8024
GL_PROXY_HISTOGRAM 0x8025
GL_HISTOGRAM_WIDTH 0x8026
GL_HISTOGRAM_FORMAT 0x8027
GL_HISTOGRAM_RED_SIZE 0x8028
GL_HISTOGRAM_GREEN_SIZE 0x8029
GL_HISTOGRAM_BLUE_SIZE 0x802A
GL_HISTOGRAM_ALPHA_SIZE 0x802B
GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
GL_HISTOGRAM_SINK 0x802D
GL_MINMAX 0x802E
GL_MINMAX_FORMAT 0x802F
GL_MINMAX_SINK 0x8030
GL_TABLE_TOO_LARGE 0x8031
GL_COLOR_MATRIX 0x80B1
GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
GL_COLOR_TABLE 0x80D0
GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
GL_PROXY_COLOR_TABLE 0x80D3
GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
GL_COLOR_TABLE_SCALE 0x80D6
GL_COLOR_TABLE_BIAS 0x80D7
GL_COLOR_TABLE_FORMAT 0x80D8
GL_COLOR_TABLE_WIDTH 0x80D9
GL_COLOR_TABLE_RED_SIZE 0x80DA
GL_COLOR_TABLE_GREEN_SIZE 0x80DB
GL_COLOR_TABLE_BLUE_SIZE 0x80DC
GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
GL_IGNORE_BORDER 0x8150
GL_CONSTANT_BORDER 0x8151
GL_WRAP_BORDER 0x8152
GL_REPLICATE_BORDER 0x8153
GL_CONVOLUTION_BORDER_COLOR 0x8154
void glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table)
void glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data)
void glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params)
void glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params)
void glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
void glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
void glGetColorTable (GLenum target, GLenum format, GLenum type, void *table)
void glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params)
void glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params)
void glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
void glResetHistogram (GLenum target)
void glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values)
void glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params)
void glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params)
void glMinmax (GLenum target, GLenum internalformat, GLboolean sink)
void glResetMinmax (GLenum target)
void glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params)
void glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params)
void glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image)
void glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image)
void glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params)
void glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params)
void glConvolutionParameteri (GLenum target, GLenum pname, GLint params)
void glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params)
void glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
void glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
void glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image)
void glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params)
void glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params)
void glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column)
void glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span)
void glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values)

View File

@ -0,0 +1,8 @@
GL_ARB_instanced_arrays
http://www.opengl.org/registry/specs/ARB/instanced_arrays.txt
GL_ARB_instanced_arrays
GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
void glVertexAttribDivisorARB (GLuint index, GLuint divisor)
void glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount)
void glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount)

Some files were not shown because too many files have changed in this diff Show More