GL extensions cleanup.

This commit is contained in:
leo 2015-05-09 19:54:29 +00:00
parent 77e103264d
commit 7170c1d0ee
24 changed files with 12372 additions and 1005 deletions

View file

@ -5,7 +5,6 @@
#include <string.h>
#include <math.h>
#include <float.h>
#include "opengl.h"
#include "lc_file.h"
#include "camera.h"
#include "view.h"

View file

@ -1,5 +1,4 @@
#include "lc_global.h"
#include "opengl.h"
#include "debug.h"
#ifdef LC_DEBUG

View file

@ -5,7 +5,6 @@
#include "lc_library.h"
#include "lc_profile.h"
#include "system.h"
#include "opengl.h"
#include "project.h"
#include "image.h"
#include "lc_mainwindow.h"

View file

@ -1,7 +1,6 @@
#ifndef _LC_COLORS_H_
#define _LC_COLORS_H_
#include "opengl.h"
#include "lc_array.h"
#include "lc_math.h"

View file

@ -1,5 +1,6 @@
#include "lc_global.h"
#include "lc_context.h"
#include "lc_glextensions.h"
#include "lc_mesh.h"
#include "lc_texture.h"
#include "lc_colors.h"
@ -93,7 +94,7 @@ void lcContext::SetDefaultState()
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
@ -197,7 +198,7 @@ void lcContext::SetInterfaceColor(lcInterfaceColor InterfaceColor)
bool lcContext::BeginRenderToTexture(int Width, int Height)
{
if (GL_SupportsFramebufferObjectARB)
if (gSupportsFramebufferObjectARB)
{
glGenFramebuffers(1, &mFramebufferObject);
glGenTextures(1, &mFramebufferTexture);
@ -226,7 +227,7 @@ bool lcContext::BeginRenderToTexture(int Width, int Height)
return true;
}
if (GL_SupportsFramebufferObjectEXT)
if (gSupportsFramebufferObjectEXT)
{
glGenFramebuffersEXT(1, &mFramebufferObject);
glGenTextures(1, &mFramebufferTexture);
@ -263,7 +264,7 @@ bool lcContext::BeginRenderToTexture(int Width, int Height)
void lcContext::EndRenderToTexture()
{
if (GL_SupportsFramebufferObjectARB)
if (gSupportsFramebufferObjectARB)
{
glDeleteFramebuffers(1, &mFramebufferObject);
mFramebufferObject = 0;
@ -275,7 +276,7 @@ void lcContext::EndRenderToTexture()
return;
}
if (GL_SupportsFramebufferObjectEXT)
if (gSupportsFramebufferObjectEXT)
{
glDeleteFramebuffersEXT(1, &mFramebufferObject);
mFramebufferObject = 0;
@ -335,7 +336,7 @@ lcVertexBuffer lcContext::CreateVertexBuffer(int Size, const void* Data)
{
lcVertexBuffer VertexBuffer;
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
glGenBuffers(1, &VertexBuffer.Object);
glBindBuffer(GL_ARRAY_BUFFER_ARB, VertexBuffer.Object);
@ -358,7 +359,7 @@ void lcContext::DestroyVertexBuffer(lcVertexBuffer& VertexBuffer)
if (!VertexBuffer.IsValid())
return;
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
if (mVertexBufferObject == VertexBuffer.Object)
{
@ -380,7 +381,7 @@ lcIndexBuffer lcContext::CreateIndexBuffer(int Size, const void* Data)
{
lcIndexBuffer IndexBuffer;
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
glGenBuffers(1, &IndexBuffer.Object);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, IndexBuffer.Object);
@ -403,7 +404,7 @@ void lcContext::DestroyIndexBuffer(lcIndexBuffer& IndexBuffer)
if (!IndexBuffer.IsValid())
return;
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
if (mIndexBufferObject == IndexBuffer.Object)
{
@ -441,7 +442,7 @@ void lcContext::ClearVertexBuffer()
void lcContext::SetVertexBuffer(lcVertexBuffer VertexBuffer)
{
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
GLuint VertexBufferObject = VertexBuffer.Object;
mVertexBufferPointer = NULL;
@ -462,7 +463,7 @@ void lcContext::SetVertexBuffer(lcVertexBuffer VertexBuffer)
void lcContext::SetVertexBufferPointer(const void* VertexBuffer)
{
if (GL_HasVertexBufferObject() && mVertexBufferObject)
if (gSupportsVertexBufferObject && mVertexBufferObject)
{
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
mVertexBufferObject = 0;
@ -527,7 +528,7 @@ void lcContext::ClearIndexBuffer()
void lcContext::SetIndexBuffer(lcIndexBuffer IndexBuffer)
{
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
GLuint IndexBufferObject = IndexBuffer.Object;
mIndexBufferPointer = NULL;
@ -608,7 +609,7 @@ void lcContext::UnbindMesh()
mTexture = NULL;
}
if (GL_HasVertexBufferObject())
if (gSupportsVertexBufferObject)
{
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
mVertexBufferObject = 0;

11847
common/lc_glext.h Normal file

File diff suppressed because it is too large Load diff

285
common/lc_glextensions.cpp Normal file
View file

@ -0,0 +1,285 @@
#include "lc_global.h"
#include "lc_glextensions.h"
bool gSupportsShaderObjects;
bool gSupportsVertexBufferObject;
bool gSupportsFramebufferObjectARB;
bool gSupportsFramebufferObjectEXT;
bool gSupportsAnisotropic;
GLfloat gMaxAnisotropy;
PFNGLBINDBUFFERARBPROC lcBindBufferARB;
PFNGLDELETEBUFFERSARBPROC lcDeleteBuffersARB;
PFNGLGENBUFFERSARBPROC lcGenBuffersARB;
PFNGLISBUFFERARBPROC lcIsBufferARB;
PFNGLBUFFERDATAARBPROC lcBufferDataARB;
PFNGLBUFFERSUBDATAARBPROC lcBufferSubDataARB;
PFNGLGETBUFFERSUBDATAARBPROC lcGetBufferSubDataARB;
PFNGLMAPBUFFERARBPROC lcMapBufferARB;
PFNGLUNMAPBUFFERARBPROC lcUnmapBufferARB;
PFNGLGETBUFFERPARAMETERIVARBPROC lcGetBufferParameterivARB;
PFNGLGETBUFFERPOINTERVARBPROC lcGetBufferPointervARB;
PFNGLISRENDERBUFFERPROC lcIsRenderbuffer;
PFNGLBINDRENDERBUFFERPROC lcBindRenderbuffer;
PFNGLDELETERENDERBUFFERSPROC lcDeleteRenderbuffers;
PFNGLGENRENDERBUFFERSPROC lcGenRenderbuffers;
PFNGLRENDERBUFFERSTORAGEPROC lcRenderbufferStorage;
PFNGLGETRENDERBUFFERPARAMETERIVPROC lcGetRenderbufferParameteriv;
PFNGLISFRAMEBUFFERPROC lcIsFramebuffer;
PFNGLBINDFRAMEBUFFERPROC lcBindFramebuffer;
PFNGLDELETEFRAMEBUFFERSPROC lcDeleteFramebuffers;
PFNGLGENFRAMEBUFFERSPROC lcGenFramebuffers;
PFNGLCHECKFRAMEBUFFERSTATUSPROC lcCheckFramebufferStatus;
PFNGLFRAMEBUFFERTEXTURE1DPROC lcFramebufferTexture1D;
PFNGLFRAMEBUFFERTEXTURE2DPROC lcFramebufferTexture2D;
PFNGLFRAMEBUFFERTEXTURE3DPROC lcFramebufferTexture3D;
PFNGLFRAMEBUFFERRENDERBUFFERPROC lcFramebufferRenderbuffer;
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC lcGetFramebufferAttachmentParameteriv;
PFNGLGENERATEMIPMAPPROC lcGenerateMipmap;
PFNGLBLITFRAMEBUFFERPROC lcBlitFramebuffer;
PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC lcRenderbufferStorageMultisample;
PFNGLFRAMEBUFFERTEXTURELAYERPROC lcFramebufferTextureLayer;
PFNGLISRENDERBUFFEREXTPROC lcIsRenderbufferEXT;
PFNGLBINDRENDERBUFFEREXTPROC lcBindRenderbufferEXT;
PFNGLDELETERENDERBUFFERSEXTPROC lcDeleteRenderbuffersEXT;
PFNGLGENRENDERBUFFERSEXTPROC lcGenRenderbuffersEXT;
PFNGLRENDERBUFFERSTORAGEEXTPROC lcRenderbufferStorageEXT;
PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC lcGetRenderbufferParameterivEXT;
PFNGLISFRAMEBUFFEREXTPROC lcIsFramebufferEXT;
PFNGLBINDFRAMEBUFFEREXTPROC lcBindFramebufferEXT;
PFNGLDELETEFRAMEBUFFERSEXTPROC lcDeleteFramebuffersEXT;
PFNGLGENFRAMEBUFFERSEXTPROC lcGenFramebuffersEXT;
PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC lcCheckFramebufferStatusEXT;
PFNGLFRAMEBUFFERTEXTURE1DEXTPROC lcFramebufferTexture1DEXT;
PFNGLFRAMEBUFFERTEXTURE2DEXTPROC lcFramebufferTexture2DEXT;
PFNGLFRAMEBUFFERTEXTURE3DEXTPROC lcFramebufferTexture3DEXT;
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC lcFramebufferRenderbufferEXT;
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC lcGetFramebufferAttachmentParameterivEXT;
PFNGLGENERATEMIPMAPEXTPROC lcGenerateMipmapEXT;
PFNGLDELETEOBJECTARBPROC lcDeleteObjectARB;
PFNGLGETHANDLEARBPROC lcGetHandleARB;
PFNGLDETACHOBJECTARBPROC lcDetachObjectARB;
PFNGLCREATESHADEROBJECTARBPROC lcCreateShaderObjectARB;
PFNGLSHADERSOURCEARBPROC lcShaderSourceARB;
PFNGLCOMPILESHADERARBPROC lcCompileShaderARB;
PFNGLCREATEPROGRAMOBJECTARBPROC lcCreateProgramObjectARB;
PFNGLATTACHOBJECTARBPROC lcAttachObjectARB;
PFNGLLINKPROGRAMARBPROC lcLinkProgramARB;
PFNGLUSEPROGRAMOBJECTARBPROC lcUseProgramObjectARB;
PFNGLVALIDATEPROGRAMARBPROC lcValidateProgramARB;
PFNGLUNIFORM1FARBPROC lcUniform1fARB;
PFNGLUNIFORM2FARBPROC lcUniform2fARB;
PFNGLUNIFORM3FARBPROC lcUniform3fARB;
PFNGLUNIFORM4FARBPROC lcUniform4fARB;
PFNGLUNIFORM1IARBPROC lcUniform1iARB;
PFNGLUNIFORM2IARBPROC lcUniform2iARB;
PFNGLUNIFORM3IARBPROC lcUniform3iARB;
PFNGLUNIFORM4IARBPROC lcUniform4iARB;
PFNGLUNIFORM1FVARBPROC lcUniform1fvARB;
PFNGLUNIFORM2FVARBPROC lcUniform2fvARB;
PFNGLUNIFORM3FVARBPROC lcUniform3fvARB;
PFNGLUNIFORM4FVARBPROC lcUniform4fvARB;
PFNGLUNIFORM1IVARBPROC lcUniform1ivARB;
PFNGLUNIFORM2IVARBPROC lcUniform2ivARB;
PFNGLUNIFORM3IVARBPROC lcUniform3ivARB;
PFNGLUNIFORM4IVARBPROC lcUniform4ivARB;
PFNGLUNIFORMMATRIX2FVARBPROC lcUniformMatrix2fvARB;
PFNGLUNIFORMMATRIX3FVARBPROC lcUniformMatrix3fvARB;
PFNGLUNIFORMMATRIX4FVARBPROC lcUniformMatrix4fvARB;
PFNGLGETOBJECTPARAMETERFVARBPROC lcGetObjectParameterfvARB;
PFNGLGETOBJECTPARAMETERIVARBPROC lcGetObjectParameterivARB;
PFNGLGETINFOLOGARBPROC lcGetInfoLogARB;
PFNGLGETATTACHEDOBJECTSARBPROC lcGetAttachedObjectsARB;
PFNGLGETUNIFORMLOCATIONARBPROC lcGetUniformLocationARB;
PFNGLGETACTIVEUNIFORMARBPROC lcGetActiveUniformARB;
PFNGLGETUNIFORMFVARBPROC lcGetUniformfvARB;
PFNGLGETUNIFORMIVARBPROC lcGetUniformivARB;
PFNGLGETSHADERSOURCEARBPROC lcGetShaderSourceARB;
PFNGLBINDATTRIBLOCATIONARBPROC lcBindAttribLocationARB;
PFNGLGETACTIVEATTRIBARBPROC lcGetActiveAttribARB;
PFNGLGETATTRIBLOCATIONARBPROC lcGetAttribLocationARB;
static bool lcIsGLExtensionSupported(const GLubyte* Extensions, const char* Name)
{
const GLubyte* Start;
GLubyte* Where;
GLubyte* Terminator;
Where = (GLubyte*)strchr(Name, ' ');
if (Where || *Name == '\0')
return false;
if (!Extensions)
return false;
for (Start = Extensions; ;)
{
Where = (GLubyte*)strstr((const char*)Start, Name);
if (!Where)
break;
Terminator = Where + strlen(Name);
if (Where == Start || *(Where - 1) == ' ')
if (*Terminator == ' ' || *Terminator == '\0')
return true;
Start = Terminator;
}
return false;
}
#ifndef QT_NO_DEBUG
static void APIENTRY lcGLDebugCallback(GLenum Source, GLenum Type, GLuint Id, GLenum Severity, GLsizei Length, const GLchar* Message, GLvoid* UserParam)
{
qDebug() << Message;
}
#endif
void lcInitializeGLExtensions(const QGLContext* Context)
{
const GLubyte* Extensions = glGetString(GL_EXTENSIONS);
#ifndef QT_NO_DEBUG
if (lcIsGLExtensionSupported(Extensions, "GL_KHR_debug"))
{
PFNGLDEBUGMESSAGECALLBACKARBPROC DebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKARBPROC)Context->getProcAddress("glDebugMessageCallback");
if (DebugMessageCallback)
{
DebugMessageCallback((GLDEBUGPROCARB)&lcGLDebugCallback, NULL);
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
}
}
#endif
if (lcIsGLExtensionSupported(Extensions, "GL_EXT_texture_filter_anisotropic"))
{
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gMaxAnisotropy);
gSupportsAnisotropic = true;
}
if (lcIsGLExtensionSupported(Extensions, "GL_ARB_vertex_buffer_object"))
{
lcBindBufferARB = (PFNGLBINDBUFFERARBPROC)Context->getProcAddress("glBindBufferARB");
lcDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)Context->getProcAddress("glDeleteBuffersARB");
lcGenBuffersARB = (PFNGLGENBUFFERSARBPROC)Context->getProcAddress("glGenBuffersARB");
lcIsBufferARB = (PFNGLISBUFFERARBPROC)Context->getProcAddress("glIsBufferARB");
lcBufferDataARB = (PFNGLBUFFERDATAARBPROC)Context->getProcAddress("glBufferDataARB");
lcBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)Context->getProcAddress("glBufferSubDataARB");
lcGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)Context->getProcAddress("glGetBufferSubDataARB");
lcMapBufferARB = (PFNGLMAPBUFFERARBPROC)Context->getProcAddress("glMapBufferARB");
lcUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)Context->getProcAddress("glUnmapBufferARB");
lcGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)Context->getProcAddress("glGetBufferParameterivARB");
lcGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)Context->getProcAddress("glGetBufferPointervARB");
gSupportsVertexBufferObject = true;
}
if (lcIsGLExtensionSupported(Extensions, "GL_ARB_framebuffer_object"))
{
lcIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)Context->getProcAddress("glIsRenderbuffer");
lcBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)Context->getProcAddress("glBindRenderbuffer");
lcDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)Context->getProcAddress("glDeleteRenderbuffers");
lcGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)Context->getProcAddress("glGenRenderbuffers");
lcRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)Context->getProcAddress("glRenderbufferStorage");
lcGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)Context->getProcAddress("glGetRenderbufferParameteriv");
lcIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)Context->getProcAddress("glIsFramebuffer");
lcBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)Context->getProcAddress("glBindFramebuffer");
lcDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)Context->getProcAddress("glDeleteFramebuffers");
lcGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)Context->getProcAddress("glGenFramebuffers");
lcCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)Context->getProcAddress("glCheckFramebufferStatus");
lcFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)Context->getProcAddress("glFramebufferTexture1D");
lcFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)Context->getProcAddress("glFramebufferTexture2D");
lcFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)Context->getProcAddress("glFramebufferTexture3D");
lcFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)Context->getProcAddress("glFramebufferRenderbuffer");
lcGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)Context->getProcAddress("glGetFramebufferAttachmentParameteriv");
lcGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)Context->getProcAddress("glGenerateMipmap");
lcBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)Context->getProcAddress("glBlitFramebuffer");
lcRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)Context->getProcAddress("glRenderbufferStorageMultisample");
lcFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)Context->getProcAddress("glFramebufferTextureLayer");
gSupportsFramebufferObjectARB = true;
}
if (lcIsGLExtensionSupported(Extensions, "GL_EXT_framebuffer_object"))
{
lcIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)Context->getProcAddress("glIsRenderbufferEXT");
lcBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)Context->getProcAddress("glBindRenderbufferEXT");
lcDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)Context->getProcAddress("glDeleteRenderbuffersEXT");
lcGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)Context->getProcAddress("glGenRenderbuffersEXT");
lcRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)Context->getProcAddress("glRenderbufferStorageEXT");
lcGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)Context->getProcAddress("glGetRenderbufferParameterivEXT");
lcIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)Context->getProcAddress("glIsFramebufferEXT");
lcBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)Context->getProcAddress("glBindFramebufferEXT");
lcDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)Context->getProcAddress("glDeleteFramebuffersEXT");
lcGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)Context->getProcAddress("glGenFramebuffersEXT");
lcCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)Context->getProcAddress("glCheckFramebufferStatusEXT");
lcFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)Context->getProcAddress("glFramebufferTexture1DEXT");
lcFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)Context->getProcAddress("glFramebufferTexture2DEXT");
lcFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)Context->getProcAddress("glFramebufferTexture3DEXT");
lcFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)Context->getProcAddress("glFramebufferRenderbufferEXT");
lcGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)Context->getProcAddress("glGetFramebufferAttachmentParameterivEXT");
lcGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)Context->getProcAddress("glGenerateMipmapEXT");
gSupportsFramebufferObjectEXT = true;
}
if (lcIsGLExtensionSupported(Extensions, "GL_ARB_shader_objects") && lcIsGLExtensionSupported(Extensions, "GL_ARB_shading_language_100") &&
lcIsGLExtensionSupported(Extensions, "GL_ARB_vertex_shader") && lcIsGLExtensionSupported(Extensions, "GL_ARB_fragment_shader"))
{
lcDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)Context->getProcAddress("glDeleteObjectARB");
lcGetHandleARB = (PFNGLGETHANDLEARBPROC)Context->getProcAddress("glGetHandleARB");
lcDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)Context->getProcAddress("glDetachObjectARB");
lcCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)Context->getProcAddress("glCreateShaderObjectARB");
lcShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)Context->getProcAddress("glShaderSourceARB");
lcCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)Context->getProcAddress("glCompileShaderARB");
lcCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)Context->getProcAddress("glCreateProgramObjectARB");
lcAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)Context->getProcAddress("glAttachObjectARB");
lcLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)Context->getProcAddress("glLinkProgramARB");
lcUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)Context->getProcAddress("glUseProgramObjectARB");
lcValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)Context->getProcAddress("glValidateProgramARB");
lcUniform1fARB = (PFNGLUNIFORM1FARBPROC)Context->getProcAddress("glUniform1fARB");
lcUniform2fARB = (PFNGLUNIFORM2FARBPROC)Context->getProcAddress("glUniform2fARB");
lcUniform3fARB = (PFNGLUNIFORM3FARBPROC)Context->getProcAddress("glUniform3fARB");
lcUniform4fARB = (PFNGLUNIFORM4FARBPROC)Context->getProcAddress("glUniform4fARB");
lcUniform1iARB = (PFNGLUNIFORM1IARBPROC)Context->getProcAddress("glUniform1iARB");
lcUniform2iARB = (PFNGLUNIFORM2IARBPROC)Context->getProcAddress("glUniform2iARB");
lcUniform3iARB = (PFNGLUNIFORM3IARBPROC)Context->getProcAddress("glUniform3iARB");
lcUniform4iARB = (PFNGLUNIFORM4IARBPROC)Context->getProcAddress("glUniform4iARB");
lcUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)Context->getProcAddress("glUniform1fvARB");
lcUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)Context->getProcAddress("glUniform2fvARB");
lcUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)Context->getProcAddress("glUniform3fvARB");
lcUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)Context->getProcAddress("glUniform4fvARB");
lcUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)Context->getProcAddress("glUniform1ivARB");
lcUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)Context->getProcAddress("glUniform2ivARB");
lcUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)Context->getProcAddress("glUniform3ivARB");
lcUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)Context->getProcAddress("glUniform4ivARB");
lcUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)Context->getProcAddress("glUniformMatrix2fvARB");
lcUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)Context->getProcAddress("glUniformMatrix3fvARB");
lcUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)Context->getProcAddress("glUniformMatrix4fvARB");
lcGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)Context->getProcAddress("glGetObjectParameterfvARB");
lcGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)Context->getProcAddress("glGetObjectParameterivARB");
lcGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)Context->getProcAddress("glGetInfoLogARB");
lcGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)Context->getProcAddress("glGetAttachedObjectsARB");
lcGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)Context->getProcAddress("glGetUniformLocationARB");
lcGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)Context->getProcAddress("glGetActiveUniformARB");
lcGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)Context->getProcAddress("glGetUniformfvARB");
lcGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)Context->getProcAddress("glGetUniformivARB");
lcGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)Context->getProcAddress("glGetShaderSourceARB");
lcBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)Context->getProcAddress("glBindAttribLocationARB");
lcGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)Context->getProcAddress("glGetActiveAttribARB");
lcGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)Context->getProcAddress("glGetAttribLocationARB");
gSupportsShaderObjects = true;
}
}

203
common/lc_glextensions.h Normal file
View file

@ -0,0 +1,203 @@
#ifndef _LC_GLEXTENSIONS_H_
#define _LC_GLEXTENSIONS_H_
void lcInitializeGLExtensions(const QGLContext* Context);
extern bool gSupportsShaderObjects;
extern bool gSupportsVertexBufferObject;
extern bool gSupportsFramebufferObjectARB;
extern bool gSupportsFramebufferObjectEXT;
extern bool gSupportsAnisotropic;
extern GLfloat gMaxAnisotropy;
extern PFNGLBINDBUFFERARBPROC lcBindBufferARB;
extern PFNGLDELETEBUFFERSARBPROC lcDeleteBuffersARB;
extern PFNGLGENBUFFERSARBPROC lcGenBuffersARB;
extern PFNGLISBUFFERARBPROC lcIsBufferARB;
extern PFNGLBUFFERDATAARBPROC lcBufferDataARB;
extern PFNGLBUFFERSUBDATAARBPROC lcBufferSubDataARB;
extern PFNGLGETBUFFERSUBDATAARBPROC lcGetBufferSubDataARB;
extern PFNGLMAPBUFFERARBPROC lcMapBufferARB;
extern PFNGLUNMAPBUFFERARBPROC lcUnmapBufferARB;
extern PFNGLGETBUFFERPARAMETERIVARBPROC lcGetBufferParameterivARB;
extern PFNGLGETBUFFERPOINTERVARBPROC lcGetBufferPointervARB;
extern PFNGLISRENDERBUFFERPROC lcIsRenderbuffer;
extern PFNGLBINDRENDERBUFFERPROC lcBindRenderbuffer;
extern PFNGLDELETERENDERBUFFERSPROC lcDeleteRenderbuffers;
extern PFNGLGENRENDERBUFFERSPROC lcGenRenderbuffers;
extern PFNGLRENDERBUFFERSTORAGEPROC lcRenderbufferStorage;
extern PFNGLGETRENDERBUFFERPARAMETERIVPROC lcGetRenderbufferParameteriv;
extern PFNGLISFRAMEBUFFERPROC lcIsFramebuffer;
extern PFNGLBINDFRAMEBUFFERPROC lcBindFramebuffer;
extern PFNGLDELETEFRAMEBUFFERSPROC lcDeleteFramebuffers;
extern PFNGLGENFRAMEBUFFERSPROC lcGenFramebuffers;
extern PFNGLCHECKFRAMEBUFFERSTATUSPROC lcCheckFramebufferStatus;
extern PFNGLFRAMEBUFFERTEXTURE1DPROC lcFramebufferTexture1D;
extern PFNGLFRAMEBUFFERTEXTURE2DPROC lcFramebufferTexture2D;
extern PFNGLFRAMEBUFFERTEXTURE3DPROC lcFramebufferTexture3D;
extern PFNGLFRAMEBUFFERRENDERBUFFERPROC lcFramebufferRenderbuffer;
extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC lcGetFramebufferAttachmentParameteriv;
extern PFNGLGENERATEMIPMAPPROC lcGenerateMipmap;
extern PFNGLBLITFRAMEBUFFERPROC lcBlitFramebuffer;
extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC lcRenderbufferStorageMultisample;
extern PFNGLFRAMEBUFFERTEXTURELAYERPROC lcFramebufferTextureLayer;
extern PFNGLISRENDERBUFFEREXTPROC lcIsRenderbufferEXT;
extern PFNGLBINDRENDERBUFFEREXTPROC lcBindRenderbufferEXT;
extern PFNGLDELETERENDERBUFFERSEXTPROC lcDeleteRenderbuffersEXT;
extern PFNGLGENRENDERBUFFERSEXTPROC lcGenRenderbuffersEXT;
extern PFNGLRENDERBUFFERSTORAGEEXTPROC lcRenderbufferStorageEXT;
extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC lcGetRenderbufferParameterivEXT;
extern PFNGLISFRAMEBUFFEREXTPROC lcIsFramebufferEXT;
extern PFNGLBINDFRAMEBUFFEREXTPROC lcBindFramebufferEXT;
extern PFNGLDELETEFRAMEBUFFERSEXTPROC lcDeleteFramebuffersEXT;
extern PFNGLGENFRAMEBUFFERSEXTPROC lcGenFramebuffersEXT;
extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC lcCheckFramebufferStatusEXT;
extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC lcFramebufferTexture1DEXT;
extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC lcFramebufferTexture2DEXT;
extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC lcFramebufferTexture3DEXT;
extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC lcFramebufferRenderbufferEXT;
extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC lcGetFramebufferAttachmentParameterivEXT;
extern PFNGLGENERATEMIPMAPEXTPROC lcGenerateMipmapEXT;
extern PFNGLDELETEOBJECTARBPROC lcDeleteObjectARB;
extern PFNGLGETHANDLEARBPROC lcGetHandleARB;
extern PFNGLDETACHOBJECTARBPROC lcDetachObjectARB;
extern PFNGLCREATESHADEROBJECTARBPROC lcCreateShaderObjectARB;
extern PFNGLSHADERSOURCEARBPROC lcShaderSourceARB;
extern PFNGLCOMPILESHADERARBPROC lcCompileShaderARB;
extern PFNGLCREATEPROGRAMOBJECTARBPROC lcCreateProgramObjectARB;
extern PFNGLATTACHOBJECTARBPROC lcAttachObjectARB;
extern PFNGLLINKPROGRAMARBPROC lcLinkProgramARB;
extern PFNGLUSEPROGRAMOBJECTARBPROC lcUseProgramObjectARB;
extern PFNGLVALIDATEPROGRAMARBPROC lcValidateProgramARB;
extern PFNGLUNIFORM1FARBPROC lcUniform1fARB;
extern PFNGLUNIFORM2FARBPROC lcUniform2fARB;
extern PFNGLUNIFORM3FARBPROC lcUniform3fARB;
extern PFNGLUNIFORM4FARBPROC lcUniform4fARB;
extern PFNGLUNIFORM1IARBPROC lcUniform1iARB;
extern PFNGLUNIFORM2IARBPROC lcUniform2iARB;
extern PFNGLUNIFORM3IARBPROC lcUniform3iARB;
extern PFNGLUNIFORM4IARBPROC lcUniform4iARB;
extern PFNGLUNIFORM1FVARBPROC lcUniform1fvARB;
extern PFNGLUNIFORM2FVARBPROC lcUniform2fvARB;
extern PFNGLUNIFORM3FVARBPROC lcUniform3fvARB;
extern PFNGLUNIFORM4FVARBPROC lcUniform4fvARB;
extern PFNGLUNIFORM1IVARBPROC lcUniform1ivARB;
extern PFNGLUNIFORM2IVARBPROC lcUniform2ivARB;
extern PFNGLUNIFORM3IVARBPROC lcUniform3ivARB;
extern PFNGLUNIFORM4IVARBPROC lcUniform4ivARB;
extern PFNGLUNIFORMMATRIX2FVARBPROC lcUniformMatrix2fvARB;
extern PFNGLUNIFORMMATRIX3FVARBPROC lcUniformMatrix3fvARB;
extern PFNGLUNIFORMMATRIX4FVARBPROC lcUniformMatrix4fvARB;
extern PFNGLGETOBJECTPARAMETERFVARBPROC lcGetObjectParameterfvARB;
extern PFNGLGETOBJECTPARAMETERIVARBPROC lcGetObjectParameterivARB;
extern PFNGLGETINFOLOGARBPROC lcGetInfoLogARB;
extern PFNGLGETATTACHEDOBJECTSARBPROC lcGetAttachedObjectsARB;
extern PFNGLGETUNIFORMLOCATIONARBPROC lcGetUniformLocationARB;
extern PFNGLGETACTIVEUNIFORMARBPROC lcGetActiveUniformARB;
extern PFNGLGETUNIFORMFVARBPROC lcGetUniformfvARB;
extern PFNGLGETUNIFORMIVARBPROC lcGetUniformivARB;
extern PFNGLGETSHADERSOURCEARBPROC lcGetShaderSourceARB;
extern PFNGLBINDATTRIBLOCATIONARBPROC lcBindAttribLocationARB;
extern PFNGLGETACTIVEATTRIBARBPROC lcGetActiveAttribARB;
extern PFNGLGETATTRIBLOCATIONARBPROC lcGetAttribLocationARB;
#define glBindBuffer lcBindBufferARB
#define glDeleteBuffers lcDeleteBuffersARB
#define glGenBuffers lcGenBuffersARB
#define glIsBuffer lcIsBufferARB
#define glBufferData lcBufferDataARB
#define glBufferSubData lcBufferSubDataARB
#define glGetBufferSubData lcGetBufferSubDataARB
#define glMapBuffer lcMapBufferARB
#define glUnmapBuffer lcUnmapBufferARB
#define glGetBufferParameteriv lcGetBufferParameterivARB
#define glGetBufferPointerv lcGetBufferPointervARB
#define glIsRenderbuffer lcIsRenderbuffer
#define glBindRenderbuffer lcBindRenderbuffer
#define glDeleteRenderbuffers lcDeleteRenderbuffers
#define glGenRenderbuffers lcGenRenderbuffers
#define glRenderbufferStorage lcRenderbufferStorage
#define glGetRenderbufferParameteriv lcGetRenderbufferParameteriv
#define glIsFramebuffer lcIsFramebuffer
#define glBindFramebuffer lcBindFramebuffer
#define glDeleteFramebuffers lcDeleteFramebuffers
#define glGenFramebuffers lcGenFramebuffers
#define glCheckFramebufferStatus lcCheckFramebufferStatus
#define glFramebufferTexture1D lcFramebufferTexture1D
#define glFramebufferTexture2D lcFramebufferTexture2D
#define glFramebufferTexture3D lcFramebufferTexture3D
#define glFramebufferRenderbuffer lcFramebufferRenderbuffer
#define glGetFramebufferAttachmentParameteriv lcGetFramebufferAttachmentParameteriv
#define glGenerateMipmap lcGenerateMipmap
#define glBlitFramebuffer lcBlitFramebuffer
#define glRenderbufferStorageMultisample lcRenderbufferStorageMultisample
#define glFramebufferTextureLayer lcFramebufferTextureLayer
#define glIsRenderbufferEXT lcIsRenderbufferEXT
#define glBindRenderbufferEXT lcBindRenderbufferEXT
#define glDeleteRenderbuffersEXT lcDeleteRenderbuffersEXT
#define glGenRenderbuffersEXT lcGenRenderbuffersEXT
#define glRenderbufferStorageEXT lcRenderbufferStorageEXT
#define glGetRenderbufferParameterivEXT lcGetRenderbufferParameterivEXT
#define glIsFramebufferEXT lcIsFramebufferEXT
#define glBindFramebufferEXT lcBindFramebufferEXT
#define glDeleteFramebuffersEXT lcDeleteFramebuffersEXT
#define glGenFramebuffersEXT lcGenFramebuffersEXT
#define glCheckFramebufferStatusEXT lcCheckFramebufferStatusEXT
#define glFramebufferTexture1DEXT lcFramebufferTexture1DEXT
#define glFramebufferTexture2DEXT lcFramebufferTexture2DEXT
#define glFramebufferTexture3DEXT lcFramebufferTexture3DEXT
#define glFramebufferRenderbufferEXT lcFramebufferRenderbufferEXT
#define glGetFramebufferAttachmentParameterivEXT lcGetFramebufferAttachmentParameterivEXT
#define glGenerateMipmapEXT lcGenerateMipmapEXT
#define glDeleteObjectARB lcDeleteObjectARB
#define glGetHandleARB lcGetHandleARB
#define glDetachObjectARB lcDetachObjectARB
#define glCreateShaderObjectARB lcCreateShaderObjectARB
#define glShaderSourceARB lcShaderSourceARB
#define glCompileShaderARB lcCompileShaderARB
#define glCreateProgramObjectARB lcCreateProgramObjectARB
#define glAttachObjectARB lcAttachObjectARB
#define glLinkProgramARB lcLinkProgramARB
#define glUseProgramObjectARB lcUseProgramObjectARB
#define glValidateProgramARB lcValidateProgramARB
#define glUniform1fARB lcUniform1fARB
#define glUniform2fARB lcUniform2fARB
#define glUniform3fARB lcUniform3fARB
#define glUniform4fARB lcUniform4fARB
#define glUniform1iARB lcUniform1iARB
#define glUniform2iARB lcUniform2iARB
#define glUniform3iARB lcUniform3iARB
#define glUniform4iARB lcUniform4iARB
#define glUniform1fvARB lcUniform1fvARB
#define glUniform2fvARB lcUniform2fvARB
#define glUniform3fvARB lcUniform3fvARB
#define glUniform4fvARB lcUniform4fvARB
#define glUniform1ivARB lcUniform1ivARB
#define glUniform2ivARB lcUniform2ivARB
#define glUniform3ivARB lcUniform3ivARB
#define glUniform4ivARB lcUniform4ivARB
#define glUniformMatrix2fvARB lcUniformMatrix2fvARB
#define glUniformMatrix3fvARB lcUniformMatrix3fvARB
#define glUniformMatrix4fvARB lcUniformMatrix4fvARB
#define glGetObjectParameterfvARB lcGetObjectParameterfvARB
#define glGetObjectParameterivARB lcGetObjectParameterivARB
#define glGetInfoLogARB lcGetInfoLogARB
#define glGetAttachedObjectsARB lcGetAttachedObjectsARB
#define glGetUniformLocationARB lcGetUniformLocationARB
#define glGetActiveUniformARB lcGetActiveUniformARB
#define glGetUniformfvARB lcGetUniformfvARB
#define glGetUniformivARB lcGetUniformivARB
#define glGetShaderSourceARB lcGetShaderSourceARB
#define glBindAttribLocationARB lcBindAttribLocationARB
#define glGetActiveAttribARB lcGetActiveAttribARB
#define glGetAttribLocationARB lcGetAttribLocationARB
#endif

