namespace Msp {
namespace GL {
-PFNGLDELETEOBJECTARBPROC glDeleteObjectARB=0;
-PFNGLGETHANDLEARBPROC glGetHandleARB=0;
-PFNGLDETACHOBJECTARBPROC glDetachObjectARB=0;
-PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB=0;
-PFNGLSHADERSOURCEARBPROC glShaderSourceARB=0;
-PFNGLCOMPILESHADERARBPROC glCompileShaderARB=0;
-PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB=0;
-PFNGLATTACHOBJECTARBPROC glAttachObjectARB=0;
-PFNGLLINKPROGRAMARBPROC glLinkProgramARB=0;
-PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB=0;
-PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB=0;
-PFNGLUNIFORM1FARBPROC glUniform1fARB=0;
-PFNGLUNIFORM2FARBPROC glUniform2fARB=0;
-PFNGLUNIFORM3FARBPROC glUniform3fARB=0;
-PFNGLUNIFORM4FARBPROC glUniform4fARB=0;
-PFNGLUNIFORM1IARBPROC glUniform1iARB=0;
-PFNGLUNIFORM2IARBPROC glUniform2iARB=0;
-PFNGLUNIFORM3IARBPROC glUniform3iARB=0;
-PFNGLUNIFORM4IARBPROC glUniform4iARB=0;
-PFNGLUNIFORM1FVARBPROC glUniform1fvARB=0;
-PFNGLUNIFORM2FVARBPROC glUniform2fvARB=0;
-PFNGLUNIFORM3FVARBPROC glUniform3fvARB=0;
-PFNGLUNIFORM4FVARBPROC glUniform4fvARB=0;
-PFNGLUNIFORM1IVARBPROC glUniform1ivARB=0;
-PFNGLUNIFORM2IVARBPROC glUniform2ivARB=0;
-PFNGLUNIFORM3IVARBPROC glUniform3ivARB=0;
-PFNGLUNIFORM4IVARBPROC glUniform4ivARB=0;
-PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB=0;
-PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB=0;
-PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB=0;
-PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB=0;
-PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB=0;
-PFNGLGETINFOLOGARBPROC glGetInfoLogARB=0;
-PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB=0;
-PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB=0;
-PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB=0;
-PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB=0;
-PFNGLGETUNIFORMIVARBPROC glGetUniformivARB=0;
-PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB=0;
+PFNGLDELETEOBJECTARBPROC glDeleteObjectARB = 0;
+PFNGLGETHANDLEARBPROC glGetHandleARB = 0;
+PFNGLDETACHOBJECTARBPROC glDetachObjectARB = 0;
+PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = 0;
+PFNGLSHADERSOURCEARBPROC glShaderSourceARB = 0;
+PFNGLCOMPILESHADERARBPROC glCompileShaderARB = 0;
+PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = 0;
+PFNGLATTACHOBJECTARBPROC glAttachObjectARB = 0;
+PFNGLLINKPROGRAMARBPROC glLinkProgramARB = 0;
+PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = 0;
+PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB = 0;
+PFNGLUNIFORM1FARBPROC glUniform1fARB = 0;
+PFNGLUNIFORM2FARBPROC glUniform2fARB = 0;
+PFNGLUNIFORM3FARBPROC glUniform3fARB = 0;
+PFNGLUNIFORM4FARBPROC glUniform4fARB = 0;
+PFNGLUNIFORM1IARBPROC glUniform1iARB = 0;
+PFNGLUNIFORM2IARBPROC glUniform2iARB = 0;
+PFNGLUNIFORM3IARBPROC glUniform3iARB = 0;
+PFNGLUNIFORM4IARBPROC glUniform4iARB = 0;
+PFNGLUNIFORM1FVARBPROC glUniform1fvARB = 0;
+PFNGLUNIFORM2FVARBPROC glUniform2fvARB = 0;
+PFNGLUNIFORM3FVARBPROC glUniform3fvARB = 0;
+PFNGLUNIFORM4FVARBPROC glUniform4fvARB = 0;
+PFNGLUNIFORM1IVARBPROC glUniform1ivARB = 0;
+PFNGLUNIFORM2IVARBPROC glUniform2ivARB = 0;
+PFNGLUNIFORM3IVARBPROC glUniform3ivARB = 0;
+PFNGLUNIFORM4IVARBPROC glUniform4ivARB = 0;
+PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB = 0;
+PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB = 0;
+PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB = 0;
+PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB = 0;
+PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB = 0;
+PFNGLGETINFOLOGARBPROC glGetInfoLogARB = 0;
+PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB = 0;
+PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = 0;
+PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB = 0;
+PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB = 0;
+PFNGLGETUNIFORMIVARBPROC glGetUniformivARB = 0;
+PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB = 0;
void init_arb_shader_objects()
{
- glDeleteObjectARB=reinterpret_cast<PFNGLDELETEOBJECTARBPROC>(get_proc_address("glDeleteObjectARB"));
- glGetHandleARB=reinterpret_cast<PFNGLGETHANDLEARBPROC>(get_proc_address("glGetHandleARB"));
- glDetachObjectARB=reinterpret_cast<PFNGLDETACHOBJECTARBPROC>(get_proc_address("glDetachObjectARB"));
- glCreateShaderObjectARB=reinterpret_cast<PFNGLCREATESHADEROBJECTARBPROC>(get_proc_address("glCreateShaderObjectARB"));
- glShaderSourceARB=reinterpret_cast<PFNGLSHADERSOURCEARBPROC>(get_proc_address("glShaderSourceARB"));
- glCompileShaderARB=reinterpret_cast<PFNGLCOMPILESHADERARBPROC>(get_proc_address("glCompileShaderARB"));
- glCreateProgramObjectARB=reinterpret_cast<PFNGLCREATEPROGRAMOBJECTARBPROC>(get_proc_address("glCreateProgramObjectARB"));
- glAttachObjectARB=reinterpret_cast<PFNGLATTACHOBJECTARBPROC>(get_proc_address("glAttachObjectARB"));
- glLinkProgramARB=reinterpret_cast<PFNGLLINKPROGRAMARBPROC>(get_proc_address("glLinkProgramARB"));
- glUseProgramObjectARB=reinterpret_cast<PFNGLUSEPROGRAMOBJECTARBPROC>(get_proc_address("glUseProgramObjectARB"));
- glValidateProgramARB=reinterpret_cast<PFNGLVALIDATEPROGRAMARBPROC>(get_proc_address("glValidateProgramARB"));
- glUniform1fARB=reinterpret_cast<PFNGLUNIFORM1FARBPROC>(get_proc_address("glUniform1fARB"));
- glUniform2fARB=reinterpret_cast<PFNGLUNIFORM2FARBPROC>(get_proc_address("glUniform2fARB"));
- glUniform3fARB=reinterpret_cast<PFNGLUNIFORM3FARBPROC>(get_proc_address("glUniform3fARB"));
- glUniform4fARB=reinterpret_cast<PFNGLUNIFORM4FARBPROC>(get_proc_address("glUniform4fARB"));
- glUniform1iARB=reinterpret_cast<PFNGLUNIFORM1IARBPROC>(get_proc_address("glUniform1iARB"));
- glUniform2iARB=reinterpret_cast<PFNGLUNIFORM2IARBPROC>(get_proc_address("glUniform2iARB"));
- glUniform3iARB=reinterpret_cast<PFNGLUNIFORM3IARBPROC>(get_proc_address("glUniform3iARB"));
- glUniform4iARB=reinterpret_cast<PFNGLUNIFORM4IARBPROC>(get_proc_address("glUniform4iARB"));
- glUniform1fvARB=reinterpret_cast<PFNGLUNIFORM1FVARBPROC>(get_proc_address("glUniform1fvARB"));
- glUniform2fvARB=reinterpret_cast<PFNGLUNIFORM2FVARBPROC>(get_proc_address("glUniform2fvARB"));
- glUniform3fvARB=reinterpret_cast<PFNGLUNIFORM3FVARBPROC>(get_proc_address("glUniform3fvARB"));
- glUniform4fvARB=reinterpret_cast<PFNGLUNIFORM4FVARBPROC>(get_proc_address("glUniform4fvARB"));
- glUniform1ivARB=reinterpret_cast<PFNGLUNIFORM1IVARBPROC>(get_proc_address("glUniform1ivARB"));
- glUniform2ivARB=reinterpret_cast<PFNGLUNIFORM2IVARBPROC>(get_proc_address("glUniform2ivARB"));
- glUniform3ivARB=reinterpret_cast<PFNGLUNIFORM3IVARBPROC>(get_proc_address("glUniform3ivARB"));
- glUniform4ivARB=reinterpret_cast<PFNGLUNIFORM4IVARBPROC>(get_proc_address("glUniform4ivARB"));
- glUniformMatrix2fvARB=reinterpret_cast<PFNGLUNIFORMMATRIX2FVARBPROC>(get_proc_address("glUniformMatrix2fvARB"));
- glUniformMatrix3fvARB=reinterpret_cast<PFNGLUNIFORMMATRIX3FVARBPROC>(get_proc_address("glUniformMatrix3fvARB"));
- glUniformMatrix4fvARB=reinterpret_cast<PFNGLUNIFORMMATRIX4FVARBPROC>(get_proc_address("glUniformMatrix4fvARB"));
- glGetObjectParameterfvARB=reinterpret_cast<PFNGLGETOBJECTPARAMETERFVARBPROC>(get_proc_address("glGetObjectParameterfvARB"));
- glGetObjectParameterivARB=reinterpret_cast<PFNGLGETOBJECTPARAMETERIVARBPROC>(get_proc_address("glGetObjectParameterivARB"));
- glGetInfoLogARB=reinterpret_cast<PFNGLGETINFOLOGARBPROC>(get_proc_address("glGetInfoLogARB"));
- glGetAttachedObjectsARB=reinterpret_cast<PFNGLGETATTACHEDOBJECTSARBPROC>(get_proc_address("glGetAttachedObjectsARB"));
- glGetUniformLocationARB=reinterpret_cast<PFNGLGETUNIFORMLOCATIONARBPROC>(get_proc_address("glGetUniformLocationARB"));
- glGetActiveUniformARB=reinterpret_cast<PFNGLGETACTIVEUNIFORMARBPROC>(get_proc_address("glGetActiveUniformARB"));
- glGetUniformfvARB=reinterpret_cast<PFNGLGETUNIFORMFVARBPROC>(get_proc_address("glGetUniformfvARB"));
- glGetUniformivARB=reinterpret_cast<PFNGLGETUNIFORMIVARBPROC>(get_proc_address("glGetUniformivARB"));
- glGetShaderSourceARB=reinterpret_cast<PFNGLGETSHADERSOURCEARBPROC>(get_proc_address("glGetShaderSourceARB"));
+ glDeleteObjectARB = reinterpret_cast<PFNGLDELETEOBJECTARBPROC>(get_proc_address("glDeleteObjectARB"));
+ glGetHandleARB = reinterpret_cast<PFNGLGETHANDLEARBPROC>(get_proc_address("glGetHandleARB"));
+ glDetachObjectARB = reinterpret_cast<PFNGLDETACHOBJECTARBPROC>(get_proc_address("glDetachObjectARB"));
+ glCreateShaderObjectARB = reinterpret_cast<PFNGLCREATESHADEROBJECTARBPROC>(get_proc_address("glCreateShaderObjectARB"));
+ glShaderSourceARB = reinterpret_cast<PFNGLSHADERSOURCEARBPROC>(get_proc_address("glShaderSourceARB"));
+ glCompileShaderARB = reinterpret_cast<PFNGLCOMPILESHADERARBPROC>(get_proc_address("glCompileShaderARB"));
+ glCreateProgramObjectARB = reinterpret_cast<PFNGLCREATEPROGRAMOBJECTARBPROC>(get_proc_address("glCreateProgramObjectARB"));
+ glAttachObjectARB = reinterpret_cast<PFNGLATTACHOBJECTARBPROC>(get_proc_address("glAttachObjectARB"));
+ glLinkProgramARB = reinterpret_cast<PFNGLLINKPROGRAMARBPROC>(get_proc_address("glLinkProgramARB"));
+ glUseProgramObjectARB = reinterpret_cast<PFNGLUSEPROGRAMOBJECTARBPROC>(get_proc_address("glUseProgramObjectARB"));
+ glValidateProgramARB = reinterpret_cast<PFNGLVALIDATEPROGRAMARBPROC>(get_proc_address("glValidateProgramARB"));
+ glUniform1fARB = reinterpret_cast<PFNGLUNIFORM1FARBPROC>(get_proc_address("glUniform1fARB"));
+ glUniform2fARB = reinterpret_cast<PFNGLUNIFORM2FARBPROC>(get_proc_address("glUniform2fARB"));
+ glUniform3fARB = reinterpret_cast<PFNGLUNIFORM3FARBPROC>(get_proc_address("glUniform3fARB"));
+ glUniform4fARB = reinterpret_cast<PFNGLUNIFORM4FARBPROC>(get_proc_address("glUniform4fARB"));
+ glUniform1iARB = reinterpret_cast<PFNGLUNIFORM1IARBPROC>(get_proc_address("glUniform1iARB"));
+ glUniform2iARB = reinterpret_cast<PFNGLUNIFORM2IARBPROC>(get_proc_address("glUniform2iARB"));
+ glUniform3iARB = reinterpret_cast<PFNGLUNIFORM3IARBPROC>(get_proc_address("glUniform3iARB"));
+ glUniform4iARB = reinterpret_cast<PFNGLUNIFORM4IARBPROC>(get_proc_address("glUniform4iARB"));
+ glUniform1fvARB = reinterpret_cast<PFNGLUNIFORM1FVARBPROC>(get_proc_address("glUniform1fvARB"));
+ glUniform2fvARB = reinterpret_cast<PFNGLUNIFORM2FVARBPROC>(get_proc_address("glUniform2fvARB"));
+ glUniform3fvARB = reinterpret_cast<PFNGLUNIFORM3FVARBPROC>(get_proc_address("glUniform3fvARB"));
+ glUniform4fvARB = reinterpret_cast<PFNGLUNIFORM4FVARBPROC>(get_proc_address("glUniform4fvARB"));
+ glUniform1ivARB = reinterpret_cast<PFNGLUNIFORM1IVARBPROC>(get_proc_address("glUniform1ivARB"));
+ glUniform2ivARB = reinterpret_cast<PFNGLUNIFORM2IVARBPROC>(get_proc_address("glUniform2ivARB"));
+ glUniform3ivARB = reinterpret_cast<PFNGLUNIFORM3IVARBPROC>(get_proc_address("glUniform3ivARB"));
+ glUniform4ivARB = reinterpret_cast<PFNGLUNIFORM4IVARBPROC>(get_proc_address("glUniform4ivARB"));
+ glUniformMatrix2fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX2FVARBPROC>(get_proc_address("glUniformMatrix2fvARB"));
+ glUniformMatrix3fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX3FVARBPROC>(get_proc_address("glUniformMatrix3fvARB"));
+ glUniformMatrix4fvARB = reinterpret_cast<PFNGLUNIFORMMATRIX4FVARBPROC>(get_proc_address("glUniformMatrix4fvARB"));
+ glGetObjectParameterfvARB = reinterpret_cast<PFNGLGETOBJECTPARAMETERFVARBPROC>(get_proc_address("glGetObjectParameterfvARB"));
+ glGetObjectParameterivARB = reinterpret_cast<PFNGLGETOBJECTPARAMETERIVARBPROC>(get_proc_address("glGetObjectParameterivARB"));
+ glGetInfoLogARB = reinterpret_cast<PFNGLGETINFOLOGARBPROC>(get_proc_address("glGetInfoLogARB"));
+ glGetAttachedObjectsARB = reinterpret_cast<PFNGLGETATTACHEDOBJECTSARBPROC>(get_proc_address("glGetAttachedObjectsARB"));
+ glGetUniformLocationARB = reinterpret_cast<PFNGLGETUNIFORMLOCATIONARBPROC>(get_proc_address("glGetUniformLocationARB"));
+ glGetActiveUniformARB = reinterpret_cast<PFNGLGETACTIVEUNIFORMARBPROC>(get_proc_address("glGetActiveUniformARB"));
+ glGetUniformfvARB = reinterpret_cast<PFNGLGETUNIFORMFVARBPROC>(get_proc_address("glGetUniformfvARB"));
+ glGetUniformivARB = reinterpret_cast<PFNGLGETUNIFORMIVARBPROC>(get_proc_address("glGetUniformivARB"));
+ glGetShaderSourceARB = reinterpret_cast<PFNGLGETSHADERSOURCEARBPROC>(get_proc_address("glGetShaderSourceARB"));
}
} // namespace GL
namespace Msp {
namespace GL {
-PFNGLBINDBUFFERARBPROC glBindBufferARB=0;
-PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB=0;
-PFNGLGENBUFFERSARBPROC glGenBuffersARB=0;
-PFNGLISBUFFERARBPROC glIsBufferARB=0;
-PFNGLBUFFERDATAARBPROC glBufferDataARB=0;
-PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB=0;
-PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB=0;
-PFNGLMAPBUFFERARBPROC glMapBufferARB=0;
-PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB=0;
-PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB=0;
-PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB=0;
+PFNGLBINDBUFFERARBPROC glBindBufferARB = 0;
+PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB = 0;
+PFNGLGENBUFFERSARBPROC glGenBuffersARB = 0;
+PFNGLISBUFFERARBPROC glIsBufferARB = 0;
+PFNGLBUFFERDATAARBPROC glBufferDataARB = 0;
+PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB = 0;
+PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB = 0;
+PFNGLMAPBUFFERARBPROC glMapBufferARB = 0;
+PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB = 0;
+PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB = 0;
+PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB = 0;
void init_arb_vertex_buffer_object()
{
- glBindBufferARB=reinterpret_cast<PFNGLBINDBUFFERARBPROC>(get_proc_address("glBindBufferARB"));
- glDeleteBuffersARB=reinterpret_cast<PFNGLDELETEBUFFERSARBPROC>(get_proc_address("glDeleteBuffersARB"));
- glGenBuffersARB=reinterpret_cast<PFNGLGENBUFFERSARBPROC>(get_proc_address("glGenBuffersARB"));
- glIsBufferARB=reinterpret_cast<PFNGLISBUFFERARBPROC>(get_proc_address("glIsBufferARB"));
- glBufferDataARB=reinterpret_cast<PFNGLBUFFERDATAARBPROC>(get_proc_address("glBufferDataARB"));
- glBufferSubDataARB=reinterpret_cast<PFNGLBUFFERSUBDATAARBPROC>(get_proc_address("glBufferSubDataARB"));
- glGetBufferSubDataARB=reinterpret_cast<PFNGLGETBUFFERSUBDATAARBPROC>(get_proc_address("glGetBufferSubDataARB"));
- glMapBufferARB=reinterpret_cast<PFNGLMAPBUFFERARBPROC>(get_proc_address("glMapBufferARB"));
- glUnmapBufferARB=reinterpret_cast<PFNGLUNMAPBUFFERARBPROC>(get_proc_address("glUnmapBufferARB"));
- glGetBufferParameterivARB=reinterpret_cast<PFNGLGETBUFFERPARAMETERIVARBPROC>(get_proc_address("glGetBufferParameterivARB"));
- glGetBufferPointervARB=reinterpret_cast<PFNGLGETBUFFERPOINTERVARBPROC>(get_proc_address("glGetBufferPointervARB"));
+ glBindBufferARB = reinterpret_cast<PFNGLBINDBUFFERARBPROC>(get_proc_address("glBindBufferARB"));
+ glDeleteBuffersARB = reinterpret_cast<PFNGLDELETEBUFFERSARBPROC>(get_proc_address("glDeleteBuffersARB"));
+ glGenBuffersARB = reinterpret_cast<PFNGLGENBUFFERSARBPROC>(get_proc_address("glGenBuffersARB"));
+ glIsBufferARB = reinterpret_cast<PFNGLISBUFFERARBPROC>(get_proc_address("glIsBufferARB"));
+ glBufferDataARB = reinterpret_cast<PFNGLBUFFERDATAARBPROC>(get_proc_address("glBufferDataARB"));
+ glBufferSubDataARB = reinterpret_cast<PFNGLBUFFERSUBDATAARBPROC>(get_proc_address("glBufferSubDataARB"));
+ glGetBufferSubDataARB = reinterpret_cast<PFNGLGETBUFFERSUBDATAARBPROC>(get_proc_address("glGetBufferSubDataARB"));
+ glMapBufferARB = reinterpret_cast<PFNGLMAPBUFFERARBPROC>(get_proc_address("glMapBufferARB"));
+ glUnmapBufferARB = reinterpret_cast<PFNGLUNMAPBUFFERARBPROC>(get_proc_address("glUnmapBufferARB"));
+ glGetBufferParameterivARB = reinterpret_cast<PFNGLGETBUFFERPARAMETERIVARBPROC>(get_proc_address("glGetBufferParameterivARB"));
+ glGetBufferPointervARB = reinterpret_cast<PFNGLGETBUFFERPOINTERVARBPROC>(get_proc_address("glGetBufferPointervARB"));
}
} // namespace GL
namespace Msp {
namespace GL {
-PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB=0;
-PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB=0;
-PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB=0;
-PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB=0;
-PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB=0;
-PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB=0;
-PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB=0;
-PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB=0;
-PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB=0;
-PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB=0;
-PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB=0;
-PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB=0;
-PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB=0;
-PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB=0;
-PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB=0;
-PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB=0;
-PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB=0;
-PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB=0;
-PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4NbvARB=0;
-PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4NivARB=0;
-PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4NsvARB=0;
-PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4NubARB=0;
-PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4NubvARB=0;
-PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4NuivARB=0;
-PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4NusvARB=0;
-PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB=0;
-PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB=0;
-PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB=0;
-PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB=0;
-PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB=0;
-PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB=0;
-PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB=0;
-PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB=0;
-PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB=0;
-PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB=0;
-PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB=0;
-PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB=0;
-PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB=0;
-PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB=0;
-PFNGLPROGRAMSTRINGARBPROC glProgramStringARB=0;
-PFNGLBINDPROGRAMARBPROC glBindProgramARB=0;
-PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB=0;
-PFNGLGENPROGRAMSARBPROC glGenProgramsARB=0;
-PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB=0;
-PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB=0;
-PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB=0;
-PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB=0;
-PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB=0;
-PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB=0;
-PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB=0;
-PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB=0;
-PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB=0;
-PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB=0;
-PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB=0;
-PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB=0;
-PFNGLGETPROGRAMIVARBPROC glGetProgramivARB=0;
-PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB=0;
-PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB=0;
-PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB=0;
-PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB=0;
-PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB=0;
-PFNGLISPROGRAMARBPROC glIsProgramARB=0;
+PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB = 0;
+PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB = 0;
+PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB = 0;
+PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB = 0;
+PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB = 0;
+PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB = 0;
+PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB = 0;
+PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB = 0;
+PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB = 0;
+PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB = 0;
+PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB = 0;
+PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB = 0;
+PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB = 0;
+PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB = 0;
+PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB = 0;
+PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB = 0;
+PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB = 0;
+PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB = 0;
+PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4NbvARB = 0;
+PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4NivARB = 0;
+PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4NsvARB = 0;
+PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4NubARB = 0;
+PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4NubvARB = 0;
+PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4NuivARB = 0;
+PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4NusvARB = 0;
+PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB = 0;
+PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB = 0;
+PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB = 0;
+PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB = 0;
+PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB = 0;
+PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB = 0;
+PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB = 0;
+PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB = 0;
+PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB = 0;
+PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB = 0;
+PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB = 0;
+PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB = 0;
+PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB = 0;
+PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB = 0;
+PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = 0;
+PFNGLBINDPROGRAMARBPROC glBindProgramARB = 0;
+PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB = 0;
+PFNGLGENPROGRAMSARBPROC glGenProgramsARB = 0;
+PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB = 0;
+PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB = 0;
+PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB = 0;
+PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB = 0;
+PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB = 0;
+PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB = 0;
+PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB = 0;
+PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB = 0;
+PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB = 0;
+PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB = 0;
+PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB = 0;
+PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB = 0;
+PFNGLGETPROGRAMIVARBPROC glGetProgramivARB = 0;
+PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB = 0;
+PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB = 0;
+PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB = 0;
+PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB = 0;
+PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB = 0;
+PFNGLISPROGRAMARBPROC glIsProgramARB = 0;
void init_arb_vertex_program()
{
- glVertexAttrib1dARB=reinterpret_cast<PFNGLVERTEXATTRIB1DARBPROC>(get_proc_address("glVertexAttrib1dARB"));
- glVertexAttrib1dvARB=reinterpret_cast<PFNGLVERTEXATTRIB1DVARBPROC>(get_proc_address("glVertexAttrib1dvARB"));
- glVertexAttrib1fARB=reinterpret_cast<PFNGLVERTEXATTRIB1FARBPROC>(get_proc_address("glVertexAttrib1fARB"));
- glVertexAttrib1fvARB=reinterpret_cast<PFNGLVERTEXATTRIB1FVARBPROC>(get_proc_address("glVertexAttrib1fvARB"));
- glVertexAttrib1sARB=reinterpret_cast<PFNGLVERTEXATTRIB1SARBPROC>(get_proc_address("glVertexAttrib1sARB"));
- glVertexAttrib1svARB=reinterpret_cast<PFNGLVERTEXATTRIB1SVARBPROC>(get_proc_address("glVertexAttrib1svARB"));
- glVertexAttrib2dARB=reinterpret_cast<PFNGLVERTEXATTRIB2DARBPROC>(get_proc_address("glVertexAttrib2dARB"));
- glVertexAttrib2dvARB=reinterpret_cast<PFNGLVERTEXATTRIB2DVARBPROC>(get_proc_address("glVertexAttrib2dvARB"));
- glVertexAttrib2fARB=reinterpret_cast<PFNGLVERTEXATTRIB2FARBPROC>(get_proc_address("glVertexAttrib2fARB"));
- glVertexAttrib2fvARB=reinterpret_cast<PFNGLVERTEXATTRIB2FVARBPROC>(get_proc_address("glVertexAttrib2fvARB"));
- glVertexAttrib2sARB=reinterpret_cast<PFNGLVERTEXATTRIB2SARBPROC>(get_proc_address("glVertexAttrib2sARB"));
- glVertexAttrib2svARB=reinterpret_cast<PFNGLVERTEXATTRIB2SVARBPROC>(get_proc_address("glVertexAttrib2svARB"));
- glVertexAttrib3dARB=reinterpret_cast<PFNGLVERTEXATTRIB3DARBPROC>(get_proc_address("glVertexAttrib3dARB"));
- glVertexAttrib3dvARB=reinterpret_cast<PFNGLVERTEXATTRIB3DVARBPROC>(get_proc_address("glVertexAttrib3dvARB"));
- glVertexAttrib3fARB=reinterpret_cast<PFNGLVERTEXATTRIB3FARBPROC>(get_proc_address("glVertexAttrib3fARB"));
- glVertexAttrib3fvARB=reinterpret_cast<PFNGLVERTEXATTRIB3FVARBPROC>(get_proc_address("glVertexAttrib3fvARB"));
- glVertexAttrib3sARB=reinterpret_cast<PFNGLVERTEXATTRIB3SARBPROC>(get_proc_address("glVertexAttrib3sARB"));
- glVertexAttrib3svARB=reinterpret_cast<PFNGLVERTEXATTRIB3SVARBPROC>(get_proc_address("glVertexAttrib3svARB"));
- glVertexAttrib4NbvARB=reinterpret_cast<PFNGLVERTEXATTRIB4NBVARBPROC>(get_proc_address("glVertexAttrib4NbvARB"));
- glVertexAttrib4NivARB=reinterpret_cast<PFNGLVERTEXATTRIB4NIVARBPROC>(get_proc_address("glVertexAttrib4NivARB"));
- glVertexAttrib4NsvARB=reinterpret_cast<PFNGLVERTEXATTRIB4NSVARBPROC>(get_proc_address("glVertexAttrib4NsvARB"));
- glVertexAttrib4NubARB=reinterpret_cast<PFNGLVERTEXATTRIB4NUBARBPROC>(get_proc_address("glVertexAttrib4NubARB"));
- glVertexAttrib4NubvARB=reinterpret_cast<PFNGLVERTEXATTRIB4NUBVARBPROC>(get_proc_address("glVertexAttrib4NubvARB"));
- glVertexAttrib4NuivARB=reinterpret_cast<PFNGLVERTEXATTRIB4NUIVARBPROC>(get_proc_address("glVertexAttrib4NuivARB"));
- glVertexAttrib4NusvARB=reinterpret_cast<PFNGLVERTEXATTRIB4NUSVARBPROC>(get_proc_address("glVertexAttrib4NusvARB"));
- glVertexAttrib4bvARB=reinterpret_cast<PFNGLVERTEXATTRIB4BVARBPROC>(get_proc_address("glVertexAttrib4bvARB"));
- glVertexAttrib4dARB=reinterpret_cast<PFNGLVERTEXATTRIB4DARBPROC>(get_proc_address("glVertexAttrib4dARB"));
- glVertexAttrib4dvARB=reinterpret_cast<PFNGLVERTEXATTRIB4DVARBPROC>(get_proc_address("glVertexAttrib4dvARB"));
- glVertexAttrib4fARB=reinterpret_cast<PFNGLVERTEXATTRIB4FARBPROC>(get_proc_address("glVertexAttrib4fARB"));
- glVertexAttrib4fvARB=reinterpret_cast<PFNGLVERTEXATTRIB4FVARBPROC>(get_proc_address("glVertexAttrib4fvARB"));
- glVertexAttrib4ivARB=reinterpret_cast<PFNGLVERTEXATTRIB4IVARBPROC>(get_proc_address("glVertexAttrib4ivARB"));
- glVertexAttrib4sARB=reinterpret_cast<PFNGLVERTEXATTRIB4SARBPROC>(get_proc_address("glVertexAttrib4sARB"));
- glVertexAttrib4svARB=reinterpret_cast<PFNGLVERTEXATTRIB4SVARBPROC>(get_proc_address("glVertexAttrib4svARB"));
- glVertexAttrib4ubvARB=reinterpret_cast<PFNGLVERTEXATTRIB4UBVARBPROC>(get_proc_address("glVertexAttrib4ubvARB"));
- glVertexAttrib4uivARB=reinterpret_cast<PFNGLVERTEXATTRIB4UIVARBPROC>(get_proc_address("glVertexAttrib4uivARB"));
- glVertexAttrib4usvARB=reinterpret_cast<PFNGLVERTEXATTRIB4USVARBPROC>(get_proc_address("glVertexAttrib4usvARB"));
- glVertexAttribPointerARB=reinterpret_cast<PFNGLVERTEXATTRIBPOINTERARBPROC>(get_proc_address("glVertexAttribPointerARB"));
- glEnableVertexAttribArrayARB=reinterpret_cast<PFNGLENABLEVERTEXATTRIBARRAYARBPROC>(get_proc_address("glEnableVertexAttribArrayARB"));
- glDisableVertexAttribArrayARB=reinterpret_cast<PFNGLDISABLEVERTEXATTRIBARRAYARBPROC>(get_proc_address("glDisableVertexAttribArrayARB"));
- glProgramStringARB=reinterpret_cast<PFNGLPROGRAMSTRINGARBPROC>(get_proc_address("glProgramStringARB"));
- glBindProgramARB=reinterpret_cast<PFNGLBINDPROGRAMARBPROC>(get_proc_address("glBindProgramARB"));
- glDeleteProgramsARB=reinterpret_cast<PFNGLDELETEPROGRAMSARBPROC>(get_proc_address("glDeleteProgramsARB"));
- glGenProgramsARB=reinterpret_cast<PFNGLGENPROGRAMSARBPROC>(get_proc_address("glGenProgramsARB"));
- glProgramEnvParameter4dARB=reinterpret_cast<PFNGLPROGRAMENVPARAMETER4DARBPROC>(get_proc_address("glProgramEnvParameter4dARB"));
- glProgramEnvParameter4dvARB=reinterpret_cast<PFNGLPROGRAMENVPARAMETER4DVARBPROC>(get_proc_address("glProgramEnvParameter4dvARB"));
- glProgramEnvParameter4fARB=reinterpret_cast<PFNGLPROGRAMENVPARAMETER4FARBPROC>(get_proc_address("glProgramEnvParameter4fARB"));
- glProgramEnvParameter4fvARB=reinterpret_cast<PFNGLPROGRAMENVPARAMETER4FVARBPROC>(get_proc_address("glProgramEnvParameter4fvARB"));
- glProgramLocalParameter4dARB=reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4DARBPROC>(get_proc_address("glProgramLocalParameter4dARB"));
- glProgramLocalParameter4dvARB=reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4DVARBPROC>(get_proc_address("glProgramLocalParameter4dvARB"));
- glProgramLocalParameter4fARB=reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4FARBPROC>(get_proc_address("glProgramLocalParameter4fARB"));
- glProgramLocalParameter4fvARB=reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4FVARBPROC>(get_proc_address("glProgramLocalParameter4fvARB"));
- glGetProgramEnvParameterdvARB=reinterpret_cast<PFNGLGETPROGRAMENVPARAMETERDVARBPROC>(get_proc_address("glGetProgramEnvParameterdvARB"));
- glGetProgramEnvParameterfvARB=reinterpret_cast<PFNGLGETPROGRAMENVPARAMETERFVARBPROC>(get_proc_address("glGetProgramEnvParameterfvARB"));
- glGetProgramLocalParameterdvARB=reinterpret_cast<PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC>(get_proc_address("glGetProgramLocalParameterdvARB"));
- glGetProgramLocalParameterfvARB=reinterpret_cast<PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC>(get_proc_address("glGetProgramLocalParameterfvARB"));
- glGetProgramivARB=reinterpret_cast<PFNGLGETPROGRAMIVARBPROC>(get_proc_address("glGetProgramivARB"));
- glGetProgramStringARB=reinterpret_cast<PFNGLGETPROGRAMSTRINGARBPROC>(get_proc_address("glGetProgramStringARB"));
- glGetVertexAttribdvARB=reinterpret_cast<PFNGLGETVERTEXATTRIBDVARBPROC>(get_proc_address("glGetVertexAttribdvARB"));
- glGetVertexAttribfvARB=reinterpret_cast<PFNGLGETVERTEXATTRIBFVARBPROC>(get_proc_address("glGetVertexAttribfvARB"));
- glGetVertexAttribivARB=reinterpret_cast<PFNGLGETVERTEXATTRIBIVARBPROC>(get_proc_address("glGetVertexAttribivARB"));
- glGetVertexAttribPointervARB=reinterpret_cast<PFNGLGETVERTEXATTRIBPOINTERVARBPROC>(get_proc_address("glGetVertexAttribPointervARB"));
- glIsProgramARB=reinterpret_cast<PFNGLISPROGRAMARBPROC>(get_proc_address("glIsProgramARB"));
+ glVertexAttrib1dARB = reinterpret_cast<PFNGLVERTEXATTRIB1DARBPROC>(get_proc_address("glVertexAttrib1dARB"));
+ glVertexAttrib1dvARB = reinterpret_cast<PFNGLVERTEXATTRIB1DVARBPROC>(get_proc_address("glVertexAttrib1dvARB"));
+ glVertexAttrib1fARB = reinterpret_cast<PFNGLVERTEXATTRIB1FARBPROC>(get_proc_address("glVertexAttrib1fARB"));
+ glVertexAttrib1fvARB = reinterpret_cast<PFNGLVERTEXATTRIB1FVARBPROC>(get_proc_address("glVertexAttrib1fvARB"));
+ glVertexAttrib1sARB = reinterpret_cast<PFNGLVERTEXATTRIB1SARBPROC>(get_proc_address("glVertexAttrib1sARB"));
+ glVertexAttrib1svARB = reinterpret_cast<PFNGLVERTEXATTRIB1SVARBPROC>(get_proc_address("glVertexAttrib1svARB"));
+ glVertexAttrib2dARB = reinterpret_cast<PFNGLVERTEXATTRIB2DARBPROC>(get_proc_address("glVertexAttrib2dARB"));
+ glVertexAttrib2dvARB = reinterpret_cast<PFNGLVERTEXATTRIB2DVARBPROC>(get_proc_address("glVertexAttrib2dvARB"));
+ glVertexAttrib2fARB = reinterpret_cast<PFNGLVERTEXATTRIB2FARBPROC>(get_proc_address("glVertexAttrib2fARB"));
+ glVertexAttrib2fvARB = reinterpret_cast<PFNGLVERTEXATTRIB2FVARBPROC>(get_proc_address("glVertexAttrib2fvARB"));
+ glVertexAttrib2sARB = reinterpret_cast<PFNGLVERTEXATTRIB2SARBPROC>(get_proc_address("glVertexAttrib2sARB"));
+ glVertexAttrib2svARB = reinterpret_cast<PFNGLVERTEXATTRIB2SVARBPROC>(get_proc_address("glVertexAttrib2svARB"));
+ glVertexAttrib3dARB = reinterpret_cast<PFNGLVERTEXATTRIB3DARBPROC>(get_proc_address("glVertexAttrib3dARB"));
+ glVertexAttrib3dvARB = reinterpret_cast<PFNGLVERTEXATTRIB3DVARBPROC>(get_proc_address("glVertexAttrib3dvARB"));
+ glVertexAttrib3fARB = reinterpret_cast<PFNGLVERTEXATTRIB3FARBPROC>(get_proc_address("glVertexAttrib3fARB"));
+ glVertexAttrib3fvARB = reinterpret_cast<PFNGLVERTEXATTRIB3FVARBPROC>(get_proc_address("glVertexAttrib3fvARB"));
+ glVertexAttrib3sARB = reinterpret_cast<PFNGLVERTEXATTRIB3SARBPROC>(get_proc_address("glVertexAttrib3sARB"));
+ glVertexAttrib3svARB = reinterpret_cast<PFNGLVERTEXATTRIB3SVARBPROC>(get_proc_address("glVertexAttrib3svARB"));
+ glVertexAttrib4NbvARB = reinterpret_cast<PFNGLVERTEXATTRIB4NBVARBPROC>(get_proc_address("glVertexAttrib4NbvARB"));
+ glVertexAttrib4NivARB = reinterpret_cast<PFNGLVERTEXATTRIB4NIVARBPROC>(get_proc_address("glVertexAttrib4NivARB"));
+ glVertexAttrib4NsvARB = reinterpret_cast<PFNGLVERTEXATTRIB4NSVARBPROC>(get_proc_address("glVertexAttrib4NsvARB"));
+ glVertexAttrib4NubARB = reinterpret_cast<PFNGLVERTEXATTRIB4NUBARBPROC>(get_proc_address("glVertexAttrib4NubARB"));
+ glVertexAttrib4NubvARB = reinterpret_cast<PFNGLVERTEXATTRIB4NUBVARBPROC>(get_proc_address("glVertexAttrib4NubvARB"));
+ glVertexAttrib4NuivARB = reinterpret_cast<PFNGLVERTEXATTRIB4NUIVARBPROC>(get_proc_address("glVertexAttrib4NuivARB"));
+ glVertexAttrib4NusvARB = reinterpret_cast<PFNGLVERTEXATTRIB4NUSVARBPROC>(get_proc_address("glVertexAttrib4NusvARB"));
+ glVertexAttrib4bvARB = reinterpret_cast<PFNGLVERTEXATTRIB4BVARBPROC>(get_proc_address("glVertexAttrib4bvARB"));
+ glVertexAttrib4dARB = reinterpret_cast<PFNGLVERTEXATTRIB4DARBPROC>(get_proc_address("glVertexAttrib4dARB"));
+ glVertexAttrib4dvARB = reinterpret_cast<PFNGLVERTEXATTRIB4DVARBPROC>(get_proc_address("glVertexAttrib4dvARB"));
+ glVertexAttrib4fARB = reinterpret_cast<PFNGLVERTEXATTRIB4FARBPROC>(get_proc_address("glVertexAttrib4fARB"));
+ glVertexAttrib4fvARB = reinterpret_cast<PFNGLVERTEXATTRIB4FVARBPROC>(get_proc_address("glVertexAttrib4fvARB"));
+ glVertexAttrib4ivARB = reinterpret_cast<PFNGLVERTEXATTRIB4IVARBPROC>(get_proc_address("glVertexAttrib4ivARB"));
+ glVertexAttrib4sARB = reinterpret_cast<PFNGLVERTEXATTRIB4SARBPROC>(get_proc_address("glVertexAttrib4sARB"));
+ glVertexAttrib4svARB = reinterpret_cast<PFNGLVERTEXATTRIB4SVARBPROC>(get_proc_address("glVertexAttrib4svARB"));
+ glVertexAttrib4ubvARB = reinterpret_cast<PFNGLVERTEXATTRIB4UBVARBPROC>(get_proc_address("glVertexAttrib4ubvARB"));
+ glVertexAttrib4uivARB = reinterpret_cast<PFNGLVERTEXATTRIB4UIVARBPROC>(get_proc_address("glVertexAttrib4uivARB"));
+ glVertexAttrib4usvARB = reinterpret_cast<PFNGLVERTEXATTRIB4USVARBPROC>(get_proc_address("glVertexAttrib4usvARB"));
+ glVertexAttribPointerARB = reinterpret_cast<PFNGLVERTEXATTRIBPOINTERARBPROC>(get_proc_address("glVertexAttribPointerARB"));
+ glEnableVertexAttribArrayARB = reinterpret_cast<PFNGLENABLEVERTEXATTRIBARRAYARBPROC>(get_proc_address("glEnableVertexAttribArrayARB"));
+ glDisableVertexAttribArrayARB = reinterpret_cast<PFNGLDISABLEVERTEXATTRIBARRAYARBPROC>(get_proc_address("glDisableVertexAttribArrayARB"));
+ glProgramStringARB = reinterpret_cast<PFNGLPROGRAMSTRINGARBPROC>(get_proc_address("glProgramStringARB"));
+ glBindProgramARB = reinterpret_cast<PFNGLBINDPROGRAMARBPROC>(get_proc_address("glBindProgramARB"));
+ glDeleteProgramsARB = reinterpret_cast<PFNGLDELETEPROGRAMSARBPROC>(get_proc_address("glDeleteProgramsARB"));
+ glGenProgramsARB = reinterpret_cast<PFNGLGENPROGRAMSARBPROC>(get_proc_address("glGenProgramsARB"));
+ glProgramEnvParameter4dARB = reinterpret_cast<PFNGLPROGRAMENVPARAMETER4DARBPROC>(get_proc_address("glProgramEnvParameter4dARB"));
+ glProgramEnvParameter4dvARB = reinterpret_cast<PFNGLPROGRAMENVPARAMETER4DVARBPROC>(get_proc_address("glProgramEnvParameter4dvARB"));
+ glProgramEnvParameter4fARB = reinterpret_cast<PFNGLPROGRAMENVPARAMETER4FARBPROC>(get_proc_address("glProgramEnvParameter4fARB"));
+ glProgramEnvParameter4fvARB = reinterpret_cast<PFNGLPROGRAMENVPARAMETER4FVARBPROC>(get_proc_address("glProgramEnvParameter4fvARB"));
+ glProgramLocalParameter4dARB = reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4DARBPROC>(get_proc_address("glProgramLocalParameter4dARB"));
+ glProgramLocalParameter4dvARB = reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4DVARBPROC>(get_proc_address("glProgramLocalParameter4dvARB"));
+ glProgramLocalParameter4fARB = reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4FARBPROC>(get_proc_address("glProgramLocalParameter4fARB"));
+ glProgramLocalParameter4fvARB = reinterpret_cast<PFNGLPROGRAMLOCALPARAMETER4FVARBPROC>(get_proc_address("glProgramLocalParameter4fvARB"));
+ glGetProgramEnvParameterdvARB = reinterpret_cast<PFNGLGETPROGRAMENVPARAMETERDVARBPROC>(get_proc_address("glGetProgramEnvParameterdvARB"));
+ glGetProgramEnvParameterfvARB = reinterpret_cast<PFNGLGETPROGRAMENVPARAMETERFVARBPROC>(get_proc_address("glGetProgramEnvParameterfvARB"));
+ glGetProgramLocalParameterdvARB = reinterpret_cast<PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC>(get_proc_address("glGetProgramLocalParameterdvARB"));
+ glGetProgramLocalParameterfvARB = reinterpret_cast<PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC>(get_proc_address("glGetProgramLocalParameterfvARB"));
+ glGetProgramivARB = reinterpret_cast<PFNGLGETPROGRAMIVARBPROC>(get_proc_address("glGetProgramivARB"));
+ glGetProgramStringARB = reinterpret_cast<PFNGLGETPROGRAMSTRINGARBPROC>(get_proc_address("glGetProgramStringARB"));
+ glGetVertexAttribdvARB = reinterpret_cast<PFNGLGETVERTEXATTRIBDVARBPROC>(get_proc_address("glGetVertexAttribdvARB"));
+ glGetVertexAttribfvARB = reinterpret_cast<PFNGLGETVERTEXATTRIBFVARBPROC>(get_proc_address("glGetVertexAttribfvARB"));
+ glGetVertexAttribivARB = reinterpret_cast<PFNGLGETVERTEXATTRIBIVARBPROC>(get_proc_address("glGetVertexAttribivARB"));
+ glGetVertexAttribPointervARB = reinterpret_cast<PFNGLGETVERTEXATTRIBPOINTERVARBPROC>(get_proc_address("glGetVertexAttribPointervARB"));
+ glIsProgramARB = reinterpret_cast<PFNGLISPROGRAMARBPROC>(get_proc_address("glIsProgramARB"));
}
} // namespace GL
namespace Msp {
namespace GL {
-PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB=0;
-PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB=0;
-PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB=0;
+PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB = 0;
+PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB = 0;
+PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB = 0;
void init_arb_vertex_shader()
{
- glBindAttribLocationARB=reinterpret_cast<PFNGLBINDATTRIBLOCATIONARBPROC>(get_proc_address("glBindAttribLocationARB"));
- glGetActiveAttribARB=reinterpret_cast<PFNGLGETACTIVEATTRIBARBPROC>(get_proc_address("glGetActiveAttribARB"));
- glGetAttribLocationARB=reinterpret_cast<PFNGLGETATTRIBLOCATIONARBPROC>(get_proc_address("glGetAttribLocationARB"));
+ glBindAttribLocationARB = reinterpret_cast<PFNGLBINDATTRIBLOCATIONARBPROC>(get_proc_address("glBindAttribLocationARB"));
+ glGetActiveAttribARB = reinterpret_cast<PFNGLGETACTIVEATTRIBARBPROC>(get_proc_address("glGetActiveAttribARB"));
+ glGetAttribLocationARB = reinterpret_cast<PFNGLGETATTRIBLOCATIONARBPROC>(get_proc_address("glGetAttribLocationARB"));
}
} // namespace GL
Batch &Batch::append(unsigned i)
{
if(indices.empty())
- min_index=max_index=i;
+ min_index = max_index = i;
else
{
- min_index=min(min_index, i);
- max_index=max(max_index, i);
+ min_index = min(min_index, i);
+ max_index = max(max_index, i);
}
indices.push_back(i);
if(obj==cur_obj)
return false;
- cur_obj=obj;
+ cur_obj = obj;
return true;
}
"varying vec2 texcoord;\n"
"void main()\n"
"{\n"
- " gl_Position=vec4(gl_Vertex.xy*2.0-1.0, 0.0, 1.0);\n"
- " texcoord=gl_Vertex.xy;\n"
+ " gl_Position = vec4(gl_Vertex.xy*2.0-1.0, 0.0, 1.0);\n"
+ " texcoord = gl_Vertex.xy;\n"
"}";
static const char blur_fs[]=
"varying vec2 texcoord;\n"
"void main()\n"
"{\n"
- " gl_FragColor=vec4(0.0, 0.0, 0.0, 0.0);\n"
+ " gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
" for(int i=-size; i<=size; ++i)\n"
- " gl_FragColor+=texture2D(source, texcoord+delta*i)*factors[i+size];\n"
+ " gl_FragColor += texture2D(source, texcoord+delta*i)*factors[i+size];\n"
"}";
static const char combine_vs[]=
"varying vec2 texcoord;\n"
"void main()\n"
"{\n"
- " gl_Position=vec4(gl_Vertex.xy*2.0-1.0, 0.0, 1.0);\n"
- " texcoord=gl_Vertex.xy;\n"
+ " gl_Position = vec4(gl_Vertex.xy*2.0-1.0, 0.0, 1.0);\n"
+ " texcoord = gl_Vertex.xy;\n"
"}";
static const char combine_fs[]=
"varying vec2 texcoord;\n"
"void main()\n"
"{\n"
- " gl_FragColor=mix(texture2D(source, texcoord), texture2D(blurred, texcoord), strength);\n"
+ " gl_FragColor = mix(texture2D(source, texcoord), texture2D(blurred, texcoord), strength);\n"
"}";
}
combine_shader(combine_vs, combine_fs),
quad(VERTEX2)
{
- int loc=blur_shader.get_uniform_location("delta");
+ int loc = blur_shader.get_uniform_location("delta");
blur_shdata[0].uniform(loc, 1.0f/w, 0.0f);
blur_shdata[1].uniform(loc, 0.0f, 1.0f/h);
- loc=blur_shader.get_uniform_location("source");
+ loc = blur_shader.get_uniform_location("source");
for(unsigned i=0; i<2; ++i)
{
blur_shdata[i].uniform(loc, 0);
if(r<=0.0f)
throw InvalidParameterValue("Radius must be positive");
- int size=min(static_cast<int>(r*3.0f), 9);
- int loc=blur_shader.get_uniform_location("size");
+ int size = min(static_cast<int>(r*3.0f), 9);
+ int loc = blur_shader.get_uniform_location("size");
blur_shdata[0].uniform(loc, size);
blur_shdata[1].uniform(loc, size);
vector<float> factors(size*2+1);
- float sum=0.0f;
- r=2*r*r;
+ float sum = 0.0f;
+ r = 2*r*r;
for(int i=-size; i<=size; ++i)
- sum+=(factors[size+i]=exp(-i*i/r));
+ sum += (factors[size+i] = exp(-i*i/r));
for(int i=0; i<=size*2; ++i)
{
- loc=blur_shader.get_uniform_location(format("factors[%d]", i));
- float f=factors[i]/sum;
+ loc = blur_shader.get_uniform_location(format("factors[%d]", i));
+ float f = factors[i]/sum;
blur_shdata[0].uniform(loc, f);
blur_shdata[1].uniform(loc, f);
}
void Bloom::render(const Texture2D &src)
{
- const Framebuffer *dest=Framebuffer::current();
+ const Framebuffer *dest = Framebuffer::current();
blur_shader.bind();
fbo.bind();
src.bind_to(0);
void Buffer::bind(BufferType t) const
{
glBindBufferARB(t, id);
- binding(t)=this;
+ binding(t) = this;
}
void Buffer::maybe_bind() const
void Buffer::set_usage(BufferUsage u)
{
- usage=u;
+ usage = u;
}
void Buffer::data(unsigned size, const void *d)
void Buffer::unbind(BufferType type)
{
- const Buffer *&ptr=binding(type);
+ const Buffer *&ptr = binding(type);
if(ptr)
{
glBindBufferARB(type, 0);
- ptr=0;
+ ptr = 0;
}
}
}
}
-const Buffer *Buffer::bound[4]={ 0, 0, 0, 0 };
+const Buffer *Buffer::bound[4] = { 0, 0, 0, 0 };
} // namespace GL
} // namespace Msp
ClipPlane::ClipPlane(double a, double b, double c, double d)
{
- eq[0]=a;
- eq[1]=b;
- eq[2]=c;
- eq[3]=d;
+ eq[0] = a;
+ eq[1] = b;
+ eq[2] = c;
+ eq[3] = d;
}
void ClipPlane::apply_to(unsigned n)
namespace Msp {
namespace GL {
-PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT=0;
-PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT=0;
-PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT=0;
-PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT=0;
-PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT=0;
-PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT=0;
-PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT=0;
-PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT=0;
-PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT=0;
-PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT=0;
-PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT=0;
-PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT=0;
-PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT=0;
-PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT=0;
-PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT=0;
-PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT=0;
-PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT=0;
+PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT = 0;
+PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT = 0;
+PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT = 0;
+PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT = 0;
+PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT = 0;
+PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT = 0;
+PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT = 0;
+PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT = 0;
+PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT = 0;
+PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT = 0;
+PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT = 0;
+PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT = 0;
+PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT = 0;
+PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT = 0;
+PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT = 0;
+PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT = 0;
+PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT = 0;
void init_ext_framebuffer_object()
{
- glIsRenderbufferEXT=reinterpret_cast<PFNGLISRENDERBUFFEREXTPROC>(get_proc_address("glIsRenderbufferEXT"));
- glBindRenderbufferEXT=reinterpret_cast<PFNGLBINDRENDERBUFFEREXTPROC>(get_proc_address("glBindRenderbufferEXT"));
- glDeleteRenderbuffersEXT=reinterpret_cast<PFNGLDELETERENDERBUFFERSEXTPROC>(get_proc_address("glDeleteRenderbuffersEXT"));
- glGenRenderbuffersEXT=reinterpret_cast<PFNGLGENRENDERBUFFERSEXTPROC>(get_proc_address("glGenRenderbuffersEXT"));
- glRenderbufferStorageEXT=reinterpret_cast<PFNGLRENDERBUFFERSTORAGEEXTPROC>(get_proc_address("glRenderbufferStorageEXT"));
- glGetRenderbufferParameterivEXT=reinterpret_cast<PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC>(get_proc_address("glGetRenderbufferParameterivEXT"));
- glIsFramebufferEXT=reinterpret_cast<PFNGLISFRAMEBUFFEREXTPROC>(get_proc_address("glIsFramebufferEXT"));
- glBindFramebufferEXT=reinterpret_cast<PFNGLBINDFRAMEBUFFEREXTPROC>(get_proc_address("glBindFramebufferEXT"));
- glDeleteFramebuffersEXT=reinterpret_cast<PFNGLDELETEFRAMEBUFFERSEXTPROC>(get_proc_address("glDeleteFramebuffersEXT"));
- glGenFramebuffersEXT=reinterpret_cast<PFNGLGENFRAMEBUFFERSEXTPROC>(get_proc_address("glGenFramebuffersEXT"));
- glCheckFramebufferStatusEXT=reinterpret_cast<PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC>(get_proc_address("glCheckFramebufferStatusEXT"));
- glFramebufferTexture1DEXT=reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE1DEXTPROC>(get_proc_address("glFramebufferTexture1DEXT"));
- glFramebufferTexture2DEXT=reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE2DEXTPROC>(get_proc_address("glFramebufferTexture2DEXT"));
- glFramebufferTexture3DEXT=reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE3DEXTPROC>(get_proc_address("glFramebufferTexture3DEXT"));
- glFramebufferRenderbufferEXT=reinterpret_cast<PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC>(get_proc_address("glFramebufferRenderbufferEXT"));
- glGetFramebufferAttachmentParameterivEXT=reinterpret_cast<PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC>(get_proc_address("glGetFramebufferAttachmentParameterivEXT"));
- glGenerateMipmapEXT=reinterpret_cast<PFNGLGENERATEMIPMAPEXTPROC>(get_proc_address("glGenerateMipmapEXT"));
+ glIsRenderbufferEXT = reinterpret_cast<PFNGLISRENDERBUFFEREXTPROC>(get_proc_address("glIsRenderbufferEXT"));
+ glBindRenderbufferEXT = reinterpret_cast<PFNGLBINDRENDERBUFFEREXTPROC>(get_proc_address("glBindRenderbufferEXT"));
+ glDeleteRenderbuffersEXT = reinterpret_cast<PFNGLDELETERENDERBUFFERSEXTPROC>(get_proc_address("glDeleteRenderbuffersEXT"));
+ glGenRenderbuffersEXT = reinterpret_cast<PFNGLGENRENDERBUFFERSEXTPROC>(get_proc_address("glGenRenderbuffersEXT"));
+ glRenderbufferStorageEXT = reinterpret_cast<PFNGLRENDERBUFFERSTORAGEEXTPROC>(get_proc_address("glRenderbufferStorageEXT"));
+ glGetRenderbufferParameterivEXT = reinterpret_cast<PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC>(get_proc_address("glGetRenderbufferParameterivEXT"));
+ glIsFramebufferEXT = reinterpret_cast<PFNGLISFRAMEBUFFEREXTPROC>(get_proc_address("glIsFramebufferEXT"));
+ glBindFramebufferEXT = reinterpret_cast<PFNGLBINDFRAMEBUFFEREXTPROC>(get_proc_address("glBindFramebufferEXT"));
+ glDeleteFramebuffersEXT = reinterpret_cast<PFNGLDELETEFRAMEBUFFERSEXTPROC>(get_proc_address("glDeleteFramebuffersEXT"));
+ glGenFramebuffersEXT = reinterpret_cast<PFNGLGENFRAMEBUFFERSEXTPROC>(get_proc_address("glGenFramebuffersEXT"));
+ glCheckFramebufferStatusEXT = reinterpret_cast<PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC>(get_proc_address("glCheckFramebufferStatusEXT"));
+ glFramebufferTexture1DEXT = reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE1DEXTPROC>(get_proc_address("glFramebufferTexture1DEXT"));
+ glFramebufferTexture2DEXT = reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE2DEXTPROC>(get_proc_address("glFramebufferTexture2DEXT"));
+ glFramebufferTexture3DEXT = reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE3DEXTPROC>(get_proc_address("glFramebufferTexture3DEXT"));
+ glFramebufferRenderbufferEXT = reinterpret_cast<PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC>(get_proc_address("glFramebufferRenderbufferEXT"));
+ glGetFramebufferAttachmentParameterivEXT = reinterpret_cast<PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC>(get_proc_address("glGetFramebufferAttachmentParameterivEXT"));
+ glGenerateMipmapEXT = reinterpret_cast<PFNGLGENERATEMIPMAPEXTPROC>(get_proc_address("glGenerateMipmapEXT"));
}
} // namespace GL
bool is_supported(const string &ext)
{
static set<string> extensions;
- static bool init_done=false;
+ static bool init_done = false;
if(!init_done)
{
- if(const char *gl_ext=reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)))
+ if(const char *gl_ext = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)))
{
- vector<string> exts=split(gl_ext);
+ vector<string> exts = split(gl_ext);
extensions.insert(exts.begin(), exts.end());
}
if(extensions.count("GL_ARB_vertex_buffer_object"))
init_arb_vertex_buffer_object();
- init_done=true;
+ init_done = true;
}
return extensions.count(ext);
const Version &get_gl_version()
{
static Version version;
- static bool init_done=false;
+ static bool init_done = false;
if(!init_done)
{
- string gl_ver=reinterpret_cast<const char *>(glGetString(GL_VERSION));
- vector<string> parts=split(gl_ver.substr(0, gl_ver.find(' ')), '.');
- version.major=lexical_cast<unsigned>(parts[0]);
- version.minor=lexical_cast<unsigned>(parts[1]);
+ string gl_ver = reinterpret_cast<const char *>(glGetString(GL_VERSION));
+ vector<string> parts = split(gl_ver.substr(0, gl_ver.find(' ')), '.');
+ version.major = lexical_cast<unsigned>(parts[0]);
+ version.minor = lexical_cast<unsigned>(parts[1]);
- unsigned combined=version.major*0x100+version.minor;
+ unsigned combined = version.major*0x100+version.minor;
if(combined>=0x102)
init_version_1_2();
if(combined>=0x103)
void require_version(unsigned a, unsigned b)
{
- const Version &ver=get_gl_version();
+ const Version &ver = get_gl_version();
if(ver.major<a || (ver.major==a && ver.minor<b))
throw UnsupportedExtension(format("OpenGL %d.%d", a, b));
}
if(own_tex)
delete tex;
- tex=&t;
- own_tex=false;
+ tex = &t;
+ own_tex = false;
}
const Texture2D &Font::get_texture() const
void Font::add_glyph(unsigned code, float x1, float y1, float x2, float y2, float w, float h, float ox, float oy, float adv)
{
Glyph glyph;
- glyph.code=code;
- glyph.x1=x1;
- glyph.y1=y1;
- glyph.x2=x2;
- glyph.y2=y2;
- glyph.w=w;
- glyph.h=h;
- glyph.off_x=ox;
- glyph.off_y=oy;
- glyph.advance=adv;
+ glyph.code = code;
+ glyph.x1 = x1;
+ glyph.y1 = y1;
+ glyph.x2 = x2;
+ glyph.y2 = y2;
+ glyph.w = w;
+ glyph.h = h;
+ glyph.off_x = ox;
+ glyph.off_y = oy;
+ glyph.advance = adv;
glyphs.insert(GlyphMap::value_type(code, glyph));
}
float Font::get_string_width(const string &str, Codecs::Decoder &dec) const
{
- float x=0;
+ float x = 0;
for(string::const_iterator i=str.begin(); i!=str.end();)
- x+=get_glyph_advance(dec.decode_char(str, i));
+ x += get_glyph_advance(dec.decode_char(str, i));
return x;
}
tex->bind();
- float x=0;
- unsigned count=0;
+ float x = 0;
+ unsigned count = 0;
pbuilder.begin(QUADS);
for(string::const_iterator i=str.begin(); i!=str.end();)
{
- GlyphMap::const_iterator j=glyphs.find(dec.decode_char(str, i));
+ GlyphMap::const_iterator j = glyphs.find(dec.decode_char(str, i));
if(j==glyphs.end())
continue;
create_glyph_vertices(j->second, pbuilder, x);
- x+=j->second.advance;
- count+=4;
+ x += j->second.advance;
+ count += 4;
}
pbuilder.end();
}
float Font::get_glyph_advance(unsigned code) const
{
- GlyphMap::const_iterator i=glyphs.find(code);
+ GlyphMap::const_iterator i = glyphs.find(code);
if(i==glyphs.end())
return 0;
void Font::Loader::glyph(unsigned c)
{
Glyph gl;
- gl.code=c;
+ gl.code = c;
load_sub(gl);
obj.glyphs.insert(GlyphMap::value_type(c, gl));
}
void Font::Loader::texture_inline()
{
- RefPtr<Texture2D> tex=new Texture2D;
+ RefPtr<Texture2D> tex = new Texture2D;
load_sub(*tex);
- obj.tex=tex.release();
- obj.own_tex=true;
+ obj.tex = tex.release();
+ obj.own_tex = true;
}
void Font::Glyph::Loader::texcoords(float x1, float y1, float x2, float y2)
{
- obj.x1=x1;
- obj.y1=y1;
- obj.x2=x2;
- obj.y2=y2;
+ obj.x1 = x1;
+ obj.y1 = y1;
+ obj.x2 = x2;
+ obj.y2 = y2;
}
} // namespace GL
if(!cur_fbo)
get(GL_VIEWPORT, sys_viewport);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id);
- cur_fbo=this;
+ cur_fbo = this;
if(width && height)
viewport(0, 0, width, height);
}
{
maybe_bind();
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, attch, GL_RENDERBUFFER_EXT, rbuf.get_id());
- get_or_create_attachment(attch)=rbuf;
+ get_or_create_attachment(attch) = rbuf;
check_size();
}
{
maybe_bind();
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attch, tex.get_target(), tex.get_id(), level);
- get_or_create_attachment(attch)=tex;
+ get_or_create_attachment(attch) = tex;
check_size();
}
if(cur_fbo)
{
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- cur_fbo=0;
+ cur_fbo = 0;
viewport(sys_viewport[0], sys_viewport[1], sys_viewport[2], sys_viewport[3]);
}
}
{
if(!attachments.empty())
{
- const Attachment &attch=attachments.front();
+ const Attachment &attch = attachments.front();
if(attch.type==GL_RENDERBUFFER_EXT)
{
- width=attch.rbuf->get_width();
- height=attch.rbuf->get_height();
+ width = attch.rbuf->get_width();
+ height = attch.rbuf->get_height();
}
else if(attch.type==GL_TEXTURE_2D)
{
- Texture2D *tex=static_cast<Texture2D *>(attch.tex);
- width=tex->get_width();
- height=tex->get_height();
+ Texture2D *tex = static_cast<Texture2D *>(attch.tex);
+ width = tex->get_width();
+ height = tex->get_height();
}
if(cur_fbo==this)
viewport(0, 0, width, height);
}
}
-const Framebuffer *Framebuffer::cur_fbo=0;
-int Framebuffer::sys_viewport[4]={ 0, 0, 1, 1 };
+const Framebuffer *Framebuffer::cur_fbo = 0;
+int Framebuffer::sys_viewport[4] = { 0, 0, 1, 1 };
Framebuffer::Attachment::Attachment(FramebufferAttachment a):
Framebuffer::Attachment &Framebuffer::Attachment::operator=(Renderbuffer &r)
{
- type=GL_RENDERBUFFER_EXT;
- rbuf=&r;
+ type = GL_RENDERBUFFER_EXT;
+ rbuf = &r;
return *this;
}
Framebuffer::Attachment &Framebuffer::Attachment::operator=(Texture &t)
{
- type=t.get_target();
- tex=&t;
+ type = t.get_target();
+ tex = &t;
return *this;
}
spot_exp(0),
spot_cutoff(180)
{
- attenuation[0]=1;
- attenuation[1]=0;
- attenuation[2]=0;
+ attenuation[0] = 1;
+ attenuation[1] = 0;
+ attenuation[2] = 0;
}
void Light::set_ambient(const Color &c)
{
- ambient=c;
+ ambient = c;
}
void Light::set_diffuse(const Color &c)
{
- diffuse=c;
+ diffuse = c;
}
void Light::set_specular(const Color &c)
{
- specular=c;
+ specular = c;
}
void Light::set_position(const Vector4 &p)
{
- position=p;
+ position = p;
}
void Light::set_spot_direction(const Vector3 &d)
{
- spot_dir=d;
+ spot_dir = d;
}
void Light::set_spot_exponent(float e)
{
- spot_exp=e;
+ spot_exp = e;
}
void Light::set_spot_cutoff(float c)
{
- spot_cutoff=c;
+ spot_cutoff = c;
}
void Light::set_attenuation(float c, float l, float q)
{
- attenuation[0]=c;
- attenuation[1]=l;
- attenuation[2]=q;
+ attenuation[0] = c;
+ attenuation[1] = l;
+ attenuation[2] = q;
}
void Light::bind() const
{
if(current_lights[current_unit]!=this)
{
- GLenum l=GL_LIGHT0+current_unit;
+ GLenum l = GL_LIGHT0+current_unit;
enable(l);
glLightfv(l, GL_AMBIENT, &ambient.r);
glLightfv(l, GL_DIFFUSE, &diffuse.r);
glLightf(l, GL_CONSTANT_ATTENUATION, attenuation[0]);
glLightf(l, GL_LINEAR_ATTENUATION, attenuation[1]);
glLightf(l, GL_QUADRATIC_ATTENUATION, attenuation[2]);
- current_lights[current_unit]=this;
+ current_lights[current_unit] = this;
}
}
void Light::activate(unsigned i)
{
- static unsigned max_lights=get_i(GL_MAX_LIGHTS);
+ static unsigned max_lights = get_i(GL_MAX_LIGHTS);
if(i>=max_lights)
throw InvalidParameterValue("Light unit index out of range");
if(i>=current_lights.size())
current_lights.resize(i+1);
- current_unit=i;
+ current_unit = i;
}
void Light::unbind()
if(current_lights[current_unit])
{
disable(GL_LIGHT0+current_unit);
- current_lights[current_unit]=0;
+ current_lights[current_unit] = 0;
}
}
-unsigned Light::current_unit=0;
+unsigned Light::current_unit = 0;
vector<const Light *> Light::current_lights(1);
} // namespace GL
void Lighting::set_ambient(const Color &a)
{
- ambient=a;
+ ambient = a;
}
void Lighting::attach(unsigned i, const Light &l)
if(i>=lights.size())
lights.resize(i+1);
- lights[i]=&l;
+ lights[i] = &l;
}
void Lighting::detach(unsigned i)
if(i>=lights.size())
return;
- lights[i]=0;
+ lights[i] = 0;
}
void Lighting::bind() const
for(unsigned i=0; i<lights.size(); ++i)
if(lights[i])
lights[i]->bind_to(i);
- current=this;
+ current = this;
}
}
Light::unbind();
}
disable(LIGHTING);
- current=0;
+ current = 0;
}
}
-const Lighting *Lighting::current=0;
+const Lighting *Lighting::current = 0;
} // namespace GL
} // namespace Msp
void Material::set_ambient(const Color &a)
{
- ambient=a;
+ ambient = a;
}
void Material::set_diffuse(const Color &d)
{
- diffuse=d;
+ diffuse = d;
}
void Material::set_specular(const Color &s)
{
- specular=s;
+ specular = s;
}
void Material::set_emission(const Color &e)
{
- emission=e;
+ emission = e;
}
void Material::set_shininess(float s)
{
- shininess=s;
+ shininess = s;
}
void Material::bind() const
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &specular.r);
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, &emission.r);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
- current=this;
+ current = this;
}
}
void Material::unbind()
{
- current=0;
+ current = 0;
}
-const Material *Material::current=0;
+const Material *Material::current = 0;
Material::Loader::Loader(Material &m):
void Material::Loader::ambient(float r, float g, float b, float a)
{
- obj.ambient=GL::Color(r, g, b, a);
+ obj.ambient = GL::Color(r, g, b, a);
}
void Material::Loader::diffuse(float r, float g, float b, float a)
{
- obj.diffuse=GL::Color(r, g, b, a);
+ obj.diffuse = GL::Color(r, g, b, a);
}
void Material::Loader::specular(float r, float g, float b, float a)
{
- obj.specular=GL::Color(r, g, b, a);
+ obj.specular = GL::Color(r, g, b, a);
}
void Material::Loader::emission(float r, float g, float b, float a)
{
- obj.emission=GL::Color(r, g, b, a);
+ obj.emission = GL::Color(r, g, b, a);
}
} // namespace GL
enum MatrixMode
{
- MODELVIEW=GL_MODELVIEW,
- PROJECTION=GL_PROJECTION,
- TEXTURE=GL_TEXTURE
+ MODELVIEW = GL_MODELVIEW,
+ PROJECTION = GL_PROJECTION,
+ TEXTURE = GL_TEXTURE
};
void matrix_mode(MatrixMode);
{
vertices.use_vertex_buffer();
if(!ibuf)
- ibuf=new Buffer(ELEMENT_ARRAY_BUFFER);
+ ibuf = new Buffer(ELEMENT_ARRAY_BUFFER);
update_index_buffer();
}
else
{
vertices.use_vertex_buffer(0);
delete ibuf;
- ibuf=0;
+ ibuf = 0;
}
}
if(ibuf)
{
ibuf->bind();
- unsigned offset=0;
+ unsigned offset = 0;
for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
{
i->draw_with_buffer(offset);
- offset+=i->size();
+ offset += i->size();
}
ibuf->unbind();
}
if(!ibuf)
return;
- unsigned total=0;
+ unsigned total = 0;
for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
- total+=i->size();
+ total += i->size();
ibuf->data(total*sizeof(unsigned), 0);
- unsigned offset=0;
+ unsigned offset = 0;
for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
{
ibuf->sub_data(offset*sizeof(unsigned), i->size()*sizeof(unsigned), &i->get_indices()[0]);
- offset+=i->size();
+ offset += i->size();
}
ibuf->unbind();
}
void MeshBuilder::begin_()
{
- batch=new Batch(type);
+ batch = new Batch(type);
}
void MeshBuilder::end_()
{
mesh.add_batch(*batch);
delete batch;
- batch=0;
+ batch = 0;
}
void MeshBuilder::element_(unsigned i)
void Object::render(const Tag &tag) const
{
- const RenderPass *pass=get_pass(tag);
+ const RenderPass *pass = get_pass(tag);
if(!pass)
return;
void Object::render(const ObjectInstance &inst, const Tag &tag) const
{
- const RenderPass *pass=get_pass(tag);
+ const RenderPass *pass = get_pass(tag);
if(!pass)
return;
void Object::render_instance(const ObjectInstance &inst, const Tag &tag) const
{
inst.setup_render(tag);
- unsigned lod=min<unsigned>(inst.get_level_of_detail(), meshes.size()-1);
+ unsigned lod = min<unsigned>(inst.get_level_of_detail(), meshes.size()-1);
meshes[lod]->draw();
inst.finish_render(tag);
}
void Object::Loader::init()
{
- allow_pointer_reload=false;
+ allow_pointer_reload = false;
add("lod_mesh", &Loader::lod_mesh);
add("mesh", static_cast<void (Loader::*)()>(&Loader::mesh));
void Object::Loader::lod_mesh(unsigned l, const string &n)
{
obj.meshes.resize(l+1, 0);
- obj.meshes[l]=get_collection().get<Mesh>(n);
+ obj.meshes[l] = get_collection().get<Mesh>(n);
}
void Object::Loader::mesh()
if(obj.meshes[0])
throw InvalidState("A mesh is already loaded");
- RefPtr<Mesh> msh=new Mesh;
+ RefPtr<Mesh> msh = new Mesh;
load_sub(*msh);
- obj.meshes[0]=msh.release();
- obj.own_mesh=true;
+ obj.meshes[0] = msh.release();
+ obj.own_mesh = true;
}
void Object::Loader::mesh(const std::string &n)
if(obj.meshes[0])
throw InvalidState("A mesh is already loaded");
- obj.meshes[0]=get_collection().get<Mesh>(n);
+ obj.meshes[0] = get_collection().get<Mesh>(n);
}
void Object::Loader::technique()
{
- RefPtr<Technique> tech=new Technique;
+ RefPtr<Technique> tech = new Technique;
if(coll)
load_sub(*tech, get_collection());
else
load_sub(*tech);
- obj.technique=tech.release();
- obj.own_technique=true;
+ obj.technique = tech.release();
+ obj.own_technique = true;
}
} // namespace GL
/**
Renders the object. A tag can be provided to render a non-default pass.
*/
- virtual void render(const Tag &tag=Tag()) const;
+ virtual void render(const Tag &tag = Tag()) const;
/**
Renders the object with an instance. The instance's hook functions are
called before and after drawing the mesh. A tag may also be given to render
a non-default pass.
*/
- virtual void render(const ObjectInstance &, const Tag &tag=Tag()) const;
+ virtual void render(const ObjectInstance &, const Tag &tag = Tag()) const;
/**
Renders multiple instances of the object in one go. This may improve
mesh.
*/
template<typename Iter>
- void render(Iter begin, Iter end, const Tag &tag=Tag()) const
+ void render(Iter begin, Iter end, const Tag &tag = Tag()) const
{
- const RenderPass *pass=get_pass(tag);
+ const RenderPass *pass = get_pass(tag);
if(!pass)
return;
const Object &get_object() const { return object; }
- virtual void render(const Tag &tag=Tag()) const;
+ virtual void render(const Tag &tag = Tag()) const;
/**
Hook function, called from Object just before rendering the mesh.
if(passes.count(tag))
throw KeyError("Pass already exists");
- PipelinePass &pass=passes[tag];
+ PipelinePass &pass = passes[tag];
pass_order.push_back(tag);
return pass;
}
PipelinePass &Pipeline::get_pass(const Tag &tag)
{
- PassMap::iterator i=passes.find(tag);
+ PassMap::iterator i = passes.find(tag);
if(i==passes.end())
throw KeyError("Unknown pass");
return i->second;
const PipelinePass &Pipeline::get_pass(const Tag &tag) const
{
- PassMap::const_iterator i=passes.find(tag);
+ PassMap::const_iterator i = passes.find(tag);
if(i==passes.end())
throw KeyError("Unknown pass");
return i->second;
postproc.push_back(&pp);
if(!fbo)
{
- fbo=new Framebuffer;
- color_buf=new Texture2D;
+ fbo = new Framebuffer;
+ color_buf = new Texture2D;
color_buf->set_min_filter(NEAREST);
color_buf->set_mag_filter(NEAREST);
color_buf->storage((hdr ? RGB16F : RGB), width, height, 0);
color_buf->image(0, RGB, UNSIGNED_BYTE, 0);
fbo->attach(COLOR_ATTACHMENT0, *color_buf, 0);
- depth_buf=new Renderbuffer;
+ depth_buf = new Renderbuffer;
depth_buf->storage(DEPTH_COMPONENT, width, height);
fbo->attach(DEPTH_ATTACHMENT, *depth_buf);
Framebuffer::unbind();
void Pipeline::render(const Tag &tag) const
{
- const PipelinePass &pass=get_pass(tag);
+ const PipelinePass &pass = get_pass(tag);
Bind bind_depth_test(pass.depth_test);
Bind bind_blend(pass.blend);
void add_effect(Effect &);
void add_postprocessor(PostProcessor &);
- virtual void render(const Tag &tag=Tag()) const;
+ virtual void render(const Tag &tag = Tag()) const;
void render_all() const;
};
in>>word;
if(word=="COLOR_INDEX")
- fmt=COLOR_INDEX;
+ fmt = COLOR_INDEX;
else if(word=="STENCIL_INDEX")
- fmt=STENCIL_INDEX;
+ fmt = STENCIL_INDEX;
else if(word=="DEPTH_COMPONENT")
- fmt=DEPTH_COMPONENT;
+ fmt = DEPTH_COMPONENT;
else if(word=="RED")
- fmt=RED;
+ fmt = RED;
else if(word=="GREEN")
- fmt=GREEN;
+ fmt = GREEN;
else if(word=="BLUE")
- fmt=BLUE;
+ fmt = BLUE;
else if(word=="ALPHA")
- fmt=ALPHA;
+ fmt = ALPHA;
else if(word=="RGB")
- fmt=RGB;
+ fmt = RGB;
else if(word=="RGBA")
- fmt=RGBA;
+ fmt = RGBA;
else if(word=="BGR")
- fmt=BGR;
+ fmt = BGR;
else if(word=="BGRA")
- fmt=BGRA;
+ fmt = BGRA;
else if(word=="LUMINANCE")
- fmt=LUMINANCE;
+ fmt = LUMINANCE;
else if(word=="LUMINANCE_ALPHA")
- fmt=LUMINANCE_ALPHA;
+ fmt = LUMINANCE_ALPHA;
else
in.setstate(ios_base::failbit);
if(in_batch)
throw InvalidState("begin() already called");
- type=t;
- in_batch=true;
+ type = t;
+ in_batch = true;
begin_();
}
if(!in_batch)
throw InvalidState("end() called without begin()");
- in_batch=false;
+ in_batch = false;
end_();
}
in>>str;
if(str=="POINTS")
- pt=POINTS;
+ pt = POINTS;
else if(str=="LINES")
- pt=LINES;
+ pt = LINES;
else if(str=="LINE_LOOP")
- pt=LINE_LOOP;
+ pt = LINE_LOOP;
else if(str=="LINE_STRIP")
- pt=LINE_STRIP;
+ pt = LINE_STRIP;
else if(str=="TRIANGLES")
- pt=TRIANGLES;
+ pt = TRIANGLES;
else if(str=="TRIANGLE_STRIP")
- pt=TRIANGLE_STRIP;
+ pt = TRIANGLE_STRIP;
else if(str=="TRIANGLE_FAN")
- pt=TRIANGLE_FAN;
+ pt = TRIANGLE_FAN;
else if(str=="QUADS")
- pt=QUADS;
+ pt = QUADS;
else if(str=="QUAD_STRIP")
- pt=QUAD_STRIP;
+ pt = QUAD_STRIP;
else if(str=="POLYGON")
- pt=POLYGON;
+ pt = POLYGON;
else
in.setstate(std::ios_base::failbit);
{
static RequireExtension _ext("GL_ARB_shader_objects");
- linked=false;
- id=glCreateProgramObjectARB();
+ linked = false;
+ id = glCreateProgramObjectARB();
}
Program::~Program()
void Program::detach_shader(Shader &shader)
{
- list<Shader *>::iterator i=remove(shaders.begin(), shaders.end(), &shader);
+ list<Shader *>::iterator i = remove(shaders.begin(), shaders.end(), &shader);
if(i!=shaders.end())
{
shaders.erase(i, shaders.end());
void Program::set_del_shaders(bool ds)
{
- del_shaders=ds;
+ del_shaders = ds;
}
void Program::bind_attribute(unsigned index, const string &name)
(*i)->compile();
glLinkProgramARB(id);
- if(!(linked=get_param(GL_LINK_STATUS)))
+ if(!(linked = get_param(GL_LINK_STATUS)))
throw CompileError(get_info_log());
}
string Program::get_info_log() const
{
- GLsizei len=get_param(GL_INFO_LOG_LENGTH);
+ GLsizei len = get_param(GL_INFO_LOG_LENGTH);
char log[len+1];
glGetInfoLogARB(id, len+1, &len, log);
return string(log, len);
throw InvalidState("Program is not linked");
glUseProgramObjectARB(id);
- cur_prog=this;
+ cur_prog = this;
}
int Program::get_uniform_location(const string &n) const
if(cur_prog)
{
glUseProgramObjectARB(0);
- cur_prog=0;
+ cur_prog = 0;
}
}
bind();
}
-const Program *Program::cur_prog=0;
+const Program *Program::cur_prog = 0;
Program::Loader::Loader(Program &p):
data(other.data)
{
for(map<int, Uniform *>::iterator i=data.begin(); i!=data.end(); ++i)
- i->second=i->second->clone();
+ i->second = i->second->clone();
}
ProgramData::~ProgramData()
return;
}
- map<int, Uniform *>::iterator i=data.find(index);
+ map<int, Uniform *>::iterator i = data.find(index);
if(i!=data.end())
{
delete i->second;
- i->second=uni;
+ i->second = uni;
}
else
- data[index]=uni;
+ data[index] = uni;
}
void ProgramData::uniform(int index, int v)
void perspective(double fov_y, double aspect, double nearr, double farr)
{
- double hh=tan(fov_y*M_PI/360)*nearr;
+ double hh = tan(fov_y*M_PI/360)*nearr;
frustum(-hh*aspect, hh*aspect, -hh, hh, nearr, farr);
}
public:
virtual ~Renderable() { }
- virtual void render(const Tag &tag=Tag()) const =0;
+ virtual void render(const Tag &tag = Tag()) const =0;
};
} // namespace Msp
void Renderbuffer::storage(PixelFormat fmt, unsigned w, unsigned h)
{
bind();
- width=w;
- height=h;
+ width = w;
+ height = h;
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, fmt, width, height);
}
int old_rm;
glGetIntegerv(GL_RENDER_MODE, &old_rm);
- int result=glRenderMode(rm);
+ int result = glRenderMode(rm);
if(old_rm==SELECT)
_parse_internal_select_records(result);
namespace Msp {
namespace GL {
-const RenderPass *RenderPass::current=0;
+const RenderPass *RenderPass::current = 0;
RenderPass::RenderPass():
shprog(0),
void RenderPass::set_material(const Material *mat)
{
- material=mat;
+ material = mat;
}
unsigned RenderPass::get_texture_index(const string &slot) const
void RenderPass::set_texture(const string &slot, const Texture *tex)
{
- textures[get_texture_index(slot)]=tex;
+ textures[get_texture_index(slot)] = tex;
}
void RenderPass::bind() const
if(this==current)
return;
- const RenderPass *old=current;
- current=this;
+ const RenderPass *old = current;
+ current = this;
if(shprog)
{
for(unsigned i=current->textures.size(); i--; )
GL::Texture::unbind_from(i);
- current=0;
+ current = 0;
}
}
void RenderPass::Loader::init()
{
- allow_pointer_reload=false;
+ allow_pointer_reload = false;
add("shader", &RenderPass::shprog);
add("material", &Loader::material);
if(obj.shprog)
{
if(!obj.shdata)
- obj.shdata=new ProgramData;
+ obj.shdata = new ProgramData;
for(unsigned i=0; i<obj.textures.size(); ++i)
{
- unsigned loc=obj.shprog->get_uniform_location(obj.textures[i].name);
+ unsigned loc = obj.shprog->get_uniform_location(obj.textures[i].name);
obj.shdata->uniform(loc, static_cast<int>(i));
}
}
if(obj.material)
throw InvalidState("A material is already loaded");
- RefPtr<Material> mat=new Material;
+ RefPtr<Material> mat = new Material;
load_sub(*mat);
- obj.material=mat.release();
- obj.own_material=true;
+ obj.material = mat.release();
+ obj.own_material = true;
}
void RenderPass::Loader::texture(const string &n)
{
- const Texture *tex=(n.empty() ? 0 : get_collection().get<Texture>(n));
+ const Texture *tex = (n.empty() ? 0 : get_collection().get<Texture>(n));
TextureSlot slot(tex);
- slot.name=(obj.textures.empty() ? "texture" : format("texture%d", obj.textures.size()));
+ slot.name = (obj.textures.empty() ? "texture" : format("texture%d", obj.textures.size()));
load_sub(slot);
obj.textures.push_back(slot);
}
if(!obj.shprog)
throw InvalidState("Can't load uniforms without a shader program");
if(!obj.shdata)
- obj.shdata=new ProgramData;
+ obj.shdata = new ProgramData;
load_sub(*obj.shdata, *obj.shprog);
}
void Scene::add(const Renderable &r)
{
- if(const ObjectInstance *oi=dynamic_cast<const ObjectInstance *>(&r))
+ if(const ObjectInstance *oi = dynamic_cast<const ObjectInstance *>(&r))
objects[&oi->get_object()].insert(oi);
else
renderables.insert(&r);
void Scene::remove(const Renderable &r)
{
- if(const ObjectInstance *oi=dynamic_cast<const ObjectInstance *>(&r))
+ if(const ObjectInstance *oi = dynamic_cast<const ObjectInstance *>(&r))
{
- ObjectMap::iterator i=objects.find(&oi->get_object());
+ ObjectMap::iterator i = objects.find(&oi->get_object());
if(i!=objects.end())
{
i->second.erase(oi);
void add(const Renderable &);
void remove(const Renderable &);
- virtual void render(const Tag &tag=Tag()) const;
+ virtual void render(const Tag &tag = Tag()) const;
};
} // namespace GL
namespace {
-vector<Msp::GL::SelectRecord> *select_buf=0;
+vector<Msp::GL::SelectRecord> *select_buf = 0;
vector<unsigned> select_buf_int;
}
{
select_buf_int.resize(1024);
glSelectBuffer(select_buf_int.size(), &select_buf_int[0]);
- select_buf=&buf;
+ select_buf = &buf;
}
void init_names()
void parse_select_records(const unsigned *buf, unsigned count, vector<SelectRecord> &tbuf)
{
- unsigned i=0;
+ unsigned i = 0;
while(count--)
{
SelectRecord record;
- unsigned n_names=buf[i++];
- record.min_depth=buf[i++];
- record.max_depth=buf[i++];
+ unsigned n_names = buf[i++];
+ record.min_depth = buf[i++];
+ record.max_depth = buf[i++];
record.names.reserve(n_names);
while(n_names--)
void Shader::init(ShaderType t)
{
- compiled=false;
+ compiled = false;
if(t==FRAGMENT_SHADER)
static RequireExtension _ext("GL_ARB_fragment_shader");
else if(t==VERTEX_SHADER)
static RequireExtension _ext("GL_ARB_vertex_shader");
- id=glCreateShaderObjectARB(t);
+ id = glCreateShaderObjectARB(t);
}
Shader::~Shader()
void Shader::compile()
{
glCompileShaderARB(id);
- if(!(compiled=get_param(GL_COMPILE_STATUS)))
+ if(!(compiled = get_param(GL_COMPILE_STATUS)))
throw CompileError(get_info_log());
}
string Shader::get_info_log() const
{
- GLsizei len=get_param(GL_INFO_LOG_LENGTH);
+ GLsizei len = get_param(GL_INFO_LOG_LENGTH);
char log[len+1];
glGetInfoLogARB(id, len+1, &len, log);
return string(log, len);
void ShadowMap::set_target(const Vector3 &t, float r)
{
- target=t;
- radius=r;
+ target = t;
+ radius = r;
}
void ShadowMap::set_texture_unit(unsigned u)
{
- unit=u;
+ unit = u;
}
void ShadowMap::prepare()
{
- Vector4 lpos=light.get_position();
+ Vector4 lpos = light.get_position();
if(lpos.w)
{
/* XXX Not really proper way to support positional lights, but good
enough when the light source is far away */
- lpos.x-=target.x;
- lpos.y-=target.y;
- lpos.z-=target.z;
- float d=sqrt(lpos.x*lpos.x+lpos.y*lpos.y+lpos.z*lpos.z);
- lpos.x/=d;
- lpos.y/=d;
- lpos.z/=d;
+ lpos.x -= target.x;
+ lpos.y -= target.y;
+ lpos.z -= target.z;
+ float d = sqrt(lpos.x*lpos.x+lpos.y*lpos.y+lpos.z*lpos.z);
+ lpos.x /= d;
+ lpos.y /= d;
+ lpos.z /= d;
}
float matrix[16];
if(abs(lpos.z)>=abs(lpos.x) && abs(lpos.z)>=abs(lpos.y))
{
- float d=sqrt(lpos.x*lpos.x+lpos.z*lpos.z);
- matrix[0]=lpos.z/d;
- matrix[4]=0;
- matrix[8]=-lpos.x/d;
- matrix[1]=-lpos.x*lpos.y/d;
- matrix[5]=d;
- matrix[9]=-lpos.z*lpos.y/d;
+ float d = sqrt(lpos.x*lpos.x+lpos.z*lpos.z);
+ matrix[0] = lpos.z/d;
+ matrix[4] = 0;
+ matrix[8] = -lpos.x/d;
+ matrix[1] = -lpos.x*lpos.y/d;
+ matrix[5] = d;
+ matrix[9] = -lpos.z*lpos.y/d;
}
else
{
- float d=sqrt(lpos.x*lpos.x+lpos.y*lpos.y);
- matrix[0]=-lpos.y/d;
- matrix[4]=lpos.x/d;
- matrix[8]=0;
- matrix[1]=-lpos.x*lpos.z/d;
- matrix[5]=-lpos.y*lpos.z/d;
- matrix[9]=d;
+ float d = sqrt(lpos.x*lpos.x+lpos.y*lpos.y);
+ matrix[0] = -lpos.y/d;
+ matrix[4] = lpos.x/d;
+ matrix[8] = 0;
+ matrix[1] = -lpos.x*lpos.z/d;
+ matrix[5] = -lpos.y*lpos.z/d;
+ matrix[9] = d;
}
- matrix[2]=lpos.x;
- matrix[6]=lpos.y;
- matrix[10]=lpos.z;
+ matrix[2] = lpos.x;
+ matrix[6] = lpos.y;
+ matrix[10] = lpos.z;
- matrix[12]=-(target.x*matrix[0]+target.y*matrix[4]+target.z*matrix[8]);
- matrix[13]=-(target.x*matrix[1]+target.y*matrix[5]+target.z*matrix[9]);
- matrix[14]=-(target.x*matrix[2]+target.y*matrix[6]+target.z*matrix[10]);
- matrix[3]=0;
- matrix[7]=0;
- matrix[11]=0;
- matrix[15]=1;
+ matrix[12] = -(target.x*matrix[0]+target.y*matrix[4]+target.z*matrix[8]);
+ matrix[13] = -(target.x*matrix[1]+target.y*matrix[5]+target.z*matrix[9]);
+ matrix[14] = -(target.x*matrix[2]+target.y*matrix[6]+target.z*matrix[10]);
+ matrix[3] = 0;
+ matrix[7] = 0;
+ matrix[11] = 0;
+ matrix[15] = 1;
{
matrix_mode(PROJECTION);
push_matrix();
load_matrix(matrix);
- const Framebuffer *old_fbo=Framebuffer::current();
+ const Framebuffer *old_fbo = Framebuffer::current();
fbo.bind();
clear(DEPTH_BUFFER_BIT);
scene.render("shadow");
}
depth_buf.bind_to(unit);
- float diam=radius*2;
- float s_eq[4]={ matrix[0]/diam, matrix[4]/diam, matrix[8]/diam, matrix[12]/diam+0.5 };
- float t_eq[4]={ matrix[1]/diam, matrix[5]/diam, matrix[9]/diam, matrix[13]/diam+0.5 };
- float r_eq[4]={ -matrix[2]/diam, -matrix[6]/diam, -matrix[10]/diam, 0.5-matrix[14]/diam-4.0/size };
+ float diam = radius*2;
+ float s_eq[4] = { matrix[0]/diam, matrix[4]/diam, matrix[8]/diam, matrix[12]/diam+0.5 };
+ float t_eq[4] = { matrix[1]/diam, matrix[5]/diam, matrix[9]/diam, matrix[13]/diam+0.5 };
+ float r_eq[4] = { -matrix[2]/diam, -matrix[6]/diam, -matrix[10]/diam, 0.5-matrix[14]/diam-4.0/size };
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGenfv(GL_S, GL_EYE_PLANE, s_eq);
enable(GL_TEXTURE_GEN_S);
template<typename T>
inline unsigned hash(T begin, T end)
{
- unsigned result=0;
+ unsigned result = 0;
for(T i=begin; (i!=end && *i); ++i)
- result=((result>>29)|(result<<5))^static_cast<unsigned char>(*i);
+ result = ((result>>29)|(result<<5))^static_cast<unsigned char>(*i);
return result;
}
const RenderPass &Technique::get_pass(const GL::Tag &tag) const
{
- PassMap::const_iterator i=passes.find(tag);
+ PassMap::const_iterator i = passes.find(tag);
if(i==passes.end())
throw KeyError("Unknown pass");
return i->second;
void Technique::Loader::inherit(const string &n)
{
- obj.passes=get_collection().get<Technique>(n)->get_passes();
+ obj.passes = get_collection().get<Technique>(n)->get_passes();
InheritLoader ldr(obj, get_collection());
load_sub_with(ldr);
}
void Technique::InheritLoader::texture(const string &slot, const string &name)
{
- Texture *tex=get_collection().get<Texture>(name);
+ Texture *tex = get_collection().get<Texture>(name);
for(PassMap::iterator i=obj.passes.begin(); i!=obj.passes.end(); ++i)
{
try
void TexEnv::set_mode(TexEnvMode m)
{
- mode=m;
+ mode = m;
}
void TexEnv::set_color(const Color &c)
{
- color=c;
+ color = c;
}
void TexEnv::bind()
in>>str;
if(str=="NEAREST")
- tf=NEAREST;
+ tf = NEAREST;
else if(str=="LINEAR")
- tf=LINEAR;
+ tf = LINEAR;
else if(str=="NEAREST_MIPMAP_NEAREST")
- tf=NEAREST_MIPMAP_NEAREST;
+ tf = NEAREST_MIPMAP_NEAREST;
else if(str=="NEAREST_MIPMAP_LINEAR")
- tf=NEAREST_MIPMAP_LINEAR;
+ tf = NEAREST_MIPMAP_LINEAR;
else if(str=="LINEAR_MIPMAP_NEAREST")
- tf=LINEAR_MIPMAP_NEAREST;
+ tf = LINEAR_MIPMAP_NEAREST;
else if(str=="LINEAR_MIPMAP_LINEAR")
- tf=LINEAR_MIPMAP_LINEAR;
+ tf = LINEAR_MIPMAP_LINEAR;
else
in.setstate(ios_base::failbit);
if(!target)
throw InvalidState("Attempt to bind a texture without target");
- const Texture *cur=TexUnit::current().get_texture();
+ const Texture *cur = TexUnit::current().get_texture();
if(cur!=this)
{
if(cur && cur->target!=target)
void Texture::unbind()
{
- const Texture *cur=TexUnit::current().get_texture();
+ const Texture *cur = TexUnit::current().get_texture();
if(!cur)
return;
width(0),
height(0)
{
- target=GL_TEXTURE_2D;
+ target = GL_TEXTURE_2D;
bind();
}
if(wd==0 || ht==0)
throw InvalidParameterValue("Invalid texture dimensions");
- ifmt=fmt;
- width=wd;
- height=ht;
- border=brd;
+ ifmt = fmt;
+ width = wd;
+ height = ht;
+ border = brd;
}
void Texture2D::image(int level, PixelFormat fmt, DataType type, const void *data)
void Texture2D::image(const Graphics::Image &img)
{
- unsigned w=img.get_width();
- unsigned h=img.get_height();
- PixelFormat fmt=pixelformat_from_graphics(img.get_format());
+ unsigned w = img.get_width();
+ unsigned h = img.get_height();
+ PixelFormat fmt = pixelformat_from_graphics(img.get_format());
if(width==0)
storage(fmt, w, h, 0);
else if(w!=width || h!=height)
void Texture2D::Loader::raw_data(const string &data)
{
- Texture2D &t2d=static_cast<Texture2D &>(obj);
+ Texture2D &t2d = static_cast<Texture2D &>(obj);
t2d.image(0, t2d.ifmt, UNSIGNED_BYTE, data.data());
}
{
static RequireVersion _ver(1, 3);
- target=GL_TEXTURE_3D;
+ target = GL_TEXTURE_3D;
bind();
}
if(w==0 || h==0 || d==0)
throw InvalidParameterValue("Invalid texture dimensions");
- width=w;
- height=h;
- depth=d;
- ifmt=f;
- border=b;
+ width = w;
+ height = h;
+ depth = d;
+ ifmt = f;
+ border = b;
image(0, ifmt, UNSIGNED_BYTE, 0);
}
Graphics::Image img;
img.load_file(fn);
- unsigned w=img.get_width();
- unsigned h=img.get_height();
- unsigned d=1;
+ unsigned w = img.get_width();
+ unsigned h = img.get_height();
+ unsigned d = 1;
if(dp==-1)
{
if(h%w)
throw IncompatibleData("Image height is not divisible by its width");
- d=h/w;
- h=w;
+ d = h/w;
+ h = w;
}
else if(dp==-2)
{
for(; d*d<h; ++d) ;
if(d*d!=h)
throw IncompatibleData("Could not find a square root of texture height");
- h=d;
+ h = d;
}
else if(dp>0)
- d=dp;
+ d = dp;
- PixelFormat fmt=pixelformat_from_graphics(img.get_format());
+ PixelFormat fmt = pixelformat_from_graphics(img.get_format());
if(width==0)
storage(fmt, w, h, d, 0);
else if(w!=width || h!=height || d!=depth)
void storage(PixelFormat, unsigned, unsigned, unsigned, int);
void image(int, PixelFormat, DataType, const void *);
void sub_image(int, int, int, unsigned, unsigned, unsigned, PixelFormat, DataType, const void *);
- void load_image(const std::string &fn, int dp=-1);
+ void load_image(const std::string &fn, int dp = -1);
unsigned get_width() const { return width; }
unsigned get_height() const { return height; }
unsigned get_depth() const { return depth; }
bool TexUnit::set_texture(const Texture *tex)
{
- bool result=(tex!=texture);
- texture=tex;
+ bool result = (tex!=texture);
+ texture = tex;
return result;
}
bool TexUnit::set_texenv(const TexEnv *env)
{
- bool result=(texenv!=env);
- texenv=env;
+ bool result = (texenv!=env);
+ texenv = env;
return result;
}
static RequireVersion _ver(1, 3);
glActiveTexture(GL_TEXTURE0+n);
}
- cur_unit=&units[n];
+ cur_unit = &units[n];
return units[n];
}
}
vector<TexUnit> TexUnit::units;
-TexUnit *TexUnit::cur_unit=0;
+TexUnit *TexUnit::cur_unit = 0;
} // namespace GL
} // namespace Msp
Uniform2f::Uniform2f(float v0, float v1)
{
- v[0]=v0;
- v[1]=v1;
+ v[0] = v0;
+ v[1] = v1;
}
void Uniform2f::apply(int index) const
Uniform3f::Uniform3f(float v0, float v1, float v2)
{
- v[0]=v0;
- v[1]=v1;
- v[2]=v2;
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
}
void Uniform3f::apply(int index) const
Uniform4f::Uniform4f(float v0, float v1, float v2, float v3)
{
- v[0]=v0;
- v[1]=v1;
- v[2]=v2;
- v[3]=v3;
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
}
void Uniform4f::apply(int index) const
namespace Msp {
namespace GL {
-PFNGLBLENDCOLORPROC glBlendColor=0;
-PFNGLBLENDEQUATIONPROC glBlendEquation=0;
-PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements=0;
-PFNGLCOLORTABLEPROC glColorTable=0;
-PFNGLCOLORTABLEPARAMETERFVPROC glColorTableParameterfv=0;
-PFNGLCOLORTABLEPARAMETERIVPROC glColorTableParameteriv=0;
-PFNGLCOPYCOLORTABLEPROC glCopyColorTable=0;
-PFNGLGETCOLORTABLEPROC glGetColorTable=0;
-PFNGLGETCOLORTABLEPARAMETERFVPROC glGetColorTableParameterfv=0;
-PFNGLGETCOLORTABLEPARAMETERIVPROC glGetColorTableParameteriv=0;
-PFNGLCOLORSUBTABLEPROC glColorSubTable=0;
-PFNGLCOPYCOLORSUBTABLEPROC glCopyColorSubTable=0;
-PFNGLCONVOLUTIONFILTER1DPROC glConvolutionFilter1D=0;
-PFNGLCONVOLUTIONFILTER2DPROC glConvolutionFilter2D=0;
-PFNGLCONVOLUTIONPARAMETERFPROC glConvolutionParameterf=0;
-PFNGLCONVOLUTIONPARAMETERFVPROC glConvolutionParameterfv=0;
-PFNGLCONVOLUTIONPARAMETERIPROC glConvolutionParameteri=0;
-PFNGLCONVOLUTIONPARAMETERIVPROC glConvolutionParameteriv=0;
-PFNGLCOPYCONVOLUTIONFILTER1DPROC glCopyConvolutionFilter1D=0;
-PFNGLCOPYCONVOLUTIONFILTER2DPROC glCopyConvolutionFilter2D=0;
-PFNGLGETCONVOLUTIONFILTERPROC glGetConvolutionFilter=0;
-PFNGLGETCONVOLUTIONPARAMETERFVPROC glGetConvolutionParameterfv=0;
-PFNGLGETCONVOLUTIONPARAMETERIVPROC glGetConvolutionParameteriv=0;
-PFNGLGETSEPARABLEFILTERPROC glGetSeparableFilter=0;
-PFNGLSEPARABLEFILTER2DPROC glSeparableFilter2D=0;
-PFNGLGETHISTOGRAMPROC glGetHistogram=0;
-PFNGLGETHISTOGRAMPARAMETERFVPROC glGetHistogramParameterfv=0;
-PFNGLGETHISTOGRAMPARAMETERIVPROC glGetHistogramParameteriv=0;
-PFNGLGETMINMAXPROC glGetMinmax=0;
-PFNGLGETMINMAXPARAMETERFVPROC glGetMinmaxParameterfv=0;
-PFNGLGETMINMAXPARAMETERIVPROC glGetMinmaxParameteriv=0;
-PFNGLHISTOGRAMPROC glHistogram=0;
-PFNGLMINMAXPROC glMinmax=0;
-PFNGLRESETHISTOGRAMPROC glResetHistogram=0;
-PFNGLRESETMINMAXPROC glResetMinmax=0;
-PFNGLTEXIMAGE3DPROC glTexImage3D=0;
-PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D=0;
-PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D=0;
+PFNGLBLENDCOLORPROC glBlendColor = 0;
+PFNGLBLENDEQUATIONPROC glBlendEquation = 0;
+PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = 0;
+PFNGLCOLORTABLEPROC glColorTable = 0;
+PFNGLCOLORTABLEPARAMETERFVPROC glColorTableParameterfv = 0;
+PFNGLCOLORTABLEPARAMETERIVPROC glColorTableParameteriv = 0;
+PFNGLCOPYCOLORTABLEPROC glCopyColorTable = 0;
+PFNGLGETCOLORTABLEPROC glGetColorTable = 0;
+PFNGLGETCOLORTABLEPARAMETERFVPROC glGetColorTableParameterfv = 0;
+PFNGLGETCOLORTABLEPARAMETERIVPROC glGetColorTableParameteriv = 0;
+PFNGLCOLORSUBTABLEPROC glColorSubTable = 0;
+PFNGLCOPYCOLORSUBTABLEPROC glCopyColorSubTable = 0;
+PFNGLCONVOLUTIONFILTER1DPROC glConvolutionFilter1D = 0;
+PFNGLCONVOLUTIONFILTER2DPROC glConvolutionFilter2D = 0;
+PFNGLCONVOLUTIONPARAMETERFPROC glConvolutionParameterf = 0;
+PFNGLCONVOLUTIONPARAMETERFVPROC glConvolutionParameterfv = 0;
+PFNGLCONVOLUTIONPARAMETERIPROC glConvolutionParameteri = 0;
+PFNGLCONVOLUTIONPARAMETERIVPROC glConvolutionParameteriv = 0;
+PFNGLCOPYCONVOLUTIONFILTER1DPROC glCopyConvolutionFilter1D = 0;
+PFNGLCOPYCONVOLUTIONFILTER2DPROC glCopyConvolutionFilter2D = 0;
+PFNGLGETCONVOLUTIONFILTERPROC glGetConvolutionFilter = 0;
+PFNGLGETCONVOLUTIONPARAMETERFVPROC glGetConvolutionParameterfv = 0;
+PFNGLGETCONVOLUTIONPARAMETERIVPROC glGetConvolutionParameteriv = 0;
+PFNGLGETSEPARABLEFILTERPROC glGetSeparableFilter = 0;
+PFNGLSEPARABLEFILTER2DPROC glSeparableFilter2D = 0;
+PFNGLGETHISTOGRAMPROC glGetHistogram = 0;
+PFNGLGETHISTOGRAMPARAMETERFVPROC glGetHistogramParameterfv = 0;
+PFNGLGETHISTOGRAMPARAMETERIVPROC glGetHistogramParameteriv = 0;
+PFNGLGETMINMAXPROC glGetMinmax = 0;
+PFNGLGETMINMAXPARAMETERFVPROC glGetMinmaxParameterfv = 0;
+PFNGLGETMINMAXPARAMETERIVPROC glGetMinmaxParameteriv = 0;
+PFNGLHISTOGRAMPROC glHistogram = 0;
+PFNGLMINMAXPROC glMinmax = 0;
+PFNGLRESETHISTOGRAMPROC glResetHistogram = 0;
+PFNGLRESETMINMAXPROC glResetMinmax = 0;
+PFNGLTEXIMAGE3DPROC glTexImage3D = 0;
+PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = 0;
+PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D = 0;
void init_version_1_2()
{
- glBlendColor=reinterpret_cast<PFNGLBLENDCOLORPROC>(get_proc_address("glBlendColor"));
- glBlendEquation=reinterpret_cast<PFNGLBLENDEQUATIONPROC>(get_proc_address("glBlendEquation"));
- glDrawRangeElements=reinterpret_cast<PFNGLDRAWRANGEELEMENTSPROC>(get_proc_address("glDrawRangeElements"));
- glColorTable=reinterpret_cast<PFNGLCOLORTABLEPROC>(get_proc_address("glColorTable"));
- glColorTableParameterfv=reinterpret_cast<PFNGLCOLORTABLEPARAMETERFVPROC>(get_proc_address("glColorTableParameterfv"));
- glColorTableParameteriv=reinterpret_cast<PFNGLCOLORTABLEPARAMETERIVPROC>(get_proc_address("glColorTableParameteriv"));
- glCopyColorTable=reinterpret_cast<PFNGLCOPYCOLORTABLEPROC>(get_proc_address("glCopyColorTable"));
- glGetColorTable=reinterpret_cast<PFNGLGETCOLORTABLEPROC>(get_proc_address("glGetColorTable"));
- glGetColorTableParameterfv=reinterpret_cast<PFNGLGETCOLORTABLEPARAMETERFVPROC>(get_proc_address("glGetColorTableParameterfv"));
- glGetColorTableParameteriv=reinterpret_cast<PFNGLGETCOLORTABLEPARAMETERIVPROC>(get_proc_address("glGetColorTableParameteriv"));
- glColorSubTable=reinterpret_cast<PFNGLCOLORSUBTABLEPROC>(get_proc_address("glColorSubTable"));
- glCopyColorSubTable=reinterpret_cast<PFNGLCOPYCOLORSUBTABLEPROC>(get_proc_address("glCopyColorSubTable"));
- glConvolutionFilter1D=reinterpret_cast<PFNGLCONVOLUTIONFILTER1DPROC>(get_proc_address("glConvolutionFilter1D"));
- glConvolutionFilter2D=reinterpret_cast<PFNGLCONVOLUTIONFILTER2DPROC>(get_proc_address("glConvolutionFilter2D"));
- glConvolutionParameterf=reinterpret_cast<PFNGLCONVOLUTIONPARAMETERFPROC>(get_proc_address("glConvolutionParameterf"));
- glConvolutionParameterfv=reinterpret_cast<PFNGLCONVOLUTIONPARAMETERFVPROC>(get_proc_address("glConvolutionParameterfv"));
- glConvolutionParameteri=reinterpret_cast<PFNGLCONVOLUTIONPARAMETERIPROC>(get_proc_address("glConvolutionParameteri"));
- glConvolutionParameteriv=reinterpret_cast<PFNGLCONVOLUTIONPARAMETERIVPROC>(get_proc_address("glConvolutionParameteriv"));
- glCopyConvolutionFilter1D=reinterpret_cast<PFNGLCOPYCONVOLUTIONFILTER1DPROC>(get_proc_address("glCopyConvolutionFilter1D"));
- glCopyConvolutionFilter2D=reinterpret_cast<PFNGLCOPYCONVOLUTIONFILTER2DPROC>(get_proc_address("glCopyConvolutionFilter2D"));
- glGetConvolutionFilter=reinterpret_cast<PFNGLGETCONVOLUTIONFILTERPROC>(get_proc_address("glGetConvolutionFilter"));
- glGetConvolutionParameterfv=reinterpret_cast<PFNGLGETCONVOLUTIONPARAMETERFVPROC>(get_proc_address("glGetConvolutionParameterfv"));
- glGetConvolutionParameteriv=reinterpret_cast<PFNGLGETCONVOLUTIONPARAMETERIVPROC>(get_proc_address("glGetConvolutionParameteriv"));
- glGetSeparableFilter=reinterpret_cast<PFNGLGETSEPARABLEFILTERPROC>(get_proc_address("glGetSeparableFilter"));
- glSeparableFilter2D=reinterpret_cast<PFNGLSEPARABLEFILTER2DPROC>(get_proc_address("glSeparableFilter2D"));
- glGetHistogram=reinterpret_cast<PFNGLGETHISTOGRAMPROC>(get_proc_address("glGetHistogram"));
- glGetHistogramParameterfv=reinterpret_cast<PFNGLGETHISTOGRAMPARAMETERFVPROC>(get_proc_address("glGetHistogramParameterfv"));
- glGetHistogramParameteriv=reinterpret_cast<PFNGLGETHISTOGRAMPARAMETERIVPROC>(get_proc_address("glGetHistogramParameteriv"));
- glGetMinmax=reinterpret_cast<PFNGLGETMINMAXPROC>(get_proc_address("glGetMinmax"));
- glGetMinmaxParameterfv=reinterpret_cast<PFNGLGETMINMAXPARAMETERFVPROC>(get_proc_address("glGetMinmaxParameterfv"));
- glGetMinmaxParameteriv=reinterpret_cast<PFNGLGETMINMAXPARAMETERIVPROC>(get_proc_address("glGetMinmaxParameteriv"));
- glHistogram=reinterpret_cast<PFNGLHISTOGRAMPROC>(get_proc_address("glHistogram"));
- glMinmax=reinterpret_cast<PFNGLMINMAXPROC>(get_proc_address("glMinmax"));
- glResetHistogram=reinterpret_cast<PFNGLRESETHISTOGRAMPROC>(get_proc_address("glResetHistogram"));
- glResetMinmax=reinterpret_cast<PFNGLRESETMINMAXPROC>(get_proc_address("glResetMinmax"));
- glTexImage3D=reinterpret_cast<PFNGLTEXIMAGE3DPROC>(get_proc_address("glTexImage3D"));
- glTexSubImage3D=reinterpret_cast<PFNGLTEXSUBIMAGE3DPROC>(get_proc_address("glTexSubImage3D"));
- glCopyTexSubImage3D=reinterpret_cast<PFNGLCOPYTEXSUBIMAGE3DPROC>(get_proc_address("glCopyTexSubImage3D"));
+ glBlendColor = reinterpret_cast<PFNGLBLENDCOLORPROC>(get_proc_address("glBlendColor"));
+ glBlendEquation = reinterpret_cast<PFNGLBLENDEQUATIONPROC>(get_proc_address("glBlendEquation"));
+ glDrawRangeElements = reinterpret_cast<PFNGLDRAWRANGEELEMENTSPROC>(get_proc_address("glDrawRangeElements"));
+ glColorTable = reinterpret_cast<PFNGLCOLORTABLEPROC>(get_proc_address("glColorTable"));
+ glColorTableParameterfv = reinterpret_cast<PFNGLCOLORTABLEPARAMETERFVPROC>(get_proc_address("glColorTableParameterfv"));
+ glColorTableParameteriv = reinterpret_cast<PFNGLCOLORTABLEPARAMETERIVPROC>(get_proc_address("glColorTableParameteriv"));
+ glCopyColorTable = reinterpret_cast<PFNGLCOPYCOLORTABLEPROC>(get_proc_address("glCopyColorTable"));
+ glGetColorTable = reinterpret_cast<PFNGLGETCOLORTABLEPROC>(get_proc_address("glGetColorTable"));
+ glGetColorTableParameterfv = reinterpret_cast<PFNGLGETCOLORTABLEPARAMETERFVPROC>(get_proc_address("glGetColorTableParameterfv"));
+ glGetColorTableParameteriv = reinterpret_cast<PFNGLGETCOLORTABLEPARAMETERIVPROC>(get_proc_address("glGetColorTableParameteriv"));
+ glColorSubTable = reinterpret_cast<PFNGLCOLORSUBTABLEPROC>(get_proc_address("glColorSubTable"));
+ glCopyColorSubTable = reinterpret_cast<PFNGLCOPYCOLORSUBTABLEPROC>(get_proc_address("glCopyColorSubTable"));
+ glConvolutionFilter1D = reinterpret_cast<PFNGLCONVOLUTIONFILTER1DPROC>(get_proc_address("glConvolutionFilter1D"));
+ glConvolutionFilter2D = reinterpret_cast<PFNGLCONVOLUTIONFILTER2DPROC>(get_proc_address("glConvolutionFilter2D"));
+ glConvolutionParameterf = reinterpret_cast<PFNGLCONVOLUTIONPARAMETERFPROC>(get_proc_address("glConvolutionParameterf"));
+ glConvolutionParameterfv = reinterpret_cast<PFNGLCONVOLUTIONPARAMETERFVPROC>(get_proc_address("glConvolutionParameterfv"));
+ glConvolutionParameteri = reinterpret_cast<PFNGLCONVOLUTIONPARAMETERIPROC>(get_proc_address("glConvolutionParameteri"));
+ glConvolutionParameteriv = reinterpret_cast<PFNGLCONVOLUTIONPARAMETERIVPROC>(get_proc_address("glConvolutionParameteriv"));
+ glCopyConvolutionFilter1D = reinterpret_cast<PFNGLCOPYCONVOLUTIONFILTER1DPROC>(get_proc_address("glCopyConvolutionFilter1D"));
+ glCopyConvolutionFilter2D = reinterpret_cast<PFNGLCOPYCONVOLUTIONFILTER2DPROC>(get_proc_address("glCopyConvolutionFilter2D"));
+ glGetConvolutionFilter = reinterpret_cast<PFNGLGETCONVOLUTIONFILTERPROC>(get_proc_address("glGetConvolutionFilter"));
+ glGetConvolutionParameterfv = reinterpret_cast<PFNGLGETCONVOLUTIONPARAMETERFVPROC>(get_proc_address("glGetConvolutionParameterfv"));
+ glGetConvolutionParameteriv = reinterpret_cast<PFNGLGETCONVOLUTIONPARAMETERIVPROC>(get_proc_address("glGetConvolutionParameteriv"));
+ glGetSeparableFilter = reinterpret_cast<PFNGLGETSEPARABLEFILTERPROC>(get_proc_address("glGetSeparableFilter"));
+ glSeparableFilter2D = reinterpret_cast<PFNGLSEPARABLEFILTER2DPROC>(get_proc_address("glSeparableFilter2D"));
+ glGetHistogram = reinterpret_cast<PFNGLGETHISTOGRAMPROC>(get_proc_address("glGetHistogram"));
+ glGetHistogramParameterfv = reinterpret_cast<PFNGLGETHISTOGRAMPARAMETERFVPROC>(get_proc_address("glGetHistogramParameterfv"));
+ glGetHistogramParameteriv = reinterpret_cast<PFNGLGETHISTOGRAMPARAMETERIVPROC>(get_proc_address("glGetHistogramParameteriv"));
+ glGetMinmax = reinterpret_cast<PFNGLGETMINMAXPROC>(get_proc_address("glGetMinmax"));
+ glGetMinmaxParameterfv = reinterpret_cast<PFNGLGETMINMAXPARAMETERFVPROC>(get_proc_address("glGetMinmaxParameterfv"));
+ glGetMinmaxParameteriv = reinterpret_cast<PFNGLGETMINMAXPARAMETERIVPROC>(get_proc_address("glGetMinmaxParameteriv"));
+ glHistogram = reinterpret_cast<PFNGLHISTOGRAMPROC>(get_proc_address("glHistogram"));
+ glMinmax = reinterpret_cast<PFNGLMINMAXPROC>(get_proc_address("glMinmax"));
+ glResetHistogram = reinterpret_cast<PFNGLRESETHISTOGRAMPROC>(get_proc_address("glResetHistogram"));
+ glResetMinmax = reinterpret_cast<PFNGLRESETMINMAXPROC>(get_proc_address("glResetMinmax"));
+ glTexImage3D = reinterpret_cast<PFNGLTEXIMAGE3DPROC>(get_proc_address("glTexImage3D"));
+ glTexSubImage3D = reinterpret_cast<PFNGLTEXSUBIMAGE3DPROC>(get_proc_address("glTexSubImage3D"));
+ glCopyTexSubImage3D = reinterpret_cast<PFNGLCOPYTEXSUBIMAGE3DPROC>(get_proc_address("glCopyTexSubImage3D"));
}
} // namespace GL
namespace Msp {
namespace GL {
-PFNGLACTIVETEXTUREPROC glActiveTexture=0;
-PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture=0;
-PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d=0;
-PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv=0;
-PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f=0;
-PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv=0;
-PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i=0;
-PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv=0;
-PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s=0;
-PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv=0;
-PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d=0;
-PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv=0;
-PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f=0;
-PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv=0;
-PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i=0;
-PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv=0;
-PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s=0;
-PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv=0;
-PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d=0;
-PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv=0;
-PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f=0;
-PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv=0;
-PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i=0;
-PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv=0;
-PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s=0;
-PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv=0;
-PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d=0;
-PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv=0;
-PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f=0;
-PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv=0;
-PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i=0;
-PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv=0;
-PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s=0;
-PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv=0;
-PFNGLLOADTRANSPOSEMATRIXFPROC glLoadTransposeMatrixf=0;
-PFNGLLOADTRANSPOSEMATRIXDPROC glLoadTransposeMatrixd=0;
-PFNGLMULTTRANSPOSEMATRIXFPROC glMultTransposeMatrixf=0;
-PFNGLMULTTRANSPOSEMATRIXDPROC glMultTransposeMatrixd=0;
-PFNGLSAMPLECOVERAGEPROC glSampleCoverage=0;
-PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D=0;
-PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D=0;
-PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D=0;
-PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D=0;
-PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D=0;
-PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D=0;
-PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage=0;
+PFNGLACTIVETEXTUREPROC glActiveTexture = 0;
+PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture = 0;
+PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d = 0;
+PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv = 0;
+PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f = 0;
+PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv = 0;
+PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i = 0;
+PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv = 0;
+PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s = 0;
+PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv = 0;
+PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d = 0;
+PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv = 0;
+PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f = 0;
+PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv = 0;
+PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i = 0;
+PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv = 0;
+PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s = 0;
+PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv = 0;
+PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d = 0;
+PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv = 0;
+PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f = 0;
+PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv = 0;
+PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i = 0;
+PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv = 0;
+PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s = 0;
+PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv = 0;
+PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d = 0;
+PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv = 0;
+PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f = 0;
+PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv = 0;
+PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i = 0;
+PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv = 0;
+PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s = 0;
+PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv = 0;
+PFNGLLOADTRANSPOSEMATRIXFPROC glLoadTransposeMatrixf = 0;
+PFNGLLOADTRANSPOSEMATRIXDPROC glLoadTransposeMatrixd = 0;
+PFNGLMULTTRANSPOSEMATRIXFPROC glMultTransposeMatrixf = 0;
+PFNGLMULTTRANSPOSEMATRIXDPROC glMultTransposeMatrixd = 0;
+PFNGLSAMPLECOVERAGEPROC glSampleCoverage = 0;
+PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D = 0;
+PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D = 0;
+PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D = 0;
+PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D = 0;
+PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D = 0;
+PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D = 0;
+PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage = 0;
void init_version_1_3()
{
- glActiveTexture=reinterpret_cast<PFNGLACTIVETEXTUREPROC>(get_proc_address("glActiveTexture"));
- glClientActiveTexture=reinterpret_cast<PFNGLCLIENTACTIVETEXTUREPROC>(get_proc_address("glClientActiveTexture"));
- glMultiTexCoord1d=reinterpret_cast<PFNGLMULTITEXCOORD1DPROC>(get_proc_address("glMultiTexCoord1d"));
- glMultiTexCoord1dv=reinterpret_cast<PFNGLMULTITEXCOORD1DVPROC>(get_proc_address("glMultiTexCoord1dv"));
- glMultiTexCoord1f=reinterpret_cast<PFNGLMULTITEXCOORD1FPROC>(get_proc_address("glMultiTexCoord1f"));
- glMultiTexCoord1fv=reinterpret_cast<PFNGLMULTITEXCOORD1FVPROC>(get_proc_address("glMultiTexCoord1fv"));
- glMultiTexCoord1i=reinterpret_cast<PFNGLMULTITEXCOORD1IPROC>(get_proc_address("glMultiTexCoord1i"));
- glMultiTexCoord1iv=reinterpret_cast<PFNGLMULTITEXCOORD1IVPROC>(get_proc_address("glMultiTexCoord1iv"));
- glMultiTexCoord1s=reinterpret_cast<PFNGLMULTITEXCOORD1SPROC>(get_proc_address("glMultiTexCoord1s"));
- glMultiTexCoord1sv=reinterpret_cast<PFNGLMULTITEXCOORD1SVPROC>(get_proc_address("glMultiTexCoord1sv"));
- glMultiTexCoord2d=reinterpret_cast<PFNGLMULTITEXCOORD2DPROC>(get_proc_address("glMultiTexCoord2d"));
- glMultiTexCoord2dv=reinterpret_cast<PFNGLMULTITEXCOORD2DVPROC>(get_proc_address("glMultiTexCoord2dv"));
- glMultiTexCoord2f=reinterpret_cast<PFNGLMULTITEXCOORD2FPROC>(get_proc_address("glMultiTexCoord2f"));
- glMultiTexCoord2fv=reinterpret_cast<PFNGLMULTITEXCOORD2FVPROC>(get_proc_address("glMultiTexCoord2fv"));
- glMultiTexCoord2i=reinterpret_cast<PFNGLMULTITEXCOORD2IPROC>(get_proc_address("glMultiTexCoord2i"));
- glMultiTexCoord2iv=reinterpret_cast<PFNGLMULTITEXCOORD2IVPROC>(get_proc_address("glMultiTexCoord2iv"));
- glMultiTexCoord2s=reinterpret_cast<PFNGLMULTITEXCOORD2SPROC>(get_proc_address("glMultiTexCoord2s"));
- glMultiTexCoord2sv=reinterpret_cast<PFNGLMULTITEXCOORD2SVPROC>(get_proc_address("glMultiTexCoord2sv"));
- glMultiTexCoord3d=reinterpret_cast<PFNGLMULTITEXCOORD3DPROC>(get_proc_address("glMultiTexCoord3d"));
- glMultiTexCoord3dv=reinterpret_cast<PFNGLMULTITEXCOORD3DVPROC>(get_proc_address("glMultiTexCoord3dv"));
- glMultiTexCoord3f=reinterpret_cast<PFNGLMULTITEXCOORD3FPROC>(get_proc_address("glMultiTexCoord3f"));
- glMultiTexCoord3fv=reinterpret_cast<PFNGLMULTITEXCOORD3FVPROC>(get_proc_address("glMultiTexCoord3fv"));
- glMultiTexCoord3i=reinterpret_cast<PFNGLMULTITEXCOORD3IPROC>(get_proc_address("glMultiTexCoord3i"));
- glMultiTexCoord3iv=reinterpret_cast<PFNGLMULTITEXCOORD3IVPROC>(get_proc_address("glMultiTexCoord3iv"));
- glMultiTexCoord3s=reinterpret_cast<PFNGLMULTITEXCOORD3SPROC>(get_proc_address("glMultiTexCoord3s"));
- glMultiTexCoord3sv=reinterpret_cast<PFNGLMULTITEXCOORD3SVPROC>(get_proc_address("glMultiTexCoord3sv"));
- glMultiTexCoord4d=reinterpret_cast<PFNGLMULTITEXCOORD4DPROC>(get_proc_address("glMultiTexCoord4d"));
- glMultiTexCoord4dv=reinterpret_cast<PFNGLMULTITEXCOORD4DVPROC>(get_proc_address("glMultiTexCoord4dv"));
- glMultiTexCoord4f=reinterpret_cast<PFNGLMULTITEXCOORD4FPROC>(get_proc_address("glMultiTexCoord4f"));
- glMultiTexCoord4fv=reinterpret_cast<PFNGLMULTITEXCOORD4FVPROC>(get_proc_address("glMultiTexCoord4fv"));
- glMultiTexCoord4i=reinterpret_cast<PFNGLMULTITEXCOORD4IPROC>(get_proc_address("glMultiTexCoord4i"));
- glMultiTexCoord4iv=reinterpret_cast<PFNGLMULTITEXCOORD4IVPROC>(get_proc_address("glMultiTexCoord4iv"));
- glMultiTexCoord4s=reinterpret_cast<PFNGLMULTITEXCOORD4SPROC>(get_proc_address("glMultiTexCoord4s"));
- glMultiTexCoord4sv=reinterpret_cast<PFNGLMULTITEXCOORD4SVPROC>(get_proc_address("glMultiTexCoord4sv"));
- glLoadTransposeMatrixf=reinterpret_cast<PFNGLLOADTRANSPOSEMATRIXFPROC>(get_proc_address("glLoadTransposeMatrixf"));
- glLoadTransposeMatrixd=reinterpret_cast<PFNGLLOADTRANSPOSEMATRIXDPROC>(get_proc_address("glLoadTransposeMatrixd"));
- glMultTransposeMatrixf=reinterpret_cast<PFNGLMULTTRANSPOSEMATRIXFPROC>(get_proc_address("glMultTransposeMatrixf"));
- glMultTransposeMatrixd=reinterpret_cast<PFNGLMULTTRANSPOSEMATRIXDPROC>(get_proc_address("glMultTransposeMatrixd"));
- glSampleCoverage=reinterpret_cast<PFNGLSAMPLECOVERAGEPROC>(get_proc_address("glSampleCoverage"));
- glCompressedTexImage3D=reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE3DPROC>(get_proc_address("glCompressedTexImage3D"));
- glCompressedTexImage2D=reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE2DPROC>(get_proc_address("glCompressedTexImage2D"));
- glCompressedTexImage1D=reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE1DPROC>(get_proc_address("glCompressedTexImage1D"));
- glCompressedTexSubImage3D=reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC>(get_proc_address("glCompressedTexSubImage3D"));
- glCompressedTexSubImage2D=reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC>(get_proc_address("glCompressedTexSubImage2D"));
- glCompressedTexSubImage1D=reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC>(get_proc_address("glCompressedTexSubImage1D"));
- glGetCompressedTexImage=reinterpret_cast<PFNGLGETCOMPRESSEDTEXIMAGEPROC>(get_proc_address("glGetCompressedTexImage"));
+ glActiveTexture = reinterpret_cast<PFNGLACTIVETEXTUREPROC>(get_proc_address("glActiveTexture"));
+ glClientActiveTexture = reinterpret_cast<PFNGLCLIENTACTIVETEXTUREPROC>(get_proc_address("glClientActiveTexture"));
+ glMultiTexCoord1d = reinterpret_cast<PFNGLMULTITEXCOORD1DPROC>(get_proc_address("glMultiTexCoord1d"));
+ glMultiTexCoord1dv = reinterpret_cast<PFNGLMULTITEXCOORD1DVPROC>(get_proc_address("glMultiTexCoord1dv"));
+ glMultiTexCoord1f = reinterpret_cast<PFNGLMULTITEXCOORD1FPROC>(get_proc_address("glMultiTexCoord1f"));
+ glMultiTexCoord1fv = reinterpret_cast<PFNGLMULTITEXCOORD1FVPROC>(get_proc_address("glMultiTexCoord1fv"));
+ glMultiTexCoord1i = reinterpret_cast<PFNGLMULTITEXCOORD1IPROC>(get_proc_address("glMultiTexCoord1i"));
+ glMultiTexCoord1iv = reinterpret_cast<PFNGLMULTITEXCOORD1IVPROC>(get_proc_address("glMultiTexCoord1iv"));
+ glMultiTexCoord1s = reinterpret_cast<PFNGLMULTITEXCOORD1SPROC>(get_proc_address("glMultiTexCoord1s"));
+ glMultiTexCoord1sv = reinterpret_cast<PFNGLMULTITEXCOORD1SVPROC>(get_proc_address("glMultiTexCoord1sv"));
+ glMultiTexCoord2d = reinterpret_cast<PFNGLMULTITEXCOORD2DPROC>(get_proc_address("glMultiTexCoord2d"));
+ glMultiTexCoord2dv = reinterpret_cast<PFNGLMULTITEXCOORD2DVPROC>(get_proc_address("glMultiTexCoord2dv"));
+ glMultiTexCoord2f = reinterpret_cast<PFNGLMULTITEXCOORD2FPROC>(get_proc_address("glMultiTexCoord2f"));
+ glMultiTexCoord2fv = reinterpret_cast<PFNGLMULTITEXCOORD2FVPROC>(get_proc_address("glMultiTexCoord2fv"));
+ glMultiTexCoord2i = reinterpret_cast<PFNGLMULTITEXCOORD2IPROC>(get_proc_address("glMultiTexCoord2i"));
+ glMultiTexCoord2iv = reinterpret_cast<PFNGLMULTITEXCOORD2IVPROC>(get_proc_address("glMultiTexCoord2iv"));
+ glMultiTexCoord2s = reinterpret_cast<PFNGLMULTITEXCOORD2SPROC>(get_proc_address("glMultiTexCoord2s"));
+ glMultiTexCoord2sv = reinterpret_cast<PFNGLMULTITEXCOORD2SVPROC>(get_proc_address("glMultiTexCoord2sv"));
+ glMultiTexCoord3d = reinterpret_cast<PFNGLMULTITEXCOORD3DPROC>(get_proc_address("glMultiTexCoord3d"));
+ glMultiTexCoord3dv = reinterpret_cast<PFNGLMULTITEXCOORD3DVPROC>(get_proc_address("glMultiTexCoord3dv"));
+ glMultiTexCoord3f = reinterpret_cast<PFNGLMULTITEXCOORD3FPROC>(get_proc_address("glMultiTexCoord3f"));
+ glMultiTexCoord3fv = reinterpret_cast<PFNGLMULTITEXCOORD3FVPROC>(get_proc_address("glMultiTexCoord3fv"));
+ glMultiTexCoord3i = reinterpret_cast<PFNGLMULTITEXCOORD3IPROC>(get_proc_address("glMultiTexCoord3i"));
+ glMultiTexCoord3iv = reinterpret_cast<PFNGLMULTITEXCOORD3IVPROC>(get_proc_address("glMultiTexCoord3iv"));
+ glMultiTexCoord3s = reinterpret_cast<PFNGLMULTITEXCOORD3SPROC>(get_proc_address("glMultiTexCoord3s"));
+ glMultiTexCoord3sv = reinterpret_cast<PFNGLMULTITEXCOORD3SVPROC>(get_proc_address("glMultiTexCoord3sv"));
+ glMultiTexCoord4d = reinterpret_cast<PFNGLMULTITEXCOORD4DPROC>(get_proc_address("glMultiTexCoord4d"));
+ glMultiTexCoord4dv = reinterpret_cast<PFNGLMULTITEXCOORD4DVPROC>(get_proc_address("glMultiTexCoord4dv"));
+ glMultiTexCoord4f = reinterpret_cast<PFNGLMULTITEXCOORD4FPROC>(get_proc_address("glMultiTexCoord4f"));
+ glMultiTexCoord4fv = reinterpret_cast<PFNGLMULTITEXCOORD4FVPROC>(get_proc_address("glMultiTexCoord4fv"));
+ glMultiTexCoord4i = reinterpret_cast<PFNGLMULTITEXCOORD4IPROC>(get_proc_address("glMultiTexCoord4i"));
+ glMultiTexCoord4iv = reinterpret_cast<PFNGLMULTITEXCOORD4IVPROC>(get_proc_address("glMultiTexCoord4iv"));
+ glMultiTexCoord4s = reinterpret_cast<PFNGLMULTITEXCOORD4SPROC>(get_proc_address("glMultiTexCoord4s"));
+ glMultiTexCoord4sv = reinterpret_cast<PFNGLMULTITEXCOORD4SVPROC>(get_proc_address("glMultiTexCoord4sv"));
+ glLoadTransposeMatrixf = reinterpret_cast<PFNGLLOADTRANSPOSEMATRIXFPROC>(get_proc_address("glLoadTransposeMatrixf"));
+ glLoadTransposeMatrixd = reinterpret_cast<PFNGLLOADTRANSPOSEMATRIXDPROC>(get_proc_address("glLoadTransposeMatrixd"));
+ glMultTransposeMatrixf = reinterpret_cast<PFNGLMULTTRANSPOSEMATRIXFPROC>(get_proc_address("glMultTransposeMatrixf"));
+ glMultTransposeMatrixd = reinterpret_cast<PFNGLMULTTRANSPOSEMATRIXDPROC>(get_proc_address("glMultTransposeMatrixd"));
+ glSampleCoverage = reinterpret_cast<PFNGLSAMPLECOVERAGEPROC>(get_proc_address("glSampleCoverage"));
+ glCompressedTexImage3D = reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE3DPROC>(get_proc_address("glCompressedTexImage3D"));
+ glCompressedTexImage2D = reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE2DPROC>(get_proc_address("glCompressedTexImage2D"));
+ glCompressedTexImage1D = reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE1DPROC>(get_proc_address("glCompressedTexImage1D"));
+ glCompressedTexSubImage3D = reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC>(get_proc_address("glCompressedTexSubImage3D"));
+ glCompressedTexSubImage2D = reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC>(get_proc_address("glCompressedTexSubImage2D"));
+ glCompressedTexSubImage1D = reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC>(get_proc_address("glCompressedTexSubImage1D"));
+ glGetCompressedTexImage = reinterpret_cast<PFNGLGETCOMPRESSEDTEXIMAGEPROC>(get_proc_address("glGetCompressedTexImage"));
}
} // namespace GL
if(vbuf && own_vbuf)
return;
- vbuf=new Buffer(ARRAY_BUFFER);
- own_vbuf=true;
+ vbuf = new Buffer(ARRAY_BUFFER);
+ own_vbuf = true;
update_data();
}
{
if(own_vbuf)
delete vbuf;
- vbuf=b;
- own_vbuf=false;
+ vbuf = b;
+ own_vbuf = false;
update_data();
}
void VertexArray::reset(const VertexFormat &f)
{
clear();
- format=f;
- stride=get_stride(format);
+ format = f;
+ stride = get_stride(format);
- bool has_gen_attrs=false;
+ bool has_gen_attrs = false;
for(const unsigned char *c=format.begin(); (!has_gen_attrs && c!=format.end()); ++c)
- has_gen_attrs=(*c>=ATTRIB1);
+ has_gen_attrs = (*c>=ATTRIB1);
if(has_gen_attrs)
static RequireExtension _ext("GL_ARB_vertex_program");
}
if(vbuf)
vbuf->bind();
- const float *base=vbuf?0:&data[0];
- unsigned offset=0;
- unsigned found=0;
- unsigned bpv=stride*sizeof(float);
+ const float *base = vbuf?0:&data[0];
+ unsigned offset = 0;
+ unsigned found = 0;
+ unsigned bpv = stride*sizeof(float);
for(const unsigned char *c=format.begin(); c!=format.end(); ++c)
{
- unsigned sz=(*c&3)+1;
- unsigned t=*c>>2;
+ unsigned sz = (*c&3)+1;
+ unsigned t = *c>>2;
switch(t)
{
case 0:
glVertexAttribPointerARB(t-4, sz, GL_FLOAT, false, bpv, base+offset);
break;
}
- found|=1<<t;
- offset+=sz;
+ found |= 1<<t;
+ offset += sz;
}
set_array(GL_VERTEX_ARRAY, found&1, 1);
glDisableClientState(array);
else
glDisableVertexAttribArrayARB(array);
- enabled_arrays&=~mask;
+ enabled_arrays &= ~mask;
}
else if(!(enabled_arrays&mask) && en)
{
glEnableClientState(array);
else
glEnableVertexAttribArrayARB(array);
- enabled_arrays|=mask;
+ enabled_arrays |= mask;
}
}
-unsigned VertexArray::enabled_arrays=0;
+unsigned VertexArray::enabled_arrays = 0;
VertexArray::Loader::Loader(VertexArray &a):
void VertexArrayBuilder::vertex_(float x, float y, float z, float w)
{
- float *ptr=array.append();
+ float *ptr = array.append();
for(const unsigned char *c=array.get_format().begin(); c!=array.get_format().end(); ++c)
{
- unsigned size=(*c&3)+1;
- unsigned type=*c>>2;
+ unsigned size = (*c&3)+1;
+ unsigned type = *c>>2;
switch(type)
{
case 0:
- *ptr++=x;
- *ptr++=y;
- if(size>=3) *ptr++=z;
- if(size>=4) *ptr++=w;
+ *ptr+ += x;
+ *ptr+ += y;
+ if(size>=3) *ptr+ += z;
+ if(size>=4) *ptr+ += w;
break;
case 1:
- *ptr++=nx;
- *ptr++=ny;
- *ptr++=nz;
+ *ptr+ += nx;
+ *ptr+ += ny;
+ *ptr+ += nz;
break;
case 2:
- *ptr++=ts;
- if(size>=2) *ptr++=tt;
- if(size>=3) *ptr++=tr;
- if(size>=4) *ptr++=tq;
+ *ptr+ += ts;
+ if(size>=2) *ptr+ += tt;
+ if(size>=3) *ptr+ += tr;
+ if(size>=4) *ptr+ += tq;
break;
case 3:
if(size==1)
{
union { unsigned char c[4]; float f; } u;
- u.c[0]=static_cast<unsigned char>(cr*255);
- u.c[1]=static_cast<unsigned char>(cg*255);
- u.c[2]=static_cast<unsigned char>(cb*255);
- u.c[3]=static_cast<unsigned char>(ca*255);
- *ptr++=u.f;
+ u.c[0] = static_cast<unsigned char>(cr*255);
+ u.c[1] = static_cast<unsigned char>(cg*255);
+ u.c[2] = static_cast<unsigned char>(cb*255);
+ u.c[3] = static_cast<unsigned char>(ca*255);
+ *ptr+ += u.f;
}
else
{
- *ptr++=cr;
- *ptr++=cg;
- *ptr++=cb;
- if(size>=4) *+ptr++=ca;
+ *ptr+ += cr;
+ *ptr+ += cg;
+ *ptr+ += cb;
+ if(size>=4) *+ptr+ += ca;
}
break;
default:
- const Attrib &a=av[type-4];
- *ptr++=a.x;
- if(size>=2) *ptr++=a.y;
- if(size>=3) *ptr++=a.z;
- if(size>=4) *ptr++=a.w;
+ const Attrib &a = av[type-4];
+ *ptr+ += a.x;
+ if(size>=2) *ptr+ += a.y;
+ if(size>=3) *ptr+ += a.z;
+ if(size>=4) *ptr+ += a.w;
break;
}
}
void VertexBuilder::attrib(unsigned i, float x, float y, float z, float w)
{
- Attrib &a=av[i];
- a.x=x;
- a.y=y;
- a.z=z;
- a.w=w;
+ Attrib &a = av[i];
+ a.x = x;
+ a.y = y;
+ a.z = z;
+ a.w = w;
}
} // namespace GL
void vertex(float x, float y) { vertex(x, y, 0, 1); }
void vertex(float x, float y, float z) { vertex(x, y, z, 1); }
void vertex(float x, float y, float z, float w) { vertex_(x, y, z, w); }
- void normal(float x, float y, float z) { nx=x; ny=y; nz=z; }
+ void normal(float x, float y, float z) { nx = x; ny = y; nz = z; }
void texcoord(float s) { texcoord(s, 0, 0, 1); }
void texcoord(float s, float t) { texcoord(s, t, 0, 1); }
void texcoord(float s, float t, float r) { texcoord(s, t, r, 1); }
- void texcoord(float s, float t, float r, float q) { ts=s; tt=t; tr=r; tq=q; }
+ void texcoord(float s, float t, float r, float q) { ts = s; tt = t; tr = r; tq = q; }
void color(unsigned char r, unsigned char g, unsigned char b) { color(r, g, b, 255); }
void color(unsigned char r, unsigned char g, unsigned char b, unsigned char a) { color(r/255.f, g/255.f, b/255.f, a/255.f); }
void color(float r, float g, float b) { color(r, g, b, 1); }
- void color(float r, float g, float b, float a) { cr=r; cg=g; cb=b; ca=a; }
+ void color(float r, float g, float b, float a) { cr = r; cg = g; cb = b; ca = a; }
void attrib(unsigned i, float x) { attrib(i, x, 0, 0, 1); }
void attrib(unsigned i, float x, float y) { attrib(i, x, y, 0, 1); }
void attrib(unsigned i, float x, float y, float z) { attrib(i, x, y, z, 1); }
VertexFormat::VertexFormat(VertexComponent c):
data(new unsigned char[8])
{
- data[0]=1;
- data[1]=c;
+ data[0] = 1;
+ data[1] = c;
}
VertexFormat::VertexFormat(const VertexFormat &f):
{
if(f.data)
{
- data=new unsigned char[f.data[0]/8+8];
+ data = new unsigned char[f.data[0]/8+8];
memcpy(data, f.data, f.data[0]+1);
}
}
delete[] data;
if(f.data)
{
- data=new unsigned char[f.data[0]/8+8];
+ data = new unsigned char[f.data[0]/8+8];
memcpy(data, f.data, f.data[0]+1);
}
else
- data=0;
+ data = 0;
return *this;
}
unsigned VertexFormat::stride() const
{
- unsigned s=0;
+ unsigned s = 0;
for(const unsigned char *i=begin(); i!=end(); ++i)
- s+=(*i&3)+1;
+ s += (*i&3)+1;
return s;
}
VertexFormat operator,(const VertexFormat &f, VertexComponent c)
{
- VertexFormat r=f;
+ VertexFormat r = f;
if(r.data)
{
- const unsigned char n=++r.data[0];
+ const unsigned char n = ++r.data[0];
if((n&7)==7)
{
- unsigned char *newdt=new unsigned char[n+9];
+ unsigned char *newdt = new unsigned char[n+9];
memcpy(newdt, r.data, n);
delete r.data;
- r.data=newdt;
+ r.data = newdt;
}
- r.data[n]=c;
+ r.data[n] = c;
}
else
{
- r.data=new unsigned char[8];
- r.data[0]=1;
- r.data[1]=c;
+ r.data = new unsigned char[8];
+ r.data[0] = 1;
+ r.data[1] = c;
}
return r;
{
if(!f.data)
throw InvalidState("VertexFormat has no components");
- VertexFormat r=f;
- unsigned char *c=r.data+r.data[0];
+ VertexFormat r = f;
+ unsigned char *c = r.data+r.data[0];
if(*c<ATTRIB1)
throw InvalidState("Last component is not a generic attribute");
// VertexArray uses an unsigned to store flags for enabled arrays
if(i>=28)
throw InvalidParameterValue("Generic attribute index out of range");
- *c+=i*4;
+ *c += i*4;
return r;
}
string str;
in>>str;
- unsigned start=0;
+ unsigned start = 0;
while(1)
{
- string::size_type underscore=str.find('_', start);
- bool fail=false;
+ string::size_type underscore = str.find('_', start);
+ bool fail = false;
if(!str.compare(start, underscore-start, "VERTEX2"))
- f=(f,VERTEX2);
+ f = (f,VERTEX2);
else if(!str.compare(start, underscore-start, "VERTEX3"))
- f=(f,VERTEX3);
+ f = (f,VERTEX3);
else if(!str.compare(start, underscore-start, "VERTEX4"))
- f=(f,VERTEX4);
+ f = (f,VERTEX4);
else if(!str.compare(start, underscore-start, "NORMAL3"))
- f=(f,NORMAL3);
+ f = (f,NORMAL3);
else if(!str.compare(start, underscore-start, "TEXCOORD1"))
- f=(f,TEXCOORD1);
+ f = (f,TEXCOORD1);
else if(!str.compare(start, underscore-start, "TEXCOORD2"))
- f=(f,TEXCOORD2);
+ f = (f,TEXCOORD2);
else if(!str.compare(start, underscore-start, "TEXCOORD3"))
- f=(f,TEXCOORD3);
+ f = (f,TEXCOORD3);
else if(!str.compare(start, underscore-start, "TEXCOORD4"))
- f=(f,TEXCOORD4);
+ f = (f,TEXCOORD4);
else if(!str.compare(start, underscore-start, "COLOR4UB"))
- f=(f,COLOR4_UBYTE);
+ f = (f,COLOR4_UBYTE);
else if(!str.compare(start, underscore-start, "COLOR3F"))
- f=(f,COLOR3_FLOAT);
+ f = (f,COLOR3_FLOAT);
else if(!str.compare(start, underscore-start, "COLOR4F"))
- f=(f,COLOR4_FLOAT);
+ f = (f,COLOR4_FLOAT);
else if(underscore>=start+8 && !str.compare(start, 6, "ATTRIB"))
{
try
{
- char n=str[start+6];
- unsigned i=lexical_cast<unsigned>(str.substr(start+7, underscore-start-7));
+ char n = str[start+6];
+ unsigned i = lexical_cast<unsigned>(str.substr(start+7, underscore-start-7));
if(n=='1')
- f=(f,ATTRIB1,i);
+ f = (f,ATTRIB1,i);
else if(n=='2')
- f=(f,ATTRIB2,i);
+ f = (f,ATTRIB2,i);
else if(n=='3')
- f=(f,ATTRIB3,i);
+ f = (f,ATTRIB3,i);
else if(n=='4')
- f=(f,ATTRIB4,i);
+ f = (f,ATTRIB4,i);
else
- fail=true;
+ fail = true;
}
catch(const LexicalError &)
{
- fail=true;
+ fail = true;
}
}
else
- fail=true;
+ fail = true;
if(fail)
{
if(underscore==string::npos)
break;
- start=underscore+1;
+ start = underscore+1;
}
return in;
enum VertexComponent
{
- VERTEX2=1,
+ VERTEX2 = 1,
VERTEX3,
VERTEX4,
- NORMAL3=6,
- TEXCOORD1=8,
+ NORMAL3 = 6,
+ TEXCOORD1 = 8,
TEXCOORD2,
TEXCOORD3,
TEXCOORD4,
- COLOR4_UBYTE=12,
- COLOR3_FLOAT=14,
+ COLOR4_UBYTE = 12,
+ COLOR3_FLOAT = 14,
COLOR4_FLOAT,
- ATTRIB1=16,
+ ATTRIB1 = 16,
ATTRIB2,
ATTRIB3,
ATTRIB4