]> git.tdb.fi Git - libs/gl.git/commitdiff
Style update: add spaces around assignment operators
authorMikko Rasa <tdb@tdb.fi>
Sun, 6 Jun 2010 07:02:45 +0000 (07:02 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 6 Jun 2010 07:02:45 +0000 (07:02 +0000)
56 files changed:
source/arb_shader_objects.cpp
source/arb_vertex_buffer_object.cpp
source/arb_vertex_program.cpp
source/arb_vertex_shader.cpp
source/batch.cpp
source/bindable.h
source/bloom.cpp
source/buffer.cpp
source/clip.cpp
source/ext_framebuffer_object.cpp
source/extension.cpp
source/font.cpp
source/framebuffer.cpp
source/light.cpp
source/lighting.cpp
source/material.cpp
source/matrix.h
source/mesh.cpp
source/meshbuilder.cpp
source/object.cpp
source/object.h
source/objectinstance.h
source/pipeline.cpp
source/pipeline.h
source/pixelformat.cpp
source/primitivebuilder.cpp
source/primitivetype.cpp
source/program.cpp
source/programdata.cpp
source/projection.cpp
source/renderable.h
source/renderbuffer.cpp
source/rendermode.cpp
source/renderpass.cpp
source/scene.cpp
source/scene.h
source/select.cpp
source/shader.cpp
source/shadowmap.cpp
source/tag.cpp
source/technique.cpp
source/texenv.cpp
source/texture.cpp
source/texture2d.cpp
source/texture3d.cpp
source/texture3d.h
source/texunit.cpp
source/uniform.cpp
source/version_1_2.cpp
source/version_1_3.cpp
source/vertexarray.cpp
source/vertexarraybuilder.cpp
source/vertexbuilder.cpp
source/vertexbuilder.h
source/vertexformat.cpp
source/vertexformat.h

index 392538102682016febc1274208bcb93d6d43945c..18ea54829897a59994de32fbf3883d4f3b3a70da 100644 (file)
@@ -4,87 +4,87 @@
 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
index 6e98fef0d0c6ae0be4ba8fa464b0c0fee37bc64b..66ef40e5d952d9845147091ec4da51a6e1ce3fff 100644 (file)
@@ -4,31 +4,31 @@
 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
index c68da2b9cc29cfb51d90c080bb655511e55e5234..41adaee60e86467e7cef06c029562530a523c3ba 100644 (file)
 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
index 9c9dc3d74b8ce3d5ba38a1624324e1bdcc7efad9..612c5033fe0fe2fd50c4ecc00ef1b77b705cad67 100644 (file)
@@ -4,15 +4,15 @@
 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
index 9ed20a1f524dc5d334c2825a8867f77cc8ea31f5..86ad9435fd29b2072581a73d72df9ab5c10c98ea 100644 (file)
@@ -23,11 +23,11 @@ Batch::Batch(PrimitiveType t):
 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);
 
index cd012fbbcef3d50b984a6dafbace86f49ce7f433..e26840fa3950e977b309beeeeeca96bb3ee33e6e 100644 (file)
@@ -24,7 +24,7 @@ protected:
                if(obj==cur_obj)
                        return false;
 
-               cur_obj=obj;
+               cur_obj = obj;
                return true;
        }
 
index b74bde80f970dd16f597452963a3863b7e2e50d3..5f2adc85c2bf592a8379d58ee9d3efc228fe055a 100644 (file)
@@ -22,8 +22,8 @@ static const char blur_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 blur_fs[]=
@@ -34,17 +34,17 @@ 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[]=
@@ -54,7 +54,7 @@ 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"
        "}";
 
 }
@@ -67,11 +67,11 @@ Bloom::Bloom(unsigned w, unsigned h):
        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);
@@ -100,21 +100,21 @@ void Bloom::set_radius(float r)
        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);
        }
@@ -129,7 +129,7 @@ void Bloom::set_strength(float s)
 
 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);
index b4b71c3a0130efadcaea894f0fd921b9e833629b..17ae494f72dc37a0892fdf282af33665d8723c49 100644 (file)
@@ -31,7 +31,7 @@ Buffer::~Buffer()
 void Buffer::bind(BufferType t) const
 {
        glBindBufferARB(t, id);
-       binding(t)=this;
+       binding(t) = this;
 }
 
 void Buffer::maybe_bind() const
@@ -42,7 +42,7 @@ void Buffer::maybe_bind() const
 
 void Buffer::set_usage(BufferUsage u)
 {
-       usage=u;
+       usage = u;
 }
 
 void Buffer::data(unsigned size, const void *d)
@@ -59,11 +59,11 @@ void Buffer::sub_data(unsigned offset, 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;
        }
 }
 
@@ -79,7 +79,7 @@ const Buffer *&Buffer::binding(BufferType type)
        }
 }
 
-const Buffer *Buffer::bound[4]={ 0, 0, 0, 0 };
+const Buffer *Buffer::bound[4] = { 0, 0, 0, 0 };
 
 } // namespace GL
 } // namespace Msp
index ca1b7420b00565f5040f6a57c1bbb0e1a904845f..96f5bd413bd1bc203decc2e35a35140122e88e7a 100644 (file)
@@ -13,10 +13,10 @@ namespace GL {
 
 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)
index 80da8283befc5561928e8d0262bedffff13b2b1e..ab5048d6bb8fe2521a890484988ef049591726d7 100644 (file)
@@ -4,43 +4,43 @@
 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
index 6b00ceb6cf8174edbc4ddee06d0df82071ab3d89..9ed1777914b9076c89f8c55ba58f0a6012ca54db 100644 (file)
@@ -31,13 +31,13 @@ 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());
                }
 
@@ -54,7 +54,7 @@ bool is_supported(const string &ext)
                if(extensions.count("GL_ARB_vertex_buffer_object"))
                        init_arb_vertex_buffer_object();
 
-               init_done=true;
+               init_done = true;
        }
 
        return extensions.count(ext);
@@ -63,16 +63,16 @@ bool is_supported(const string &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)
@@ -92,7 +92,7 @@ void require_extension(const string &ext)
 
 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));
 }
index 8320374e5070ec5580dc5c6e74ddda3de5f1468c..44e3d241154b0e4acd8ccdd8e747091ea776f9ef 100644 (file)
@@ -36,8 +36,8 @@ void Font::set_texture(const Texture2D &t)
        if(own_tex)
                delete tex;
 
-       tex=&t;
-       own_tex=false;
+       tex = &t;
+       own_tex = false;
 }
 
 const Texture2D &Font::get_texture() const
@@ -50,25 +50,25 @@ 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;
 }
@@ -86,19 +86,19 @@ void Font::draw_string(const string &str, Codecs::Decoder &dec, PrimitiveBuilder
 
        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();
 }
@@ -117,7 +117,7 @@ void Font::create_glyph_vertices(const Glyph &glyph, VertexBuilder &vbuilder, fl
 
 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;
 
@@ -150,17 +150,17 @@ void Font::Loader::init()
 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;
 }
 
 
@@ -175,10 +175,10 @@ Font::Glyph::Loader::Loader(Glyph &g):
 
 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
index 229c7f0a094c01ce64bfc43563a62882b6606164..6941c0342d7963208324df4c39c19812442aa6b1 100644 (file)
@@ -37,7 +37,7 @@ void Framebuffer::bind() const
        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);
 }
@@ -46,7 +46,7 @@ void Framebuffer::attach(FramebufferAttachment attch, Renderbuffer &rbuf)
 {
        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();
 }
 
@@ -54,7 +54,7 @@ void Framebuffer::attach(FramebufferAttachment attch, Texture2D &tex, int level)
 {
        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();
 }
 
@@ -90,7 +90,7 @@ void Framebuffer::unbind()
        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]);
        }
 }
@@ -114,25 +114,25 @@ void Framebuffer::check_size()
 {
        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):