View file

@ -8,6 +8,12 @@
#include <QtGui>
#include <QPrinter>
#undef GL_LINES_ADJACENCY_EXT
#undef GL_LINE_STRIP_ADJACENCY_EXT
#undef GL_TRIANGLES_ADJACENCY_EXT
#undef GL_TRIANGLE_STRIP_ADJACENCY_EXT
#include "lc_glext.h"
// Old defines and declarations.
#define LC_MAXPATH 1024

View file

@ -57,7 +57,6 @@ public:
delete mContext;
}
void* GetExtensionAddress(const char* FunctionName);
void ShowPopupMenu();
void SetContext(lcContext* Context)

View file

@ -9,6 +9,7 @@
#include "lc_application.h"
#include "lc_mainwindow.h"
#include "lc_context.h"
#include "lc_glextensions.h"
#include "project.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -1026,7 +1027,7 @@ void lcPiecesLibrary::CreateMesh(PieceInfo* Info, lcLibraryMeshData& MeshData)
void lcPiecesLibrary::UpdateBuffers(lcContext* Context)
{
if (!GL_HasVertexBufferObject() || !mBuffersDirty)
if (!gSupportsVertexBufferObject || !mBuffersDirty)
return;
int VertexDataSize = 0;

View file

@ -2,7 +2,6 @@
#define _LC_MESH_H_
#include <stdlib.h>
#include "opengl.h"
#include "lc_math.h"
#define LC_MESH_FILE_ID LC_FOURCC('M', 'E', 'S', 'H')

View file

@ -5,6 +5,7 @@
#include "lc_library.h"
#include "image.h"
#include "system.h"
#include "lc_glextensions.h"
lcTexture* gGridTexture;
@ -170,8 +171,8 @@ bool lcTexture::Load(Image* images, int NumLevels, int Flags)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filters[1][FilterIndex]);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (GL_SupportsAnisotropic && FilterFlags == LC_TEXTURE_ANISOTROPIC)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, lcMin(4.0f, GL_MaxAnisotropy));
if (gSupportsAnisotropic && FilterFlags == LC_TEXTURE_ANISOTROPIC)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, lcMin(4.0f, gMaxAnisotropy));
int Format;
switch (images[0].mFormat)

