MPMA Framework 0.4
Extensions.h
Go to the documentation of this file.
00001 
00002 //Luke Lenhart, 2009
00003 //See /docs/License.txt for details on how this code may be used.
00004 
00005 #pragma once
00006 
00007 #include "../base/Setup.h"
00008 
00009 #ifdef MPMA_COMPILE_GFXSETUP
00010 
00011 #include "GL.h"
00012 //#define GL_GLEXT_PROTOTYPES
00013 #include <GL/glext.h> //Some platforms may need to obtain this from http://www.opengl.org/registry/
00014 #include <string>
00015 
00016 namespace GFX
00017 {
00018     typedef void (*VoidFuncPtrType)();
00019 
00021     bool IsExtensionAvailable(const std::string &name);
00022 
00024     VoidFuncPtrType GetExtensionFunction(const std::string &name);
00025 }
00026 
00027 #ifdef OPENGL_LOAD_COMMON_EXTENSIONS
00028 
00029 namespace GFX_OPENGL_EXTENSIONS
00030 {
00031     extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
00032     extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
00033     extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
00034     extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
00035 #if !defined(linux) //curiously, these seem to already be defined in the base gl on linux even though they're extensions... which causes a name conflict with our declaration
00036     extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
00037     extern PFNGLACTIVETEXTUREPROC glActiveTextureARB;
00038 #endif
00039 
00040     extern PFNGLCREATESHADERPROC glCreateShader;
00041     extern PFNGLDELETESHADERPROC glDeleteShader;
00042     extern PFNGLSHADERSOURCEPROC glShaderSourceARB;
00043     extern PFNGLCOMPILESHADERPROC glCompileShaderARB;
00044     extern PFNGLGETSHADERIVPROC glGetShaderiv;
00045     extern PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
00046     extern PFNGLCREATEPROGRAMPROC glCreateProgram;
00047     extern PFNGLDELETEPROGRAMPROC glDeleteProgram;
00048     extern PFNGLATTACHSHADERPROC glAttachShader;
00049     extern PFNGLDETACHSHADERPROC glDetachShader;
00050     extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
00051     extern PFNGLGETPROGRAMIVNVPROC glGetProgramiv;
00052     extern PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
00053     extern PFNGLUSEPROGRAMPROC glUseProgram;
00054     extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
00055     extern PFNGLUNIFORM1FPROC glUniform1fARB;
00056     extern PFNGLUNIFORM2FPROC glUniform2fARB;
00057     extern PFNGLUNIFORM3FPROC glUniform3fARB;
00058     extern PFNGLUNIFORM4FPROC glUniform4fARB;
00059     extern PFNGLUNIFORM1IPROC glUniform1iARB;
00060     extern PFNGLUNIFORM2IPROC glUniform2iARB;
00061     extern PFNGLUNIFORM3IPROC glUniform3iARB;
00062     extern PFNGLUNIFORM4IPROC glUniform4iARB;
00063     extern PFNGLUNIFORM1FVPROC glUniform1fvARB;
00064     extern PFNGLUNIFORM2FVPROC glUniform2fvARB;
00065     extern PFNGLUNIFORM3FVPROC glUniform3fvARB;
00066     extern PFNGLUNIFORM4FVPROC glUniform4fvARB;
00067     extern PFNGLUNIFORM1IVPROC glUniform1ivARB;
00068     extern PFNGLUNIFORM2IVPROC glUniform2ivARB;
00069     extern PFNGLUNIFORM3IVPROC glUniform3ivARB;
00070     extern PFNGLUNIFORM4IVPROC glUniform4ivARB;
00071     extern PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fvARB;
00072     extern PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fvARB;
00073     extern PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fvARB;
00074 }
00075 using namespace GFX_OPENGL_EXTENSIONS;
00076 
00077 #endif //GFX_OPENGL_EXTENSIONS
00078 
00079 #endif //#ifdef MPMA_COMPILE_GFXSETUP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends