00001 /* 00002 * OpenGL extensions header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_OPENGLFUNCTIONSARB_H__ 00009 #define __SP_OPENGLFUNCTIONSARB_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 00014 #if defined(SP_COMPILE_WITH_OPENGL) 00015 00016 00017 #if defined(SP_PLATFORM_WINDOWS) 00018 # include <windows.h> 00019 #elif defined(SP_PLATFORM_LINUX) 00020 # include <sys/utsname.h> 00021 #endif 00022 00023 #if defined(SP_PLATFORM_MACOSX) 00024 # include <OpenGL/gl.h> 00025 # include <OpenGL/glext.h> 00026 #else 00027 # include <GL/gl.h> 00028 # include <GL/glext.h> 00029 #endif 00030 00031 #if defined(SP_PLATFORM_WINDOWS) 00032 # include <GL/wglext.h> 00033 #elif defined(SP_PLATFORM_LINUX) 00034 # include <GL/glx.h> 00035 #endif 00036 00037 00038 namespace sp 00039 { 00040 00041 00042 /* ARB balance macros between OpenGL and OpenGL|ES */ 00043 00044 #define glGetProgramiv glGetObjectParameterivARB 00045 #define glGetShaderiv glGetObjectParameterivARB 00046 #define glGetProgramInfoLog glGetInfoLogARB 00047 #define glGetShaderInfoLog glGetInfoLogARB 00048 00049 /* Extended type definitions */ 00050 00051 #if defined(SP_PLATFORM_WINDOWS) 00052 typedef BOOL (APIENTRY * PFNWGLSWAPINTERVALFARPROC)(int); 00053 #endif 00054 00055 /*typedef void (APIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); 00056 typedef void (APIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); 00057 typedef void (APIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); 00058 typedef void (APIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, int size, const GLvoid* data, GLenum usage);*/ 00059 00060 /* Function pointer (OpenGL extensions & ARB functions) */ 00061 00062 // OpenGL extendet functions -> (glext.h) 00063 // Multitexturing: GL_TEXTURE0_ARB - GL_TEXTURE31_ARB 00064 00065 #if defined(SP_PLATFORM_WINDOWS) 00066 00067 extern PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; 00068 extern PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT; 00069 00070 #elif defined(SP_PLATFORM_LINUX) 00071 00072 extern PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI; 00073 00074 #endif 00075 00076 extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB; 00077 extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; 00078 //extern PFNGLACTIVESTENCILFACEEXTPROC glActiveStencilFaceEXT; 00079 extern PFNGLTEXIMAGE3DEXTPROC glTexImage3DEXT; 00080 extern PFNGLTEXSUBIMAGE3DEXTPROC glTexSubImage3DEXT; 00081 00082 /* Vertex buffer objects extension pointers */ 00083 00084 extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB; 00085 extern PFNGLFOGCOORDPOINTERPROC glFogCoordPointer; 00086 00087 extern PFNGLGENBUFFERSARBPROC glGenBuffersARB; 00088 extern PFNGLBINDBUFFERARBPROC glBindBufferARB; 00089 extern PFNGLBUFFERDATAARBPROC glBufferDataARB; 00090 extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB; 00091 extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB; 00092 00093 /* Objects for "GL_ARB_draw_instanced" extensions */ 00094 00095 extern PFNGLDRAWELEMENTSINSTANCEDARBPROC glDrawElementsInstancedARB; 00096 extern PFNGLDRAWARRAYSINSTANCEDARBPROC glDrawArraysInstancedARB; 00097 00098 /* Frame buffer objects extension pointers */ 00099 00100 extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT; 00101 extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT; 00102 extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT; 00103 extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT; 00104 extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT; 00105 extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT; 00106 extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT; 00107 extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT; 00108 extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT; 00109 extern PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glFramebufferTextureLayerEXT; 00110 extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT; 00111 extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glRenderbufferStorageMultisampleEXT; 00112 extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT; 00113 extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT; 00114 extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT; 00115 00116 /* OpenGL shading language (GLSL) extension pointers */ 00117 00118 extern PFNGLBINDPROGRAMARBPROC glBindProgramARB; 00119 extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB; 00120 extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB; 00121 extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB; 00122 extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB; 00123 extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; 00124 00125 extern PFNGLDELETEPROGRAMPROC glDeleteProgram; 00126 extern PFNGLDELETESHADERPROC glDeleteShader; 00127 extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB; 00128 extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB; 00129 extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB; 00130 extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB; 00131 extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB; 00132 extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB; 00133 extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB; 00134 extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB; 00135 extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB; 00136 extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB; 00137 extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB; 00138 extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB; 00139 extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB; 00140 extern PFNGLUNIFORM1FARBPROC glUniform1fARB; 00141 extern PFNGLUNIFORM3FARBPROC glUniform3fARB; 00142 extern PFNGLUNIFORM4FARBPROC glUniform4fARB; 00143 extern PFNGLUNIFORM1IARBPROC glUniform1iARB; 00144 extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB; 00145 extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB; 00146 extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB; 00147 extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB; 00148 extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB; 00149 extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB; 00150 extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB; 00151 extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB; 00152 extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB; 00153 extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB; 00154 extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB; 00155 extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB; 00156 extern PFNGLBINDFRAGDATALOCATIONEXTPROC glBindFragDataLocationEXT; 00157 00158 extern PFNGLPROGRAMPARAMETERIEXTPROC glProgramParameteriEXT; 00159 00160 #ifdef GL_ARB_tessellation_shader 00161 extern PFNGLPATCHPARAMETERIPROC glPatchParameteriARB; 00162 extern PFNGLPATCHPARAMETERFVPROC glPatchParameterfvARB; 00163 #endif 00164 00165 #ifndef GL_GLEXT_PROTOTYPES 00166 00167 extern PFNGLBINDBUFFERBASEPROC glBindBufferBase; 00168 00169 extern PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex; 00170 extern PFNGLGETACTIVEUNIFORMBLOCKIVPROC glGetActiveUniformBlockiv; 00171 extern PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glGetActiveUniformBlockName; 00172 extern PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding; 00173 00174 #endif 00175 00176 00177 } // /namespace sp 00178 00179 00180 #endif 00181 00182 #endif 00183 00184 00185 00186 // ================================================================================