View file

@ -1,8 +1,6 @@
#ifndef _LC_TEXTURE_H_
#define _LC_TEXTURE_H_
#include "opengl.h"
#define LC_TEXTURE_WRAPU 0x01
#define LC_TEXTURE_WRAPV 0x02
#define LC_TEXTURE_MIPMAPS 0x04

View file

@ -6,7 +6,6 @@
#include <stdio.h>
#include <zlib.h>
#include "minifig.h"
#include "opengl.h"
#include "pieceinf.h"
#include "project.h"
#include "lc_model.h"

View file

@ -1,291 +0,0 @@
#include "lc_global.h"
#include <string.h>
#include <stdio.h>
#include "opengl.h"
#include "lc_glwidget.h"
#include "lc_mainwindow.h"
#include "preview.h"
GLBINDBUFFERARBPROC lcBindBufferARB;
GLDELETEBUFFERSARBPROC lcDeleteBuffersARB;
GLGENBUFFERSARBPROC lcGenBuffersARB;
GLISBUFFERARBPROC lcIsBufferARB;
GLBUFFERDATAARBPROC lcBufferDataARB;
GLBUFFERSUBDATAARBPROC lcBufferSubDataARB;
GLGETBUFFERSUBDATAARBPROC lcGetBufferSubDataARB;
GLMAPBUFFERARBPROC lcMapBufferARB;
GLUNMAPBUFFERARBPROC lcUnmapBufferARB;
GLGETBUFFERPARAMETERIVARBPROC lcGetBufferParameterivARB;
GLGETBUFFERPOINTERVARBPROC lcGetBufferPointervARB;
GLISRENDERBUFFERARBPROC lcIsRenderbufferARB;
GLBINDRENDERBUFFERARBPROC lcBindRenderbufferARB;
GLDELETERENDERBUFFERSARBPROC lcDeleteRenderbuffersARB;
GLGENRENDERBUFFERSARBPROC lcGenRenderbuffersARB;
GLRENDERBUFFERSTORAGEARBPROC lcRenderbufferStorageARB;
GLGETRENDERBUFFERPARAMETERIVARBPROC lcGetRenderbufferParameterivARB;
GLISFRAMEBUFFERARBPROC lcIsFramebufferARB;
GLBINDFRAMEBUFFERARBPROC lcBindFramebufferARB;
GLDELETEFRAMEBUFFERSARBPROC lcDeleteFramebuffersARB;
GLGENFRAMEBUFFERSARBPROC lcGenFramebuffersARB;
GLCHECKFRAMEBUFFERSTATUSARBPROC lcCheckFramebufferStatusARB;
GLFRAMEBUFFERTEXTURE1DARBPROC lcFramebufferTexture1DARB;
GLFRAMEBUFFERTEXTURE2DARBPROC lcFramebufferTexture2DARB;
GLFRAMEBUFFERTEXTURE3DARBPROC lcFramebufferTexture3DARB;
GLFRAMEBUFFERRENDERBUFFERARBPROC lcFramebufferRenderbufferARB;
GLGETFRAMEBUFFERATTACHMENTPARAMETERIVARBPROC lcGetFramebufferAttachmentParameterivARB;
GLGENERATEMIPMAPARBPROC lcGenerateMipmapARB;
GLBLITFRAMEBUFFERARBPROC lcBlitFramebufferARB;
GLRENDERBUFFERSTORAGEMULTISAMPLEARBPROC lcRenderbufferStorageMultisampleARB;
GLFRAMEBUFFERTEXTURELAYERARBPROC lcFramebufferTextureLayerARB;
GLISRENDERBUFFEREXTPROC lcIsRenderbufferEXT;
GLBINDRENDERBUFFEREXTPROC lcBindRenderbufferEXT;
GLDELETERENDERBUFFERSEXTPROC lcDeleteRenderbuffersEXT;
GLGENRENDERBUFFERSEXTPROC lcGenRenderbuffersEXT;
GLRENDERBUFFERSTORAGEEXTPROC lcRenderbufferStorageEXT;
GLGETRENDERBUFFERPARAMETERIVEXTPROC lcGetRenderbufferParameterivEXT;
GLISFRAMEBUFFEREXTPROC lcIsFramebufferEXT;
GLBINDFRAMEBUFFEREXTPROC lcBindFramebufferEXT;
GLDELETEFRAMEBUFFERSEXTPROC lcDeleteFramebuffersEXT;
GLGENFRAMEBUFFERSEXTPROC lcGenFramebuffersEXT;
GLCHECKFRAMEBUFFERSTATUSEXTPROC lcCheckFramebufferStatusEXT;
GLFRAMEBUFFERTEXTURE1DEXTPROC lcFramebufferTexture1DEXT;
GLFRAMEBUFFERTEXTURE2DEXTPROC lcFramebufferTexture2DEXT;
GLFRAMEBUFFERTEXTURE3DEXTPROC lcFramebufferTexture3DEXT;
GLFRAMEBUFFERRENDERBUFFEREXTPROC lcFramebufferRenderbufferEXT;
GLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC lcGetFramebufferAttachmentParameterivEXT;
GLGENERATEMIPMAPEXTPROC lcGenerateMipmapEXT;
GLDELETEOBJECTARBPROC lcDeleteObjectARB;
GLGETHANDLEARBPROC lcGetHandleARB;
GLDETACHOBJECTARBPROC lcDetachObjectARB;
GLCREATESHADEROBJECTARBPROC lcCreateShaderObjectARB;
GLSHADERSOURCEARBPROC lcShaderSourceARB;
GLCOMPILESHADERARBPROC lcCompileShaderARB;
GLCREATEPROGRAMOBJECTARBPROC lcCreateProgramObjectARB;
GLATTACHOBJECTARBPROC lcAttachObjectARB;
GLLINKPROGRAMARBPROC lcLinkProgramARB;
GLUSEPROGRAMOBJECTARBPROC lcUseProgramObjectARB;
GLVALIDATEPROGRAMARBPROC lcValidateProgramARB;
GLUNIFORM1FARBPROC lcUniform1fARB;
GLUNIFORM2FARBPROC lcUniform2fARB;
GLUNIFORM3FARBPROC lcUniform3fARB;
GLUNIFORM4FARBPROC lcUniform4fARB;
GLUNIFORM1IARBPROC lcUniform1iARB;
GLUNIFORM2IARBPROC lcUniform2iARB;
GLUNIFORM3IARBPROC lcUniform3iARB;
GLUNIFORM4IARBPROC lcUniform4iARB;
GLUNIFORM1FVARBPROC lcUniform1fvARB;
GLUNIFORM2FVARBPROC lcUniform2fvARB;
GLUNIFORM3FVARBPROC lcUniform3fvARB;
GLUNIFORM4FVARBPROC lcUniform4fvARB;
GLUNIFORM1IVARBPROC lcUniform1ivARB;
GLUNIFORM2IVARBPROC lcUniform2ivARB;
GLUNIFORM3IVARBPROC lcUniform3ivARB;
GLUNIFORM4IVARBPROC lcUniform4ivARB;
GLUNIFORMMATRIX2FVARBPROC lcUniformMatrix2fvARB;
GLUNIFORMMATRIX3FVARBPROC lcUniformMatrix3fvARB;
GLUNIFORMMATRIX4FVARBPROC lcUniformMatrix4fvARB;
GLGETOBJECTPARAMETERFVARBPROC lcGetObjectParameterfvARB;
GLGETOBJECTPARAMETERIVARBPROC lcGetObjectParameterivARB;
GLGETINFOLOGARBPROC lcGetInfoLogARB;
GLGETATTACHEDOBJECTSARBPROC lcGetAttachedObjectsARB;
GLGETUNIFORMLOCATIONARBPROC lcGetUniformLocationARB;
GLGETACTIVEUNIFORMARBPROC lcGetActiveUniformARB;
GLGETUNIFORMFVARBPROC lcGetUniformfvARB;
GLGETUNIFORMIVARBPROC lcGetUniformivARB;
GLGETSHADERSOURCEARBPROC lcGetShaderSourceARB;
GLBINDATTRIBLOCATIONARBPROC lcBindAttribLocationARB;
GLGETACTIVEATTRIBARBPROC lcGetActiveAttribARB;
GLGETATTRIBLOCATIONARBPROC lcGetAttribLocationARB;
bool GL_SupportsShaderObjects;
bool GL_SupportsVertexBufferObject;
bool GL_UseVertexBufferObject;
bool GL_SupportsFramebufferObjectARB;
bool GL_SupportsFramebufferObjectEXT;
bool GL_SupportsAnisotropic;
GLfloat GL_MaxAnisotropy;
bool GL_ExtensionSupported(const GLubyte* Extensions, const char* Name)
{
const GLubyte *start;
GLubyte *where, *terminator;
where = (GLubyte*)strchr(Name, ' ');
if (where || *Name == '\0')
return false;
if (!Extensions)
return false;
for (start = Extensions; ;)
{
where = (GLubyte*)strstr((const char*)start, Name);
if (!where)
break;
terminator = where + strlen(Name);
if (where == start || *(where - 1) == ' ')
if (*terminator == ' ' || *terminator == '\0')
return true;
start = terminator;
}
return false;
}
#ifndef QT_NO_DEBUG
static void APIENTRY lcDebugCallback(GLenum Source, GLenum Type, GLuint Id, GLenum Severity, GLsizei Length, const GLchar* Message, GLvoid* UserParam)
{
qDebug() << Message;
}
#endif
void GL_InitializeSharedExtensions(lcGLWidget* Window)
{
const GLubyte* Extensions = glGetString(GL_EXTENSIONS);
#ifndef QT_NO_DEBUG
if (GL_ExtensionSupported(Extensions, "GL_KHR_debug"))
{
GLDEBUGMESSAGECALLBACKARBPROC DebugMessageCallback = (GLDEBUGMESSAGECALLBACKARBPROC)Window->GetExtensionAddress("glDebugMessageCallback");
if (DebugMessageCallback)
{
DebugMessageCallback((GLDEBUGARBPROC)&lcDebugCallback, NULL);
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
}
}
#endif
if (GL_ExtensionSupported(Extensions, "GL_EXT_texture_filter_anisotropic"))
{
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &GL_MaxAnisotropy);
GL_SupportsAnisotropic = true;
}
if (GL_ExtensionSupported(Extensions, "GL_ARB_vertex_buffer_object"))
{
lcBindBufferARB = (GLBINDBUFFERARBPROC)Window->GetExtensionAddress("glBindBufferARB");
lcDeleteBuffersARB = (GLDELETEBUFFERSARBPROC)Window->GetExtensionAddress("glDeleteBuffersARB");
lcGenBuffersARB = (GLGENBUFFERSARBPROC)Window->GetExtensionAddress("glGenBuffersARB");
lcIsBufferARB = (GLISBUFFERARBPROC)Window->GetExtensionAddress("glIsBufferARB");
lcBufferDataARB = (GLBUFFERDATAARBPROC)Window->GetExtensionAddress("glBufferDataARB");
lcBufferSubDataARB = (GLBUFFERSUBDATAARBPROC)Window->GetExtensionAddress("glBufferSubDataARB");
lcGetBufferSubDataARB = (GLGETBUFFERSUBDATAARBPROC)Window->GetExtensionAddress("glGetBufferSubDataARB");
lcMapBufferARB = (GLMAPBUFFERARBPROC)Window->GetExtensionAddress("glMapBufferARB");
lcUnmapBufferARB = (GLUNMAPBUFFERARBPROC)Window->GetExtensionAddress("glUnmapBufferARB");
lcGetBufferParameterivARB = (GLGETBUFFERPARAMETERIVARBPROC)Window->GetExtensionAddress("glGetBufferParameterivARB");
lcGetBufferPointervARB = (GLGETBUFFERPOINTERVARBPROC)Window->GetExtensionAddress("glGetBufferPointervARB");
GL_UseVertexBufferObject = true;
GL_SupportsVertexBufferObject = true;
}
if (GL_ExtensionSupported(Extensions, "GL_ARB_framebuffer_object"))
{
lcIsRenderbufferARB = (GLISRENDERBUFFERARBPROC)Window->GetExtensionAddress("glIsRenderbuffer");
lcBindRenderbufferARB = (GLBINDRENDERBUFFERARBPROC)Window->GetExtensionAddress("glBindRenderbuffer");
lcDeleteRenderbuffersARB = (GLDELETERENDERBUFFERSARBPROC)Window->GetExtensionAddress("glDeleteRenderbuffers");
lcGenRenderbuffersARB = (GLGENRENDERBUFFERSARBPROC)Window->GetExtensionAddress("glGenRenderbuffers");
lcRenderbufferStorageARB = (GLRENDERBUFFERSTORAGEARBPROC)Window->GetExtensionAddress("glRenderbufferStorage");
lcGetRenderbufferParameterivARB = (GLGETRENDERBUFFERPARAMETERIVARBPROC)Window->GetExtensionAddress("glGetRenderbufferParameteriv");
lcIsFramebufferARB = (GLISFRAMEBUFFERARBPROC)Window->GetExtensionAddress("glIsFramebuffer");
lcBindFramebufferARB = (GLBINDFRAMEBUFFERARBPROC)Window->GetExtensionAddress("glBindFramebuffer");
lcDeleteFramebuffersARB = (GLDELETEFRAMEBUFFERSARBPROC)Window->GetExtensionAddress("glDeleteFramebuffers");
lcGenFramebuffersARB = (GLGENFRAMEBUFFERSARBPROC)Window->GetExtensionAddress("glGenFramebuffers");
lcCheckFramebufferStatusARB = (GLCHECKFRAMEBUFFERSTATUSARBPROC)Window->GetExtensionAddress("glCheckFramebufferStatus");
lcFramebufferTexture1DARB = (GLFRAMEBUFFERTEXTURE1DARBPROC)Window->GetExtensionAddress("glFramebufferTexture1D");
lcFramebufferTexture2DARB = (GLFRAMEBUFFERTEXTURE2DARBPROC)Window->GetExtensionAddress("glFramebufferTexture2D");
lcFramebufferTexture3DARB = (GLFRAMEBUFFERTEXTURE3DARBPROC)Window->GetExtensionAddress("glFramebufferTexture3D");
lcFramebufferRenderbufferARB = (GLFRAMEBUFFERRENDERBUFFERARBPROC)Window->GetExtensionAddress("glFramebufferRenderbuffer");
lcGetFramebufferAttachmentParameterivARB = (GLGETFRAMEBUFFERATTACHMENTPARAMETERIVARBPROC)Window->GetExtensionAddress("glGetFramebufferAttachmentParameteriv");
lcGenerateMipmapARB = (GLGENERATEMIPMAPARBPROC)Window->GetExtensionAddress("glGenerateMipmap");
lcBlitFramebufferARB = (GLBLITFRAMEBUFFERARBPROC)Window->GetExtensionAddress("glBlitFramebuffer");
lcRenderbufferStorageMultisampleARB = (GLRENDERBUFFERSTORAGEMULTISAMPLEARBPROC)Window->GetExtensionAddress("glRenderbufferStorageMultisample");
lcFramebufferTextureLayerARB = (GLFRAMEBUFFERTEXTURELAYERARBPROC)Window->GetExtensionAddress("glFramebufferTextureLayer");
GL_SupportsFramebufferObjectARB = true;
}
if (GL_ExtensionSupported(Extensions, "GL_EXT_framebuffer_object"))
{
lcIsRenderbufferEXT = (GLISRENDERBUFFEREXTPROC)Window->GetExtensionAddress("glIsRenderbufferEXT");
lcBindRenderbufferEXT = (GLBINDRENDERBUFFEREXTPROC)Window->GetExtensionAddress("glBindRenderbufferEXT");
lcDeleteRenderbuffersEXT = (GLDELETERENDERBUFFERSEXTPROC)Window->GetExtensionAddress("glDeleteRenderbuffersEXT");
lcGenRenderbuffersEXT = (GLGENRENDERBUFFERSEXTPROC)Window->GetExtensionAddress("glGenRenderbuffersEXT");
lcRenderbufferStorageEXT = (GLRENDERBUFFERSTORAGEEXTPROC)Window->GetExtensionAddress("glRenderbufferStorageEXT");
lcGetRenderbufferParameterivEXT = (GLGETRENDERBUFFERPARAMETERIVEXTPROC)Window->GetExtensionAddress("glGetRenderbufferParameterivEXT");
lcIsFramebufferEXT = (GLISFRAMEBUFFEREXTPROC)Window->GetExtensionAddress("glIsFramebufferEXT");
lcBindFramebufferEXT = (GLBINDFRAMEBUFFEREXTPROC)Window->GetExtensionAddress("glBindFramebufferEXT");
lcDeleteFramebuffersEXT = (GLDELETEFRAMEBUFFERSEXTPROC)Window->GetExtensionAddress("glDeleteFramebuffersEXT");
lcGenFramebuffersEXT = (GLGENFRAMEBUFFERSEXTPROC)Window->GetExtensionAddress("glGenFramebuffersEXT");
lcCheckFramebufferStatusEXT = (GLCHECKFRAMEBUFFERSTATUSEXTPROC)Window->GetExtensionAddress("glCheckFramebufferStatusEXT");
lcFramebufferTexture1DEXT = (GLFRAMEBUFFERTEXTURE1DEXTPROC)Window->GetExtensionAddress("glFramebufferTexture1DEXT");
lcFramebufferTexture2DEXT = (GLFRAMEBUFFERTEXTURE2DEXTPROC)Window->GetExtensionAddress("glFramebufferTexture2DEXT");
lcFramebufferTexture3DEXT = (GLFRAMEBUFFERTEXTURE3DEXTPROC)Window->GetExtensionAddress("glFramebufferTexture3DEXT");
lcFramebufferRenderbufferEXT = (GLFRAMEBUFFERRENDERBUFFEREXTPROC)Window->GetExtensionAddress("glFramebufferRenderbufferEXT");
lcGetFramebufferAttachmentParameterivEXT = (GLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)Window->GetExtensionAddress("glGetFramebufferAttachmentParameterivEXT");
lcGenerateMipmapEXT = (GLGENERATEMIPMAPEXTPROC)Window->GetExtensionAddress("glGenerateMipmapEXT");
GL_SupportsFramebufferObjectEXT = true;
}
if (GL_ExtensionSupported(Extensions, "GL_ARB_shader_objects") && GL_ExtensionSupported(Extensions, "GL_ARB_shading_language_100") &&
GL_ExtensionSupported(Extensions, "GL_ARB_vertex_shader") && GL_ExtensionSupported(Extensions, "GL_ARB_fragment_shader"))
{
lcDeleteObjectARB = (GLDELETEOBJECTARBPROC)Window->GetExtensionAddress("glDeleteObjectARB");
lcGetHandleARB = (GLGETHANDLEARBPROC)Window->GetExtensionAddress("glGetHandleARB");
lcDetachObjectARB = (GLDETACHOBJECTARBPROC)Window->GetExtensionAddress("glDetachObjectARB");
lcCreateShaderObjectARB = (GLCREATESHADEROBJECTARBPROC)Window->GetExtensionAddress("glCreateShaderObjectARB");
lcShaderSourceARB = (GLSHADERSOURCEARBPROC)Window->GetExtensionAddress("glShaderSourceARB");
lcCompileShaderARB = (GLCOMPILESHADERARBPROC)Window->GetExtensionAddress("glCompileShaderARB");
lcCreateProgramObjectARB = (GLCREATEPROGRAMOBJECTARBPROC)Window->GetExtensionAddress("glCreateProgramObjectARB");
lcAttachObjectARB = (GLATTACHOBJECTARBPROC)Window->GetExtensionAddress("glAttachObjectARB");
lcLinkProgramARB = (GLLINKPROGRAMARBPROC)Window->GetExtensionAddress("glLinkProgramARB");
lcUseProgramObjectARB = (GLUSEPROGRAMOBJECTARBPROC)Window->GetExtensionAddress("glUseProgramObjectARB");
lcValidateProgramARB = (GLVALIDATEPROGRAMARBPROC)Window->GetExtensionAddress("glValidateProgramARB");
lcUniform1fARB = (GLUNIFORM1FARBPROC)Window->GetExtensionAddress("glUniform1fARB");
lcUniform2fARB = (GLUNIFORM2FARBPROC)Window->GetExtensionAddress("glUniform2fARB");
lcUniform3fARB = (GLUNIFORM3FARBPROC)Window->GetExtensionAddress("glUniform3fARB");
lcUniform4fARB = (GLUNIFORM4FARBPROC)Window->GetExtensionAddress("glUniform4fARB");
lcUniform1iARB = (GLUNIFORM1IARBPROC)Window->GetExtensionAddress("glUniform1iARB");
lcUniform2iARB = (GLUNIFORM2IARBPROC)Window->GetExtensionAddress("glUniform2iARB");
lcUniform3iARB = (GLUNIFORM3IARBPROC)Window->GetExtensionAddress("glUniform3iARB");
lcUniform4iARB = (GLUNIFORM4IARBPROC)Window->GetExtensionAddress("glUniform4iARB");
lcUniform1fvARB = (GLUNIFORM1FVARBPROC)Window->GetExtensionAddress("glUniform1fvARB");
lcUniform2fvARB = (GLUNIFORM2FVARBPROC)Window->GetExtensionAddress("glUniform2fvARB");
lcUniform3fvARB = (GLUNIFORM3FVARBPROC)Window->GetExtensionAddress("glUniform3fvARB");
lcUniform4fvARB = (GLUNIFORM4FVARBPROC)Window->GetExtensionAddress("glUniform4fvARB");
lcUniform1ivARB = (GLUNIFORM1IVARBPROC)Window->GetExtensionAddress("glUniform1ivARB");
lcUniform2ivARB = (GLUNIFORM2IVARBPROC)Window->GetExtensionAddress("glUniform2ivARB");
lcUniform3ivARB = (GLUNIFORM3IVARBPROC)Window->GetExtensionAddress("glUniform3ivARB");
lcUniform4ivARB = (GLUNIFORM4IVARBPROC)Window->GetExtensionAddress("glUniform4ivARB");
lcUniformMatrix2fvARB = (GLUNIFORMMATRIX2FVARBPROC)Window->GetExtensionAddress("glUniformMatrix2fvARB");
lcUniformMatrix3fvARB = (GLUNIFORMMATRIX3FVARBPROC)Window->GetExtensionAddress("glUniformMatrix3fvARB");
lcUniformMatrix4fvARB = (GLUNIFORMMATRIX4FVARBPROC)Window->GetExtensionAddress("glUniformMatrix4fvARB");
lcGetObjectParameterfvARB = (GLGETOBJECTPARAMETERFVARBPROC)Window->GetExtensionAddress("glGetObjectParameterfvARB");
lcGetObjectParameterivARB = (GLGETOBJECTPARAMETERIVARBPROC)Window->GetExtensionAddress("glGetObjectParameterivARB");
lcGetInfoLogARB = (GLGETINFOLOGARBPROC)Window->GetExtensionAddress("glGetInfoLogARB");
lcGetAttachedObjectsARB = (GLGETATTACHEDOBJECTSARBPROC)Window->GetExtensionAddress("glGetAttachedObjectsARB");
lcGetUniformLocationARB = (GLGETUNIFORMLOCATIONARBPROC)Window->GetExtensionAddress("glGetUniformLocationARB");
lcGetActiveUniformARB = (GLGETACTIVEUNIFORMARBPROC)Window->GetExtensionAddress("glGetActiveUniformARB");
lcGetUniformfvARB = (GLGETUNIFORMFVARBPROC)Window->GetExtensionAddress("glGetUniformfvARB");
lcGetUniformivARB = (GLGETUNIFORMIVARBPROC)Window->GetExtensionAddress("glGetUniformivARB");
lcGetShaderSourceARB = (GLGETSHADERSOURCEARBPROC)Window->GetExtensionAddress("glGetShaderSourceARB");
lcBindAttribLocationARB = (GLBINDATTRIBLOCATIONARBPROC)Window->GetExtensionAddress("glBindAttribLocationARB");
lcGetActiveAttribARB = (GLGETACTIVEATTRIBARBPROC)Window->GetExtensionAddress("glGetActiveAttribARB");
lcGetAttribLocationARB = (GLGETATTRIBLOCATIONARBPROC)Window->GetExtensionAddress("glGetAttribLocationARB");
GL_SupportsShaderObjects = true;
}
}