@@ -142,15 +142,15 @@ 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;
 }
 
index b523fe365124e9c8f52cba0bd4c9edbbaa8e2f07..26cc896358d46f4a7de30cd0bd40e4d811f27ad8 100644 (file)
@@ -23,58 +23,58 @@ Light::Light():
        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);
@@ -86,7 +86,7 @@ void Light::bind() const
                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;
        }
 }
 
@@ -98,7 +98,7 @@ void Light::bind_to(unsigned i) const
 
 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");
@@ -106,7 +106,7 @@ void Light::activate(unsigned i)
        if(i>=current_lights.size())
                current_lights.resize(i+1);
 
-       current_unit=i;
+       current_unit = i;
 }
 
 void Light::unbind()
@@ -114,11 +114,11 @@ 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
index 6b6af57cc1f84a337acc227a5165265f41b79bf8..0d6e7dc4ab6e5da6a1521677a9a8689398ed6ca5 100644 (file)
@@ -18,7 +18,7 @@ Lighting::Lighting():
 
 void Lighting::set_ambient(const Color &a)
 {
-       ambient=a;
+       ambient = a;
 }
 
 void Lighting::attach(unsigned i, const Light &l)
@@ -26,7 +26,7 @@ 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)
@@ -34,7 +34,7 @@ void Lighting::detach(unsigned i)
        if(i>=lights.size())
                return;
 
-       lights[i]=0;
+       lights[i] = 0;
 }
 
 void Lighting::bind() const
@@ -46,7 +46,7 @@ void Lighting::bind() const
                for(unsigned i=0; i<lights.size(); ++i)
                        if(lights[i])
                                lights[i]->bind_to(i);
-               current=this;
+               current = this;
        }
 }
 
@@ -61,11 +61,11 @@ void Lighting::unbind()
                                Light::unbind();
                        }
                disable(LIGHTING);
-               current=0;
+               current = 0;
        }
 }
 
-const Lighting *Lighting::current=0;
+const Lighting *Lighting::current = 0;
 
 } // namespace GL
 } // namespace Msp
index b5ec6a5cd913209940acdd68558f1dc072fda8aa..eee1ebc6152057d8799db1a118fa3dcda2bfcd2c 100644 (file)
@@ -21,27 +21,27 @@ Material::Material():
 
 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
@@ -53,16 +53,16 @@ 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):
@@ -77,22 +77,22 @@ 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
index 79d330a30ca99e3c34348eca271c56f7d7be3404..b574c7359506bf05e9cecc46fd9f4593f721bab2 100644 (file)
@@ -15,9 +15,9 @@ 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);
index 2ca040e6feb68e3eb65239a4c05e4eadfd997053..d421769abc257a775d53a4b0c73909cd92c36abb 100644 (file)
@@ -29,14 +29,14 @@ void Mesh::use_vertex_buffer(bool b)
        {
                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;
        }
 }
 
@@ -63,11 +63,11 @@ void Mesh::draw() const
        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();
        }
@@ -83,16 +83,16 @@ void Mesh::update_index_buffer()
        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();
 }
index 025bced159fc999c748e244efdb1a87df12fd3f3..b238ae63b9a76a608d968bb5b36e44af0cf62445 100644 (file)
@@ -19,14 +19,14 @@ MeshBuilder::MeshBuilder(Mesh &m):
 
 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)
index 2423fcdab3fa353c47639484953e07cef1a68a5f..938e83f911211cd75b2e50302b6ad00d67345005 100644 (file)
@@ -40,7 +40,7 @@ Object::~Object()
 
 void Object::render(const Tag &tag) const
 {
-       const RenderPass *pass=get_pass(tag);
+       const RenderPass *pass = get_pass(tag);
        if(!pass)
                return;
 
@@ -50,7 +50,7 @@ void Object::render(const Tag &tag) const
 
 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;
 
@@ -69,7 +69,7 @@ const RenderPass *Object::get_pass(const Tag &tag) const
 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);
 }