View file

@ -1,668 +0,0 @@
#ifndef _OPENGL_H_
#define _OPENGL_H_
class lcGLWidget;
void GL_InitializeSharedExtensions(lcGLWidget* Window);
bool GL_ExtensionSupported(const GLubyte* Extensions, const char* Name);
extern bool GL_SupportsVertexBufferObject;
extern bool GL_UseVertexBufferObject;
extern bool GL_SupportsFramebufferObjectARB;
extern bool GL_SupportsFramebufferObjectEXT;
extern bool GL_SupportsAnisotropic;
extern GLfloat GL_MaxAnisotropy;
inline void GL_DisableVertexBufferObject()
{
GL_UseVertexBufferObject = false;
}
inline void GL_EnableVertexBufferObject()
{
GL_UseVertexBufferObject = GL_SupportsVertexBufferObject;
}
inline bool GL_HasVertexBufferObject()
{
return GL_UseVertexBufferObject;
}
inline bool GL_HasFramebufferObjectARB()
{
return GL_SupportsFramebufferObjectARB;
}
inline bool GL_HasFramebufferObjectEXT()
{
return GL_SupportsFramebufferObjectEXT;
}
#ifndef GL_VERSION_1_4
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
#define GL_BLEND_SRC_ALPHA 0x80CB
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_DEPTH_COMPONENT24 0x81A6
#define GL_DEPTH_COMPONENT32 0x81A7
#define GL_MIRRORED_REPEAT 0x8370
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
#define GL_TEXTURE_LOD_BIAS 0x8501
#define GL_INCR_WRAP 0x8507
#define GL_DECR_WRAP 0x8508
#define GL_TEXTURE_DEPTH_SIZE 0x884A
#define GL_TEXTURE_COMPARE_MODE 0x884C
#define GL_TEXTURE_COMPARE_FUNC 0x884D
#define GL_POINT_SIZE_MIN 0x8126
#define GL_POINT_SIZE_MAX 0x8127
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
#define GL_GENERATE_MIPMAP 0x8191
#define GL_GENERATE_MIPMAP_HINT 0x8192
#define GL_FOG_COORDINATE_SOURCE 0x8450
#define GL_FOG_COORDINATE 0x8451
#define GL_FRAGMENT_DEPTH 0x8452
#define GL_CURRENT_FOG_COORDINATE 0x8453
#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
#define GL_FOG_COORDINATE_ARRAY 0x8457
#define GL_COLOR_SUM 0x8458
#define GL_CURRENT_SECONDARY_COLOR 0x8459
#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
#define GL_SECONDARY_COLOR_ARRAY 0x845E
#define GL_TEXTURE_FILTER_CONTROL 0x8500
#define GL_DEPTH_TEXTURE_MODE 0x884B
#define GL_COMPARE_R_TO_TEXTURE 0x884E
#endif
#ifndef GL_VERSION_2_0
typedef char GLchar;
#endif
#ifndef GL_VERSION_4_3
#define GL_DEBUG_OUTPUT 0x92E0
#endif
#ifndef GL_ARB_debug_output
#define GL_ARB_debug_output 1
#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
#define GL_DEBUG_SOURCE_API_ARB 0x8246
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
#endif
#ifndef GL_ARB_vertex_buffer_object
// GL types for handling large vertex buffer objects
typedef ptrdiff_t GLintptrARB;
typedef ptrdiff_t GLsizeiptrARB;
#endif
#ifndef GL_ARB_shader_objects
// GL types for program/shader text and shader object handles
typedef char GLcharARB;
typedef unsigned int GLhandleARB;
#endif
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
#endif
#ifndef GL_ARB_vertex_buffer_object
#define GL_BUFFER_SIZE_ARB 0x8764
#define GL_BUFFER_USAGE_ARB 0x8765
#define GL_ARRAY_BUFFER_ARB 0x8892
#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
#define GL_READ_ONLY_ARB 0x88B8
#define GL_WRITE_ONLY_ARB 0x88B9
#define GL_READ_WRITE_ARB 0x88BA
#define GL_BUFFER_ACCESS_ARB 0x88BB
#define GL_BUFFER_MAPPED_ARB 0x88BC
#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
#define GL_STREAM_DRAW_ARB 0x88E0
#define GL_STREAM_READ_ARB 0x88E1
#define GL_STREAM_COPY_ARB 0x88E2
#define GL_STATIC_DRAW_ARB 0x88E4
#define GL_STATIC_READ_ARB 0x88E5
#define GL_STATIC_COPY_ARB 0x88E6
#define GL_DYNAMIC_DRAW_ARB 0x88E8
#define GL_DYNAMIC_READ_ARB 0x88E9
#define GL_DYNAMIC_COPY_ARB 0x88EA
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
// GL_ARB_debug_output
typedef void (APIENTRY *GLDEBUGARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
typedef void (APIENTRY *GLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
typedef void (APIENTRY *GLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
typedef void (APIENTRY *GLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGARBPROC callback, const void *userParam);
typedef GLuint (APIENTRY *GLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
// GL_ARB_vertex_buffer_object
typedef void (APIENTRY *GLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
typedef void (APIENTRY *GLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
typedef void (APIENTRY *GLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
typedef GLboolean (APIENTRY *GLISBUFFERARBPROC) (GLuint buffer);
typedef void (APIENTRY *GLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
typedef void (APIENTRY *GLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
typedef void (APIENTRY *GLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
typedef GLvoid* (APIENTRY *GLMAPBUFFERARBPROC) (GLenum target, GLenum access);
typedef GLboolean (APIENTRY *GLUNMAPBUFFERARBPROC) (GLenum target);
typedef void (APIENTRY *GLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRY *GLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
#ifndef GL_ARB_multisample
#define GL_ARB_multisample 1
#define GL_MULTISAMPLE_ARB 0x809D
#endif
#ifndef GL_ARB_framebuffer_object
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
#define GL_FRAMEBUFFER_DEFAULT 0x8218
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_DEPTH_STENCIL 0x84F9
#define GL_UNSIGNED_INT_24_8 0x84FA
#define GL_DEPTH24_STENCIL8 0x88F0
#define GL_TEXTURE_STENCIL_SIZE 0x88F1
#define GL_TEXTURE_RED_TYPE 0x8C10
#define GL_TEXTURE_GREEN_TYPE 0x8C11
#define GL_TEXTURE_BLUE_TYPE 0x8C12
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
#define GL_UNSIGNED_NORMALIZED 0x8C17
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_READ_FRAMEBUFFER 0x8CA8
#define GL_DRAW_FRAMEBUFFER 0x8CA9
#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
#define GL_RENDERBUFFER_SAMPLES 0x8CAB
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_COLOR_ATTACHMENT1 0x8CE1
#define GL_COLOR_ATTACHMENT2 0x8CE2
#define GL_COLOR_ATTACHMENT3 0x8CE3
#define GL_COLOR_ATTACHMENT4 0x8CE4
#define GL_COLOR_ATTACHMENT5 0x8CE5
#define GL_COLOR_ATTACHMENT6 0x8CE6
#define GL_COLOR_ATTACHMENT7 0x8CE7
#define GL_COLOR_ATTACHMENT8 0x8CE8
#define GL_COLOR_ATTACHMENT9 0x8CE9
#define GL_COLOR_ATTACHMENT10 0x8CEA
#define GL_COLOR_ATTACHMENT11 0x8CEB
#define GL_COLOR_ATTACHMENT12 0x8CEC
#define GL_COLOR_ATTACHMENT13 0x8CED
#define GL_COLOR_ATTACHMENT14 0x8CEE
#define GL_COLOR_ATTACHMENT15 0x8CEF
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_FRAMEBUFFER 0x8D40
#define GL_RENDERBUFFER 0x8D41
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
#define GL_STENCIL_INDEX1 0x8D46
#define GL_STENCIL_INDEX4 0x8D47
#define GL_STENCIL_INDEX8 0x8D48
#define GL_STENCIL_INDEX16 0x8D49
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
#define GL_MAX_SAMPLES 0x8D57
#endif
// GL_ARB_framebuffer_object
typedef GLboolean (APIENTRY *GLISRENDERBUFFERARBPROC) (GLuint renderbuffer);
typedef void (APIENTRY *GLBINDRENDERBUFFERARBPROC) (GLenum target, GLuint renderbuffer);
typedef void (APIENTRY *GLDELETERENDERBUFFERSARBPROC) (GLsizei n, const GLuint *renderbuffers);
typedef void (APIENTRY *GLGENRENDERBUFFERSARBPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (APIENTRY *GLRENDERBUFFERSTORAGEARBPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRY *GLGETRENDERBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLboolean (APIENTRY *GLISFRAMEBUFFERARBPROC) (GLuint framebuffer);
typedef void (APIENTRY *GLBINDFRAMEBUFFERARBPROC) (GLenum target, GLuint framebuffer);
typedef void (APIENTRY *GLDELETEFRAMEBUFFERSARBPROC) (GLsizei n, const GLuint *framebuffers);
typedef void (APIENTRY *GLGENFRAMEBUFFERSARBPROC) (GLsizei n, GLuint *framebuffers);
typedef GLenum (APIENTRY *GLCHECKFRAMEBUFFERSTATUSARBPROC) (GLenum target);
typedef void (APIENTRY *GLFRAMEBUFFERTEXTURE1DARBPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRY *GLFRAMEBUFFERTEXTURE2DARBPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRY *GLFRAMEBUFFERTEXTURE3DARBPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
typedef void (APIENTRY *GLFRAMEBUFFERRENDERBUFFERARBPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (APIENTRY *GLGETFRAMEBUFFERATTACHMENTPARAMETERIVARBPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
typedef void (APIENTRY *GLGENERATEMIPMAPARBPROC) (GLenum target);
typedef void (APIENTRY *GLBLITFRAMEBUFFERARBPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (APIENTRY *GLRENDERBUFFERSTORAGEMULTISAMPLEARBPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRY *GLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
#ifndef GL_EXT_framebuffer_object
#define GL_EXT_framebuffer_object 1
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
#define GL_FRAMEBUFFER_EXT 0x8D40
#define GL_RENDERBUFFER_EXT 0x8D41
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
#define GL_STENCIL_INDEX1_EXT 0x8D46
#define GL_STENCIL_INDEX4_EXT 0x8D47
#define GL_STENCIL_INDEX8_EXT 0x8D48
#define GL_STENCIL_INDEX16_EXT 0x8D49
#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
#endif
// GL_EXT_framebuffer_object
typedef GLboolean (APIENTRY *GLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
typedef void (APIENTRY *GLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
typedef void (APIENTRY *GLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
typedef void (APIENTRY *GLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (APIENTRY *GLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRY *GLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLboolean (APIENTRY *GLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
typedef void (APIENTRY *GLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
typedef void (APIENTRY *GLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
typedef void (APIENTRY *GLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
typedef GLenum (APIENTRY *GLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
typedef void (APIENTRY *GLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRY *GLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRY *GLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
typedef void (APIENTRY *GLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (APIENTRY *GLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
typedef void (APIENTRY *GLGENERATEMIPMAPEXTPROC) (GLenum target);
#ifndef GL_ARB_shader_objects
#define GL_PROGRAM_OBJECT_ARB 0x8B40
#define GL_SHADER_OBJECT_ARB 0x8B48
#define GL_OBJECT_TYPE_ARB 0x8B4E
#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
#define GL_FLOAT_VEC2_ARB 0x8B50
#define GL_FLOAT_VEC3_ARB 0x8B51
#define GL_FLOAT_VEC4_ARB 0x8B52
#define GL_INT_VEC2_ARB 0x8B53
#define GL_INT_VEC3_ARB 0x8B54
#define GL_INT_VEC4_ARB 0x8B55
#define GL_BOOL_ARB 0x8B56
#define GL_BOOL_VEC2_ARB 0x8B57
#define GL_BOOL_VEC3_ARB 0x8B58
#define GL_BOOL_VEC4_ARB 0x8B59
#define GL_FLOAT_MAT2_ARB 0x8B5A
#define GL_FLOAT_MAT3_ARB 0x8B5B
#define GL_FLOAT_MAT4_ARB 0x8B5C
#define GL_SAMPLER_1D_ARB 0x8B5D
#define GL_SAMPLER_2D_ARB 0x8B5E
#define GL_SAMPLER_3D_ARB 0x8B5F
#define GL_SAMPLER_CUBE_ARB 0x8B60
#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
#define GL_SAMPLER_2D_RECT_ARB 0x8B63
#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
#endif
// GL_ARB_shader_objects
typedef void (APIENTRY *GLDELETEOBJECTARBPROC) (GLhandleARB obj);
typedef GLhandleARB (APIENTRY *GLGETHANDLEARBPROC) (GLenum pname);
typedef void (APIENTRY *GLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
typedef GLhandleARB (APIENTRY *GLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
typedef void (APIENTRY *GLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
typedef void (APIENTRY *GLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
typedef GLhandleARB (APIENTRY *GLCREATEPROGRAMOBJECTARBPROC) (void);
typedef void (APIENTRY *GLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
typedef void (APIENTRY *GLLINKPROGRAMARBPROC) (GLhandleARB programObj);
typedef void (APIENTRY *GLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
typedef void (APIENTRY *GLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
typedef void (APIENTRY *GLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
typedef void (APIENTRY *GLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
typedef void (APIENTRY *GLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
typedef void (APIENTRY *GLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
typedef void (APIENTRY *GLUNIFORM1IARBPROC) (GLint location, GLint v0);
typedef void (APIENTRY *GLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
typedef void (APIENTRY *GLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
typedef void (APIENTRY *GLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
typedef void (APIENTRY *GLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRY *GLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRY *GLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRY *GLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRY *GLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRY *GLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRY *GLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRY *GLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRY *GLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRY *GLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRY *GLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRY *GLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
typedef void (APIENTRY *GLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
typedef void (APIENTRY *GLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
typedef void (APIENTRY *GLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
typedef GLint (APIENTRY *GLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
typedef void (APIENTRY *GLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
typedef void (APIENTRY *GLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
typedef void (APIENTRY *GLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
typedef void (APIENTRY *GLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
#ifndef GL_ARB_vertex_shader
#define GL_VERTEX_SHADER_ARB 0x8B31
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
#endif
// GL_ARB_vertex_shader
typedef void (APIENTRY *GLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
typedef void (APIENTRY *GLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
typedef GLint (APIENTRY *GLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
#ifndef GL_ARB_fragment_shader
#define GL_FRAGMENT_SHADER_ARB 0x8B30
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
#endif
#ifndef GL_ARB_fragment_shader
#define GL_ARB_fragment_shader 1
#endif
extern GLBINDBUFFERARBPROC lcBindBufferARB;
extern GLDELETEBUFFERSARBPROC lcDeleteBuffersARB;
extern GLGENBUFFERSARBPROC lcGenBuffersARB;
extern GLISBUFFERARBPROC lcIsBufferARB;
extern GLBUFFERDATAARBPROC lcBufferDataARB;
extern GLBUFFERSUBDATAARBPROC lcBufferSubDataARB;
extern GLGETBUFFERSUBDATAARBPROC lcGetBufferSubDataARB;
extern GLMAPBUFFERARBPROC lcMapBufferARB;
extern GLUNMAPBUFFERARBPROC lcUnmapBufferARB;
extern GLGETBUFFERPARAMETERIVARBPROC lcGetBufferParameterivARB;
extern GLGETBUFFERPOINTERVARBPROC lcGetBufferPointervARB;
extern GLISRENDERBUFFERARBPROC lcIsRenderbufferARB;
extern GLBINDRENDERBUFFERARBPROC lcBindRenderbufferARB;
extern GLDELETERENDERBUFFERSARBPROC lcDeleteRenderbuffersARB;
extern GLGENRENDERBUFFERSARBPROC lcGenRenderbuffersARB;
extern GLRENDERBUFFERSTORAGEARBPROC lcRenderbufferStorageARB;
extern GLGETRENDERBUFFERPARAMETERIVARBPROC lcGetRenderbufferParameterivARB;
extern GLISFRAMEBUFFERARBPROC lcIsFramebufferARB;
extern GLBINDFRAMEBUFFERARBPROC lcBindFramebufferARB;
extern GLDELETEFRAMEBUFFERSARBPROC lcDeleteFramebuffersARB;
extern GLGENFRAMEBUFFERSARBPROC lcGenFramebuffersARB;
extern GLCHECKFRAMEBUFFERSTATUSARBPROC lcCheckFramebufferStatusARB;
extern GLFRAMEBUFFERTEXTURE1DARBPROC lcFramebufferTexture1DARB;
extern GLFRAMEBUFFERTEXTURE2DARBPROC lcFramebufferTexture2DARB;
extern GLFRAMEBUFFERTEXTURE3DARBPROC lcFramebufferTexture3DARB;
extern GLFRAMEBUFFERRENDERBUFFERARBPROC lcFramebufferRenderbufferARB;
extern GLGETFRAMEBUFFERATTACHMENTPARAMETERIVARBPROC lcGetFramebufferAttachmentParameterivARB;
extern GLGENERATEMIPMAPARBPROC lcGenerateMipmapARB;
extern GLBLITFRAMEBUFFERARBPROC lcBlitFramebufferARB;
extern GLRENDERBUFFERSTORAGEMULTISAMPLEARBPROC lcRenderbufferStorageMultisampleARB;
extern GLFRAMEBUFFERTEXTURELAYERARBPROC lcFramebufferTextureLayerARB;
extern GLISRENDERBUFFEREXTPROC lcIsRenderbufferEXT;
extern GLBINDRENDERBUFFEREXTPROC lcBindRenderbufferEXT;
extern GLDELETERENDERBUFFERSEXTPROC lcDeleteRenderbuffersEXT;
extern GLGENRENDERBUFFERSEXTPROC lcGenRenderbuffersEXT;
extern GLRENDERBUFFERSTORAGEEXTPROC lcRenderbufferStorageEXT;
extern GLGETRENDERBUFFERPARAMETERIVEXTPROC lcGetRenderbufferParameterivEXT;
extern GLISFRAMEBUFFEREXTPROC lcIsFramebufferEXT;
extern GLBINDFRAMEBUFFEREXTPROC lcBindFramebufferEXT;
extern GLDELETEFRAMEBUFFERSEXTPROC lcDeleteFramebuffersEXT;
extern GLGENFRAMEBUFFERSEXTPROC lcGenFramebuffersEXT;
extern GLCHECKFRAMEBUFFERSTATUSEXTPROC lcCheckFramebufferStatusEXT;
extern GLFRAMEBUFFERTEXTURE1DEXTPROC lcFramebufferTexture1DEXT;
extern GLFRAMEBUFFERTEXTURE2DEXTPROC lcFramebufferTexture2DEXT;
extern GLFRAMEBUFFERTEXTURE3DEXTPROC lcFramebufferTexture3DEXT;
extern GLFRAMEBUFFERRENDERBUFFEREXTPROC lcFramebufferRenderbufferEXT;
extern GLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC lcGetFramebufferAttachmentParameterivEXT;
extern GLGENERATEMIPMAPEXTPROC lcGenerateMipmapEXT;
extern GLDELETEOBJECTARBPROC lcDeleteObjectARB;
extern GLGETHANDLEARBPROC lcGetHandleARB;
extern GLDETACHOBJECTARBPROC lcDetachObjectARB;
extern GLCREATESHADEROBJECTARBPROC lcCreateShaderObjectARB;
extern GLSHADERSOURCEARBPROC lcShaderSourceARB;
extern GLCOMPILESHADERARBPROC lcCompileShaderARB;
extern GLCREATEPROGRAMOBJECTARBPROC lcCreateProgramObjectARB;
extern GLATTACHOBJECTARBPROC lcAttachObjectARB;
extern GLLINKPROGRAMARBPROC lcLinkProgramARB;
extern GLUSEPROGRAMOBJECTARBPROC lcUseProgramObjectARB;
extern GLVALIDATEPROGRAMARBPROC lcValidateProgramARB;
extern GLUNIFORM1FARBPROC lcUniform1fARB;
extern GLUNIFORM2FARBPROC lcUniform2fARB;
extern GLUNIFORM3FARBPROC lcUniform3fARB;
extern GLUNIFORM4FARBPROC lcUniform4fARB;
extern GLUNIFORM1IARBPROC lcUniform1iARB;
extern GLUNIFORM2IARBPROC lcUniform2iARB;
extern GLUNIFORM3IARBPROC lcUniform3iARB;
extern GLUNIFORM4IARBPROC lcUniform4iARB;
extern GLUNIFORM1FVARBPROC lcUniform1fvARB;
extern GLUNIFORM2FVARBPROC lcUniform2fvARB;
extern GLUNIFORM3FVARBPROC lcUniform3fvARB;
extern GLUNIFORM4FVARBPROC lcUniform4fvARB;
extern GLUNIFORM1IVARBPROC lcUniform1ivARB;
extern GLUNIFORM2IVARBPROC lcUniform2ivARB;
extern GLUNIFORM3IVARBPROC lcUniform3ivARB;
extern GLUNIFORM4IVARBPROC lcUniform4ivARB;
extern GLUNIFORMMATRIX2FVARBPROC lcUniformMatrix2fvARB;
extern GLUNIFORMMATRIX3FVARBPROC lcUniformMatrix3fvARB;
extern GLUNIFORMMATRIX4FVARBPROC lcUniformMatrix4fvARB;
extern GLGETOBJECTPARAMETERFVARBPROC lcGetObjectParameterfvARB;
extern GLGETOBJECTPARAMETERIVARBPROC lcGetObjectParameterivARB;
extern GLGETINFOLOGARBPROC lcGetInfoLogARB;
extern GLGETATTACHEDOBJECTSARBPROC lcGetAttachedObjectsARB;
extern GLGETUNIFORMLOCATIONARBPROC lcGetUniformLocationARB;
extern GLGETACTIVEUNIFORMARBPROC lcGetActiveUniformARB;
extern GLGETUNIFORMFVARBPROC lcGetUniformfvARB;
extern GLGETUNIFORMIVARBPROC lcGetUniformivARB;
extern GLGETSHADERSOURCEARBPROC lcGetShaderSourceARB;
extern GLBINDATTRIBLOCATIONARBPROC lcBindAttribLocationARB;
extern GLGETACTIVEATTRIBARBPROC lcGetActiveAttribARB;
extern GLGETATTRIBLOCATIONARBPROC lcGetAttribLocationARB;
#define glBindBuffer lcBindBufferARB
#define glDeleteBuffers lcDeleteBuffersARB
#define glGenBuffers lcGenBuffersARB
#define glIsBuffer lcIsBufferARB
#define glBufferData lcBufferDataARB
#define glBufferSubData lcBufferSubDataARB
#define glGetBufferSubData lcGetBufferSubDataARB
#define glMapBuffer lcMapBufferARB
#define glUnmapBuffer lcUnmapBufferARB
#define glGetBufferParameteriv lcGetBufferParameterivARB
#define glGetBufferPointerv lcGetBufferPointervARB
#define glIsRenderbuffer lcIsRenderbufferARB
#define glBindRenderbuffer lcBindRenderbufferARB
#define glDeleteRenderbuffers lcDeleteRenderbuffersARB
#define glGenRenderbuffers lcGenRenderbuffersARB
#define glRenderbufferStorage lcRenderbufferStorageARB
#define glGetRenderbufferParameteriv lcGetRenderbufferParameterivARB
#define glIsFramebuffer lcIsFramebufferARB
#define glBindFramebuffer lcBindFramebufferARB
#define glDeleteFramebuffers lcDeleteFramebuffersARB
#define glGenFramebuffers lcGenFramebuffersARB
#define glCheckFramebufferStatus lcCheckFramebufferStatusARB
#define glFramebufferTexture1D lcFramebufferTexture1DARB
#define glFramebufferTexture2D lcFramebufferTexture2DARB
#define glFramebufferTexture3D lcFramebufferTexture3DARB
#define glFramebufferRenderbuffer lcFramebufferRenderbufferARB
#define glGetFramebufferAttachmentParameteriv lcGetFramebufferAttachmentParameterivARB
#define glGenerateMipmap lcGenerateMipmapARB
#define glBlitFramebuffer lcBlitFramebufferARB
#define glRenderbufferStorageMultisample lcRenderbufferStorageMultisampleARB
#define glFramebufferTextureLayer lcFramebufferTextureLayerARB
#define glIsRenderbufferEXT lcIsRenderbufferEXT
#define glBindRenderbufferEXT lcBindRenderbufferEXT
#define glDeleteRenderbuffersEXT lcDeleteRenderbuffersEXT
#define glGenRenderbuffersEXT lcGenRenderbuffersEXT
#define glRenderbufferStorageEXT lcRenderbufferStorageEXT
#define glGetRenderbufferParameterivEXT lcGetRenderbufferParameterivEXT
#define glIsFramebufferEXT lcIsFramebufferEXT
#define glBindFramebufferEXT lcBindFramebufferEXT
#define glDeleteFramebuffersEXT lcDeleteFramebuffersEXT
#define glGenFramebuffersEXT lcGenFramebuffersEXT
#define glCheckFramebufferStatusEXT lcCheckFramebufferStatusEXT
#define glFramebufferTexture1DEXT lcFramebufferTexture1DEXT
#define glFramebufferTexture2DEXT lcFramebufferTexture2DEXT
#define glFramebufferTexture3DEXT lcFramebufferTexture3DEXT
#define glFramebufferRenderbufferEXT lcFramebufferRenderbufferEXT
#define glGetFramebufferAttachmentParameterivEXT lcGetFramebufferAttachmentParameterivEXT
#define glGenerateMipmapEXT lcGenerateMipmapEXT
#define glDeleteObjectARB lcDeleteObjectARB
#define glGetHandleARB lcGetHandleARB
#define glDetachObjectARB lcDetachObjectARB
#define glCreateShaderObjectARB lcCreateShaderObjectARB
#define glShaderSourceARB lcShaderSourceARB
#define glCompileShaderARB lcCompileShaderARB
#define glCreateProgramObjectARB lcCreateProgramObjectARB
#define glAttachObjectARB lcAttachObjectARB
#define glLinkProgramARB lcLinkProgramARB
#define glUseProgramObjectARB lcUseProgramObjectARB
#define glValidateProgramARB lcValidateProgramARB
#define glUniform1fARB lcUniform1fARB
#define glUniform2fARB lcUniform2fARB
#define glUniform3fARB lcUniform3fARB
#define glUniform4fARB lcUniform4fARB
#define glUniform1iARB lcUniform1iARB
#define glUniform2iARB lcUniform2iARB
#define glUniform3iARB lcUniform3iARB
#define glUniform4iARB lcUniform4iARB
#define glUniform1fvARB lcUniform1fvARB
#define glUniform2fvARB lcUniform2fvARB
#define glUniform3fvARB lcUniform3fvARB
#define glUniform4fvARB lcUniform4fvARB
#define glUniform1ivARB lcUniform1ivARB
#define glUniform2ivARB lcUniform2ivARB
#define glUniform3ivARB lcUniform3ivARB
#define glUniform4ivARB lcUniform4ivARB
#define glUniformMatrix2fvARB lcUniformMatrix2fvARB
#define glUniformMatrix3fvARB lcUniformMatrix3fvARB
#define glUniformMatrix4fvARB lcUniformMatrix4fvARB
#define glGetObjectParameterfvARB lcGetObjectParameterfvARB
#define glGetObjectParameterivARB lcGetObjectParameterivARB
#define glGetInfoLogARB lcGetInfoLogARB
#define glGetAttachedObjectsARB lcGetAttachedObjectsARB
#define glGetUniformLocationARB lcGetUniformLocationARB
#define glGetActiveUniformARB lcGetActiveUniformARB
#define glGetUniformfvARB lcGetUniformfvARB
#define glGetUniformivARB lcGetUniformivARB
#define glGetShaderSourceARB lcGetShaderSourceARB
#define glBindAttribLocationARB lcBindAttribLocationARB
#define glGetActiveAttribARB lcGetActiveAttribARB
#define glGetAttribLocationARB lcGetAttribLocationARB
#endif // _OPENGL_H_

View file

@ -5,7 +5,6 @@
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "opengl.h"
#include "pieceinf.h"
#include "piece.h"
#include "group.h"

View file

@ -3,7 +3,6 @@
#include "lc_mesh.h"
#include "lc_colors.h"
#include "lc_texture.h"
#include "opengl.h"
#include "pieceinf.h"
#include "lc_library.h"
#include "lc_application.h"

View file

@ -2,7 +2,6 @@
#include "lc_math.h"
#include "lc_mesh.h"
#include <locale.h>
#include "opengl.h"
#include "pieceinf.h"
#include "lc_texture.h"
#include "piece.h"

View file

@ -1,8 +1,6 @@
#ifndef _TEXFONT_H_
#define _TEXFONT_H_
#include "opengl.h"
class TexFont
{
public:

View file

@ -124,7 +124,6 @@ SOURCES += common/view.cpp \
common/preview.cpp \
common/pieceinf.cpp \
common/piece.cpp \
common/opengl.cpp \
common/object.cpp \
common/minifig.cpp \
common/light.cpp \
@ -134,6 +133,7 @@ SOURCES += common/view.cpp \
common/lc_commands.cpp \
common/lc_context.cpp \
common/lc_file.cpp \
common/lc_glextensions.cpp \
common/lc_library.cpp \
common/lc_mainwindow.cpp \
common/lc_mesh.cpp \
@ -180,7 +180,6 @@ HEADERS += \
common/preview.h \
common/pieceinf.h \
common/piece.h \
common/opengl.h \
common/object.h \
common/minifig.h \
common/light.h \
@ -192,6 +191,8 @@ HEADERS += \
common/lc_commands.h \
common/lc_context.h \
common/lc_file.h \
common/lc_glext.h \
common/lc_glextensions.h \
common/lc_global.h \
common/lc_glwidget.h \
common/lc_library.h \

View file

@ -3,7 +3,7 @@
#include "ui_lc_qaboutdialog.h"
#include "lc_mainwindow.h"
#include "preview.h"
#include "opengl.h"
#include "lc_glextensions.h"
lcQAboutDialog::lcQAboutDialog(QWidget *parent, void *data) :
QDialog(parent),
@ -33,10 +33,10 @@ lcQAboutDialog::lcQAboutDialog(QWidget *parent, void *data) :
QString Buffers = BuffersFormat.arg(QString::number(Red + Green + Blue + Alpha), RGBA ? "RGBA" : tr("indexed"), DoubleBuffer ? tr("double buffered") : QString(), QString::number(Depth), QString::number(Stencil));
QString ExtensionsFormat = tr("GL_ARB_vertex_buffer_object extension: %1\nGL_ARB_framebuffer_object extension: %2\nGL_EXT_framebuffer_object extension: %3\nGL_EXT_texture_filter_anisotropic extension: %4\n");
QString VertexBufferObject = GL_HasVertexBufferObject() ? tr("Supported") : tr("Not supported");
QString FramebufferObjectARB = GL_HasFramebufferObjectARB() ? tr("Supported") : tr("Not supported");
QString FramebufferObjectEXT = GL_HasFramebufferObjectEXT() ? tr("Supported") : tr("Not supported");
QString Anisotropic = GL_SupportsAnisotropic ? tr("Supported (max %1)").arg(GL_MaxAnisotropy) : tr("Not supported");
QString VertexBufferObject = gSupportsVertexBufferObject ? tr("Supported") : tr("Not supported");
QString FramebufferObjectARB = gSupportsFramebufferObjectARB ? tr("Supported") : tr("Not supported");
QString FramebufferObjectEXT = gSupportsFramebufferObjectEXT ? tr("Supported") : tr("Not supported");
QString Anisotropic = gSupportsAnisotropic ? tr("Supported (max %1)").arg(gMaxAnisotropy) : tr("Not supported");
QString Extensions = ExtensionsFormat.arg(VertexBufferObject, FramebufferObjectARB, FramebufferObjectEXT, Anisotropic);
ui->info->setText(Version + Buffers + Extensions);

View file

@ -1,6 +1,7 @@
#include "lc_global.h"
#include "lc_qglwidget.h"
#include "lc_glwidget.h"
#include "lc_glextensions.h"
#include "project.h"
#include "lc_library.h"
#include "lc_application.h"
@ -27,13 +28,6 @@ void lcGLWidget::Redraw()
Widget->mUpdateTimer.start(0);
}
void* lcGLWidget::GetExtensionAddress(const char* FunctionName)
{
QGLWidget* Widget = (QGLWidget*)mWidget;
return (void*)Widget->context()->getProcAddress(FunctionName);
}
void lcGLWidget::ShowPopupMenu()
{
QGLWidget* Widget = (QGLWidget*)mWidget;
@ -124,13 +118,12 @@ lcQGLWidget::lcQGLWidget(QWidget *parent, lcQGLWidget *share, lcGLWidget *owner,
connect(&mUpdateTimer, SIGNAL(timeout()), this, SLOT(updateGL()));
widget->MakeCurrent();
GL_InitializeSharedExtensions(widget);
widget->OnInitialUpdate();
// TODO: Find a better place for the grid texture and font
gTexFont.Load();
if (!gWidgetCount)
{
lcInitializeGLExtensions(context());
View::CreateResources(widget->mContext);
gPlaceholderMesh = new lcMesh;
@ -138,6 +131,8 @@ lcQGLWidget::lcQGLWidget(QWidget *parent, lcQGLWidget *share, lcGLWidget *owner,
}
gWidgetCount++;
widget->OnInitialUpdate();
preferredSize = QSize(0, 0);
setMouseTracking(true);