@@ -89,7 +89,7 @@ Object::Loader::Loader(Object &o, Collection &c):
 
 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));
@@ -101,7 +101,7 @@ void Object::Loader::init()
 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()
@@ -109,10 +109,10 @@ 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)
@@ -120,18 +120,18 @@ 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
index 0b53d63c6cb6871a58735668fcfca29418caa87f..bff41bf108e3f153fb6383f8fd09eb8dc91ec3bc 100644 (file)
@@ -60,14 +60,14 @@ public:
        /**
        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
@@ -76,9 +76,9 @@ public:
        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;
 
index 602cbc24d80a50989a4faee48db6e0319bda9cdc..61ad55d33ef722400780db5540b63f410eb4133b 100644 (file)
@@ -35,7 +35,7 @@ public:
 
        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.
index 97c452658153acb8c7561652ee22dcc0fc928961..54ef25a10bca8e59a123eb96322123e393595640 100644 (file)
@@ -49,14 +49,14 @@ PipelinePass &Pipeline::add_pass(const Tag &tag)
        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;
@@ -64,7 +64,7 @@ PipelinePass &Pipeline::get_pass(const Tag &tag)
 
 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;
@@ -85,14 +85,14 @@ void Pipeline::add_postprocessor(PostProcessor &pp)
        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();
@@ -101,7 +101,7 @@ void Pipeline::add_postprocessor(PostProcessor &pp)
 
 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);
index 592c3caebebccd7d986250a8c5cc4f440880a9f6..5da9a7b32141035b891191c027ff146b108fd824 100644 (file)
@@ -54,7 +54,7 @@ public:
        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;
 };
 
index d968917b25956440bf0f8f096baffec4dcba7737..27a814e21e1c30b946c24cf2fad6287dc073a664 100644 (file)
@@ -19,31 +19,31 @@ istream &operator>>(istream &in, PixelFormat &fmt)
 
        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);
 
index 95faa3fb5f74aee13e63f392bda69e4871d700e5..e032a441c00603062e750eb9367c2025c4023e1c 100644 (file)
@@ -21,8 +21,8 @@ void PrimitiveBuilder::begin(PrimitiveType t)
        if(in_batch)
                throw InvalidState("begin() already called");
 
-       type=t;
-       in_batch=true;
+       type = t;
+       in_batch = true;
 
        begin_();
 }
@@ -32,7 +32,7 @@ void PrimitiveBuilder::end()
        if(!in_batch)
                throw InvalidState("end() called without begin()");
 
-       in_batch=false;
+       in_batch = false;
 
        end_();
 }
index c11a59f7fd1da1e067f50893e1a4a407756a9c29..0872f7760ae549b4ea7bdcc11779d7f27595e48b 100644 (file)
@@ -16,25 +16,25 @@ std::istream &operator>>(std::istream &in, PrimitiveType &pt)
        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);
 
index b3773a6359a8d576cea5664814c48e685dc6608d..ef1f4c8a63fc0696f363bf21e10b60cb8fe4b80f 100644 (file)
@@ -38,8 +38,8 @@ void Program::init()
 {
        static RequireExtension _ext("GL_ARB_shader_objects");
 
-       linked=false;
-       id=glCreateProgramObjectARB();
+       linked = false;
+       id = glCreateProgramObjectARB();
 }
 
 Program::~Program()
@@ -63,7 +63,7 @@ void Program::attach_shader(Shader &shader)
 
 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());
@@ -73,7 +73,7 @@ void Program::detach_shader(Shader &shader)
 
 void Program::set_del_shaders(bool ds)
 {
-       del_shaders=ds;
+       del_shaders = ds;
 }
 
 void Program::bind_attribute(unsigned index, const string &name)
@@ -89,7 +89,7 @@ void Program::link()
                        (*i)->compile();
 
        glLinkProgramARB(id);
-       if(!(linked=get_param(GL_LINK_STATUS)))
+       if(!(linked = get_param(GL_LINK_STATUS)))
                throw CompileError(get_info_log());
 }
 
@@ -102,7 +102,7 @@ int Program::get_param(GLenum param) const
 
 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);
@@ -114,7 +114,7 @@ void Program::bind() const
                throw InvalidState("Program is not linked");
 
        glUseProgramObjectARB(id);
-       cur_prog=this;
+       cur_prog = this;
 }
 
 int Program::get_uniform_location(const string &n) const
@@ -127,7 +127,7 @@ void Program::unbind()
        if(cur_prog)
        {
                glUseProgramObjectARB(0);
-               cur_prog=0;
+               cur_prog = 0;
        }
 }
 
@@ -137,7 +137,7 @@ void Program::maybe_bind()
                bind();
 }
 
-const Program *Program::cur_prog=0;
+const Program *Program::cur_prog = 0;
 
 
 Program::Loader::Loader(Program &p):
index cc75f28d16cab4bbb0ad8fed7d4819d073908adf..9ab0731d8164852352f12f38808e36a2f7aed37d 100644 (file)
@@ -24,7 +24,7 @@ ProgramData::ProgramData(const ProgramData &other):
        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()
@@ -41,14 +41,14 @@ void ProgramData::uniform(int index, Uniform *uni)
                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)
index 2c234525ce63e0240bdc891f6d56c29be0484dcd..2cc2833f18c23cc597d78b7aed541c1857cabba2 100644 (file)
@@ -44,7 +44,7 @@ void frustum_centered(double width, double height, double nearr, double farr)
 
 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);
 }
 
index 6e433d3e9eb5b489a99a99464f9b9d0983b4e253..44b3c257b9a79b825e466be5d9d467827c350b38 100644 (file)
@@ -21,7 +21,7 @@ protected:
 public:
        virtual ~Renderable() { }
 
-       virtual void render(const Tag &tag=Tag()) const =0;
+       virtual void render(const Tag &tag = Tag()) const =0;
 };
 
 } // namespace Msp
index 40d58cef95b7d83719749df22c9640d81a33fab5..31a623ea617a179500c1cc821ffc232134d2ce09 100644 (file)
@@ -33,8 +33,8 @@ void Renderbuffer::bind() const
 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);
 }
 
index e7efd0c38973c19b0f5ea5dec463c5fbf9dc4c5a..0c8cb0c461ad85c54655331675930df23eeb3031 100644 (file)
@@ -16,7 +16,7 @@ int render_mode(RenderMode rm)
        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);
index 06726086bffd9067c6c88332ca8db52c01efa12f..4aa41dba2d0136a1f164a843003fcd31f8a62463 100644 (file)
@@ -19,7 +19,7 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-const RenderPass *RenderPass::current=0;
+const RenderPass *RenderPass::current = 0;
 
 RenderPass::RenderPass():
        shprog(0),
@@ -45,7 +45,7 @@ RenderPass::~RenderPass()
 
 void RenderPass::set_material(const Material *mat)
 {
-       material=mat;
+       material = mat;
 }
 
 unsigned RenderPass::get_texture_index(const string &slot) const
@@ -59,7 +59,7 @@ 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
@@ -67,8 +67,8 @@ void RenderPass::bind() const
        if(this==current)
                return;
 
-       const RenderPass *old=current;
-       current=this;
+       const RenderPass *old = current;
+       current = this;
 
        if(shprog)
        {
@@ -106,7 +106,7 @@ void RenderPass::unbind()
                for(unsigned i=current->textures.size(); i--; )
                        GL::Texture::unbind_from(i);
 
-               current=0;
+               current = 0;
        }
 }
 
@@ -125,7 +125,7 @@ RenderPass::Loader::Loader(RenderPass &p, Collection &c):
 
 void RenderPass::Loader::init()
 {
-       allow_pointer_reload=false;
+       allow_pointer_reload = false;
 
        add("shader",   &RenderPass::shprog);
        add("material", &Loader::material);
@@ -139,11 +139,11 @@ void RenderPass::Loader::finish()
        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));
                }
        }
@@ -154,17 +154,17 @@ void RenderPass::Loader::material()
        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);
 }
@@ -174,7 +174,7 @@ void RenderPass::Loader::uniforms()
        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);
 }
 
index 28b794b035c5b3da61bf4cd9e92363607a5b771a..1e72d5dca36285f5664eb8151668fb107a5d0a0e 100644 (file)
@@ -14,7 +14,7 @@ namespace GL {
 
 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);
@@ -22,9 +22,9 @@ void Scene::add(const Renderable &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);
index 6a4be91d9f77a75a06017f572c5e214e13abb0cd..329099ea341f31479bbb5e7063c062b226bba49d 100644 (file)
@@ -32,7 +32,7 @@ public:
        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
index e905729d84229877e09ce0fb7b1ad69a0c3d0939..65ce6ce62433174088863b6e1af1e0711342a1be 100644 (file)
@@ -13,7 +13,7 @@ using namespace std;
 
 namespace {
 
-vector<Msp::GL::SelectRecord> *select_buf=0;
+vector<Msp::GL::SelectRecord> *select_buf = 0;
 vector<unsigned> select_buf_int;
 
 }
@@ -25,7 +25,7 @@ void select_buffer(vector<SelectRecord> &buf)
 {
        select_buf_int.resize(1024);
        glSelectBuffer(select_buf_int.size(), &select_buf_int[0]);
-       select_buf=&buf;
+       select_buf = &buf;
 }
 
 void init_names()
@@ -50,14 +50,14 @@ void load_name(unsigned n)
 
 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--)
index e32919bcf7cdd14c41552215fd266795d062bb93..5ff2eb3609bd33a6fe1b30ae00eecd145f209a1f 100644 (file)
@@ -30,14 +30,14 @@ Shader::Shader(ShaderType t, const string &src)
 
 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()
@@ -63,7 +63,7 @@ void Shader::source(const char *str, int len)
 void Shader::compile()
 {
        glCompileShaderARB(id);
-       if(!(compiled=get_param(GL_COMPILE_STATUS)))
+       if(!(compiled = get_param(GL_COMPILE_STATUS)))
                throw CompileError(get_info_log());
 }
 
@@ -76,7 +76,7 @@ int Shader::get_param(GLenum param) const
 
 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);
index 9dadb8fe16ee4991eda732ceb0219373d8267bfe..7a761e7ad2bf15c6e35a5576f645f2980ab441c7 100644 (file)
@@ -43,64 +43,64 @@ ShadowMap::ShadowMap(unsigned s, const Scene &c, const Light &l):
 
 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);
@@ -111,7 +111,7 @@ void ShadowMap::prepare()
                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");
@@ -127,10 +127,10 @@ void ShadowMap::prepare()
        }
 
        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);
index 76adf7d1b53ccd5e681686335132ff6b265f64b7..3586507a5f8ba17c35a560b55fdbfb6990290672 100644 (file)
@@ -12,9 +12,9 @@ namespace {
 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;
 }
 
index d913f4d1aa490b0264c8f94600c9ed93d571f55d..74505c8e0b15ce6d457cf08369592c2e8084bfa8 100644 (file)
@@ -27,7 +27,7 @@ bool Technique::has_pass(const GL::Tag &tag) const
 
 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;
@@ -54,7 +54,7 @@ void Technique::Loader::init()
 
 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);
 }
@@ -82,7 +82,7 @@ Technique::InheritLoader::InheritLoader(Technique &t, Collection &c):
 
 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
index 6e5cca7748f2f6b25fa8194f15af2543a7caaf0e..e6c06bcbbbcebbf2af37b25d9fe58ce02609e481 100644 (file)
@@ -17,12 +17,12 @@ TexEnv::TexEnv():
 
 void TexEnv::set_mode(TexEnvMode m)
 {
-       mode=m;
+       mode = m;
 }
 
 void TexEnv::set_color(const Color &c)
 {
-       color=c;
+       color = c;
 }
 
 void TexEnv::bind()
index e897ba92a138ab8282e013ce5bb74938bc74b734..40f18d45eff1f0c8d10d2363d8ea2a6123bbc650 100644 (file)
@@ -20,17 +20,17 @@ istream &operator>>(istream &in, TextureFilter &tf)
        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);
 
@@ -43,7 +43,7 @@ void Texture::bind() const
        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)
@@ -82,7 +82,7 @@ Texture::~Texture()
 
 void Texture::unbind()
 {
-       const Texture *cur=TexUnit::current().get_texture();
+       const Texture *cur = TexUnit::current().get_texture();
        if(!cur)
                return;
 
index 1c5a9d63212a7f8fd787186ca33902873d6ee1e0..197e04df63830269f92a04ed4279636319ef4344 100644 (file)
@@ -17,7 +17,7 @@ Texture2D::Texture2D():
        width(0),
        height(0)
 {
-       target=GL_TEXTURE_2D;
+       target = GL_TEXTURE_2D;
        bind();
 }
 
@@ -28,10 +28,10 @@ void Texture2D::storage(PixelFormat fmt, unsigned wd, unsigned ht, int brd)
        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)
@@ -64,9 +64,9 @@ void Texture2D::load_image(const string &fn)
 
 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)
@@ -94,7 +94,7 @@ void Texture2D::Loader::image_data(const string &data)
 
 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());
 }
 
index b34e20cd5d4f757ca9e663bcf3053b00799419b0..183bede5acf5d32389e8942fb9ceeb0c3c55153e 100644 (file)
@@ -24,7 +24,7 @@ Texture3D::Texture3D():
 {
        static RequireVersion _ver(1, 3);
 
-       target=GL_TEXTURE_3D;
+       target = GL_TEXTURE_3D;
        bind();
 }
 
@@ -35,11 +35,11 @@ void Texture3D::storage(PixelFormat f, unsigned w, unsigned h, unsigned d, int b
        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);
 }
@@ -55,16 +55,16 @@ void Texture3D::load_image(const string &fn, int dp)
        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)
        {
@@ -72,12 +72,12 @@ void Texture3D::load_image(const string &fn, int dp)
                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)
index 8d9566d8ec6c7f82d1112d84024239c2d8b60273..50e4555aa56cca44e3ec0d66ee09d2641a81f3ab 100644 (file)
@@ -30,7 +30,7 @@ public:
        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; }
index 622599a213d2481acba6707e573286b0d4145f9d..1155fa96286be0ab199280e61ea909115545df30 100644 (file)
@@ -22,15 +22,15 @@ TexUnit::TexUnit():
 
 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;
 }
 
@@ -44,7 +44,7 @@ TexUnit &TexUnit::activate(unsigned n)
                static RequireVersion _ver(1, 3);
                glActiveTexture(GL_TEXTURE0+n);
        }
-       cur_unit=&units[n];
+       cur_unit = &units[n];
 
        return units[n];
 }
@@ -57,7 +57,7 @@ TexUnit &TexUnit::current()
 }
 
 vector<TexUnit> TexUnit::units;
-TexUnit *TexUnit::cur_unit=0;
+TexUnit *TexUnit::cur_unit = 0;
 
 } // namespace GL
 } // namespace Msp
index 8ed1336e4d05268ded65f707ddd0f64f3baad3b7..641552e7d878b67c3ddcdd007a7b1e7ab5f5eccf 100644 (file)
@@ -43,8 +43,8 @@ Uniform1f *Uniform1f::clone() const
 
 Uniform2f::Uniform2f(float v0, float v1)
 {
-       v[0]=v0;
-       v[1]=v1;
+       v[0] = v0;
+       v[1] = v1;
 }
 
 void Uniform2f::apply(int index) const
@@ -60,9 +60,9 @@ Uniform2f *Uniform2f::clone() 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
@@ -78,10 +78,10 @@ Uniform3f *Uniform3f::clone() 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
index d7c2734d76f2a5849fd0bf2c86b18459920dd894..9fed2834bc304af70eaf3910524e30ca0710f7dc 100644 (file)
@@ -4,85 +4,85 @@
 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
index 088d5ba64364d5524c6fcdabfab75bcc52361fcf..d248a0838a206748acd845df2d76e6c70e85490d 100644 (file)
 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
index c6724e13a27f05d1c509ac189d379fe3f392c2e6..8381d8adb1d9663b742db5a88af857f988b6bfd0 100644 (file)
@@ -35,8 +35,8 @@ void VertexArray::use_vertex_buffer()
        if(vbuf && own_vbuf)
                return;
 
-       vbuf=new Buffer(ARRAY_BUFFER);
-       own_vbuf=true;
+       vbuf = new Buffer(ARRAY_BUFFER);
+       own_vbuf = true;
 
        update_data();
 }
@@ -45,8 +45,8 @@ void VertexArray::use_vertex_buffer(Buffer *b)
 {
        if(own_vbuf)
                delete vbuf;
-       vbuf=b;
-       own_vbuf=false;
+       vbuf = b;
+       own_vbuf = false;
 
        update_data();
 }
@@ -64,12 +64,12 @@ void VertexArray::clear()
 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");
 }
@@ -82,14 +82,14 @@ void VertexArray::apply() const
        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:
@@ -111,8 +111,8 @@ void VertexArray::apply() const
                        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);
@@ -152,7 +152,7 @@ void VertexArray::set_array(unsigned array, bool en, unsigned mask) const
                        glDisableClientState(array);
                else
                        glDisableVertexAttribArrayARB(array);
-               enabled_arrays&=~mask;
+               enabled_arrays &= ~mask;
        }
        else if(!(enabled_arrays&mask) && en)
        {
@@ -160,11 +160,11 @@ void VertexArray::set_array(unsigned array, bool en, unsigned mask) const
                        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):
index f9adcf582ac197dd951dee643f35d6bc8a2edbb5..87b290152b6eae6d047512c088c85cfe765b7d5b 100644 (file)
@@ -22,54 +22,54 @@ VertexArrayBuilder::~VertexArrayBuilder()
 
 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;
                }
        }
index d6759d7e85be93d873f44b3c873b0cc2e4006fda..3d3ec79b650b9821d0f0346198a354930e43f9f6 100644 (file)
@@ -18,11 +18,11 @@ VertexBuilder::VertexBuilder():
 
 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
index c92a276071d9ff64ce53ab343fc9a7faddd46c0f..8235c7afea0d8274d0847daa9e3b80eed024f083 100644 (file)
@@ -37,15 +37,15 @@ public:
        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); }
index c26c5c3e11f83fdca0bc87cacbbc5bd49b7e2cfe..e56397e2b088cb93a1204d80027ef875b1c91a73 100644 (file)
@@ -22,8 +22,8 @@ VertexFormat::VertexFormat():
 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):
@@ -31,7 +31,7 @@ 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);
        }
 }
@@ -41,11 +41,11 @@ VertexFormat &VertexFormat::operator=(const VertexFormat &f)
        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;
 }
@@ -57,32 +57,32 @@ VertexFormat::~VertexFormat()
 
 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;
@@ -92,14 +92,14 @@ VertexFormat operator,(const VertexFormat &f, unsigned i)
 {
        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;
 }
@@ -109,58 +109,58 @@ istream &operator>>(istream &in, VertexFormat &f)
        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)
                {
@@ -170,7 +170,7 @@ istream &operator>>(istream &in, VertexFormat &f)
 
                if(underscore==string::npos)
                        break;
-               start=underscore+1;
+               start = underscore+1;
        }
 
        return in;
index 2164a8fb2cf9f8515bcf1cfd3a442f9a68ffd441..3e36c18f4e76f2a60cd93e43d29c382f805bb7e5 100644 (file)
@@ -15,18 +15,18 @@ namespace GL {
 
 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