// Implementation
//////////////////////////////////////////////////////////////////////
-void DBobView::render(RenderStateFlags state) const
+void DBobView::render(OpenGLBinding &GL, RenderStateFlags state) const
{
glBegin(GL_LINE_STRIP);
void SetPath(vec3_t *pPath);
- void render(RenderStateFlags state) const;
+ void render(OpenGLBinding &GL, RenderStateFlags state) const;
void renderSolid(Renderer &renderer, const VolumeTest &volume) const;
delete[] v2;
}
-void DTrainDrawer::render(RenderStateFlags state) const
+void DTrainDrawer::render(OpenGLBinding &GL, RenderStateFlags state) const
{
for (std::list<splinePoint_t *>::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
splinePoint_t *pSP = (*sp);
virtual ~DTrainDrawer(void);
- void render(RenderStateFlags state) const;
+ void render(OpenGLBinding &GL, RenderStateFlags state) const;
void renderSolid(Renderer &renderer, const VolumeTest &volume) const;
GlobalOpenGLStateLibrary().erase(g_state_wireframe);
}
-void DVisDrawer::render(RenderStateFlags state) const
+void DVisDrawer::render(OpenGLBinding &GL, RenderStateFlags state) const
{
//bleh
std::list<DWinding *>::const_iterator l = m_list->begin();
void SetList(std::list<DWinding *> *pointList);
- void render(RenderStateFlags state) const;
+ void render(OpenGLBinding &GL, RenderStateFlags state) const;
void renderSolid(Renderer &renderer, const VolumeTest &volume) const;
renderer.addRenderable(m_drawWireframe, g_matrix4_identity);
}
-void CPortalsDrawWireframe::render(RenderStateFlags state) const
+void CPortalsDrawWireframe::render(OpenGLBinding &GL, RenderStateFlags state) const
{
unsigned int n, p;
}
}
-void CPortalsDrawSolid::render(RenderStateFlags state) const
+void CPortalsDrawSolid::render(OpenGLBinding &GL, RenderStateFlags state) const
{
float trans = (100.0f - portals.trans_3d) / 100.0f;
}
}
-void CPortalsDrawSolidOutline::render(RenderStateFlags state) const
+void CPortalsDrawSolidOutline::render(OpenGLBinding &GL, RenderStateFlags state) const
{
for (unsigned int n = 0; n < portals.portal_count; n++) {
if (portals.lines == 2 && !portals.portal[n].hint) {
public:
mutable CubicClipVolume clip;
- void render(RenderStateFlags state) const;
+ void render(OpenGLBinding &GL, RenderStateFlags state) const;
};
class CPortalsDrawSolidOutline : public OpenGLRenderable {
public:
mutable CubicClipVolume clip;
- void render(RenderStateFlags state) const;
+ void render(OpenGLBinding &GL, RenderStateFlags state) const;
};
class CPortalsDrawWireframe : public OpenGLRenderable {
public:
- void render(RenderStateFlags state) const;
+ void render(OpenGLBinding &GL, RenderStateFlags state) const;
};
class CPortalsRender : public Renderable {
#define GL_T2F_C4F_N3F_V3F 0x2A2C
#define GL_T4F_C4F_N3F_V4F 0x2A2D
-#define glAccum GlobalOpenGL().m_glAccum
-#define glAlphaFunc GlobalOpenGL().m_glAlphaFunc
-#define glAreTexturesResident GlobalOpenGL().m_glAreTexturesResident
-#define glArrayElement GlobalOpenGL().m_glArrayElement
-#define glBegin GlobalOpenGL().m_glBegin
-#define glBindTexture GlobalOpenGL().m_glBindTexture
-#define glBitmap GlobalOpenGL().m_glBitmap
-#define glBlendFunc GlobalOpenGL().m_glBlendFunc
-#define glCallList GlobalOpenGL().m_glCallList
-#define glCallLists GlobalOpenGL().m_glCallLists
-#define glClear GlobalOpenGL().m_glClear
-#define glClearAccum GlobalOpenGL().m_glClearAccum
-#define glClearColor GlobalOpenGL().m_glClearColor
-#define glClearDepth GlobalOpenGL().m_glClearDepth
-#define glClearIndex GlobalOpenGL().m_glClearIndex
-#define glClearStencil GlobalOpenGL().m_glClearStencil
-#define glClipPlane GlobalOpenGL().m_glClipPlane
-#define glColor3b GlobalOpenGL().m_glColor3b
-#define glColor3bv GlobalOpenGL().m_glColor3bv
-#define glColor3d GlobalOpenGL().m_glColor3d
-#define glColor3dv GlobalOpenGL().m_glColor3dv
-#define glColor3f GlobalOpenGL().m_glColor3f
-#define glColor3fv GlobalOpenGL().m_glColor3fv
-#define glColor3i GlobalOpenGL().m_glColor3i
-#define glColor3iv GlobalOpenGL().m_glColor3iv
-#define glColor3s GlobalOpenGL().m_glColor3s
-#define glColor3sv GlobalOpenGL().m_glColor3sv
-#define glColor3ub GlobalOpenGL().m_glColor3ub
-#define glColor3ubv GlobalOpenGL().m_glColor3ubv
-#define glColor3ui GlobalOpenGL().m_glColor3ui
-#define glColor3uiv GlobalOpenGL().m_glColor3uiv
-#define glColor3us GlobalOpenGL().m_glColor3us
-#define glColor3usv GlobalOpenGL().m_glColor3usv
-#define glColor4b GlobalOpenGL().m_glColor4b
-#define glColor4bv GlobalOpenGL().m_glColor4bv
-#define glColor4d GlobalOpenGL().m_glColor4d
-#define glColor4dv GlobalOpenGL().m_glColor4dv
-#define glColor4f GlobalOpenGL().m_glColor4f
-#define glColor4fv GlobalOpenGL().m_glColor4fv
-#define glColor4i GlobalOpenGL().m_glColor4i
-#define glColor4iv GlobalOpenGL().m_glColor4iv
-#define glColor4s GlobalOpenGL().m_glColor4s
-#define glColor4sv GlobalOpenGL().m_glColor4sv
-#define glColor4ub GlobalOpenGL().m_glColor4ub
-#define glColor4ubv GlobalOpenGL().m_glColor4ubv
-#define glColor4ui GlobalOpenGL().m_glColor4ui
-#define glColor4uiv GlobalOpenGL().m_glColor4uiv
-#define glColor4us GlobalOpenGL().m_glColor4us
-#define glColor4usv GlobalOpenGL().m_glColor4usv
-#define glColorMask GlobalOpenGL().m_glColorMask
-#define glColorMaterial GlobalOpenGL().m_glColorMaterial
-#define glColorPointer GlobalOpenGL().m_glColorPointer
-#define glCopyPixels GlobalOpenGL().m_glCopyPixels
-#define glCopyTexImage1D GlobalOpenGL().m_glCopyTexImage1D
-#define glCopyTexImage2D GlobalOpenGL().m_glCopyTexImage2D
-#define glCopyTexSubImage1D GlobalOpenGL().m_glCopyTexSubImage1D
-#define glCopyTexSubImage2D GlobalOpenGL().m_glCopyTexSubImage2D
-#define glCullFace GlobalOpenGL().m_glCullFace
-#define glDeleteLists GlobalOpenGL().m_glDeleteLists
-#define glDeleteTextures GlobalOpenGL().m_glDeleteTextures
-#define glDepthFunc GlobalOpenGL().m_glDepthFunc
-#define glDepthMask GlobalOpenGL().m_glDepthMask
-#define glDepthRange GlobalOpenGL().m_glDepthRange
-#define glDisable GlobalOpenGL().m_glDisable
-#define glDisableClientState GlobalOpenGL().m_glDisableClientState
-#define glDrawArrays GlobalOpenGL().m_glDrawArrays
-#define glDrawBuffer GlobalOpenGL().m_glDrawBuffer
-#define glDrawElements GlobalOpenGL().m_glDrawElements
-#define glDrawPixels GlobalOpenGL().m_glDrawPixels
-#define glEdgeFlag GlobalOpenGL().m_glEdgeFlag
-#define glEdgeFlagPointer GlobalOpenGL().m_glEdgeFlagPointer
-#define glEdgeFlagv GlobalOpenGL().m_glEdgeFlagv
-#define glEnable GlobalOpenGL().m_glEnable
-#define glEnableClientState GlobalOpenGL().m_glEnableClientState
-#define glEnd GlobalOpenGL().m_glEnd
-#define glEndList GlobalOpenGL().m_glEndList
-#define glEvalCoord1d GlobalOpenGL().m_glEvalCoord1d
-#define glEvalCoord1dv GlobalOpenGL().m_glEvalCoord1dv
-#define glEvalCoord1f GlobalOpenGL().m_glEvalCoord1f
-#define glEvalCoord1fv GlobalOpenGL().m_glEvalCoord1fv
-#define glEvalCoord2d GlobalOpenGL().m_glEvalCoord2d
-#define glEvalCoord2dv GlobalOpenGL().m_glEvalCoord2dv
-#define glEvalCoord2f GlobalOpenGL().m_glEvalCoord2f
-#define glEvalCoord2fv GlobalOpenGL().m_glEvalCoord2fv
-#define glEvalMesh1 GlobalOpenGL().m_glEvalMesh1
-#define glEvalMesh2 GlobalOpenGL().m_glEvalMesh2
-#define glEvalPoint1 GlobalOpenGL().m_glEvalPoint1
-#define glEvalPoint2 GlobalOpenGL().m_glEvalPoint2
-#define glFeedbackBuffer GlobalOpenGL().m_glFeedbackBuffer
-#define glFinish GlobalOpenGL().m_glFinish
-#define glFlush GlobalOpenGL().m_glFlush
-#define glFogf GlobalOpenGL().m_glFogf
-#define glFogfv GlobalOpenGL().m_glFogfv
-#define glFogi GlobalOpenGL().m_glFogi
-#define glFogiv GlobalOpenGL().m_glFogiv
-#define glFrontFace GlobalOpenGL().m_glFrontFace
-#define glFrustum GlobalOpenGL().m_glFrustum
-#define glGenLists GlobalOpenGL().m_glGenLists
-#define glGenTextures GlobalOpenGL().m_glGenTextures
-#define glGetBooleanv GlobalOpenGL().m_glGetBooleanv
-#define glGetClipPlane GlobalOpenGL().m_glGetClipPlane
-#define glGetDoublev GlobalOpenGL().m_glGetDoublev
-#define glGetError GlobalOpenGL().m_glGetError
-#define glGetFloatv GlobalOpenGL().m_glGetFloatv
-#define glGetIntegerv GlobalOpenGL().m_glGetIntegerv
-#define glGetLightfv GlobalOpenGL().m_glGetLightfv
-#define glGetLightiv GlobalOpenGL().m_glGetLightiv
-#define glGetMapdv GlobalOpenGL().m_glGetMapdv
-#define glGetMapfv GlobalOpenGL().m_glGetMapfv
-#define glGetMapiv GlobalOpenGL().m_glGetMapiv
-#define glGetMaterialfv GlobalOpenGL().m_glGetMaterialfv
-#define glGetMaterialiv GlobalOpenGL().m_glGetMaterialiv
-#define glGetPixelMapfv GlobalOpenGL().m_glGetPixelMapfv
-#define glGetPixelMapuiv GlobalOpenGL().m_glGetPixelMapuiv
-#define glGetPixelMapusv GlobalOpenGL().m_glGetPixelMapusv
-#define glGetPointerv GlobalOpenGL().m_glGetPointerv
-#define glGetPolygonStipple GlobalOpenGL().m_glGetPolygonStipple
-#define glGetString GlobalOpenGL().m_glGetString
-#define glGetTexEnvfv GlobalOpenGL().m_glGetTexEnvfv
-#define glGetTexEnviv GlobalOpenGL().m_glGetTexEnviv
-#define glGetTexGendv GlobalOpenGL().m_glGetTexGendv
-#define glGetTexGenfv GlobalOpenGL().m_glGetTexGenfv
-#define glGetTexGeniv GlobalOpenGL().m_glGetTexGeniv
-#define glGetTexImage GlobalOpenGL().m_glGetTexImage
-#define glGetTexLevelParameterfv GlobalOpenGL().m_glGetTexLevelParameter
-#define glGetTexLevelParameteriv GlobalOpenGL().m_glGetTexLevelParameteriv
-#define glGetTexParameterfv GlobalOpenGL().m_glGetTexParameterfv
-#define glGetTexParameteriv GlobalOpenGL().m_glGetTexParameteriv
-#define glHint GlobalOpenGL().m_glHint
-#define glIndexMask GlobalOpenGL().m_glIndexMask
-#define glIndexPointer GlobalOpenGL().m_glIndexPointer
-#define glIndexd GlobalOpenGL().m_glIndexd
-#define glIndexdv GlobalOpenGL().m_glIndexdv
-#define glIndexf GlobalOpenGL().m_glIndexf
-#define glIndexfv GlobalOpenGL().m_glIndexfv
-#define glIndexi GlobalOpenGL().m_glIndexi
-#define glIndexiv GlobalOpenGL().m_glIndexiv
-#define glIndexs GlobalOpenGL().m_glIndexs
-#define glIndexsv GlobalOpenGL().m_glIndexsv
-#define glIndexub GlobalOpenGL().m_glIndexub
-#define glIndexubv GlobalOpenGL().m_glIndexubv
-#define glInitNames GlobalOpenGL().m_glInitNames
-#define glInterleavedArrays GlobalOpenGL().m_glInterleavedArrays
-#define glIsEnabled GlobalOpenGL().m_glIsEnabled
-#define glIsList GlobalOpenGL().m_glIsList
-#define glIsTexture GlobalOpenGL().m_glIsTexture
-#define glLightModelf GlobalOpenGL().m_glLightModelf
-#define glLightModelfv GlobalOpenGL().m_glLightModelfv
-#define glLightModeli GlobalOpenGL().m_glLightModeli
-#define glLightModeliv GlobalOpenGL().m_glLightModeliv
-#define glLightf GlobalOpenGL().m_glLightf
-#define glLightfv GlobalOpenGL().m_glLightfv
-#define glLighti GlobalOpenGL().m_glLighti
-#define glLightiv GlobalOpenGL().m_glLightiv
-#define glLineStipple GlobalOpenGL().m_glLineStipple
-#define glLineWidth GlobalOpenGL().m_glLineWidth
-#define glListBase GlobalOpenGL().m_glListBase
-#define glLoadIdentity GlobalOpenGL().m_glLoadIdentity
-#define glLoadMatrixd GlobalOpenGL().m_glLoadMatrixd
-#define glLoadMatrixf GlobalOpenGL().m_glLoadMatrixf
-#define glLoadName GlobalOpenGL().m_glLoadName
-#define glLogicOp GlobalOpenGL().m_glLogicOp
-#define glMap1d GlobalOpenGL().m_glMap1d
-#define glMap1f GlobalOpenGL().m_glMap1f
-#define glMap2d GlobalOpenGL().m_glMap2d
-#define glMap2f GlobalOpenGL().m_glMap2f
-#define glMapGrid1d GlobalOpenGL().m_glMapGrid1d
-#define glMapGrid1f GlobalOpenGL().m_glMapGrid1f
-#define glMapGrid2d GlobalOpenGL().m_glMapGrid2d
-#define glMapGrid2f GlobalOpenGL().m_glMapGrid2f
-#define glMaterialf GlobalOpenGL().m_glMaterialf
-#define glMaterialfv GlobalOpenGL().m_glMaterialfv
-#define glMateriali GlobalOpenGL().m_glMateriali
-#define glMaterialiv GlobalOpenGL().m_glMaterialiv
-#define glMatrixMode GlobalOpenGL().m_glMatrixMode
-#define glMultMatrixd GlobalOpenGL().m_glMultMatrixd
-#define glMultMatrixf GlobalOpenGL().m_glMultMatrixf
-#define glNewList GlobalOpenGL().m_glNewList
-#define glNormal3b GlobalOpenGL().m_glNormal3b
-#define glNormal3bv GlobalOpenGL().m_glNormal3bv
-#define glNormal3d GlobalOpenGL().m_glNormal3d
-#define glNormal3dv GlobalOpenGL().m_glNormal3dv
-#define glNormal3f GlobalOpenGL().m_glNormal3f
-#define glNormal3fv GlobalOpenGL().m_glNormal3fv
-#define glNormal3i GlobalOpenGL().m_glNormal3i
-#define glNormal3iv GlobalOpenGL().m_glNormal3iv
-#define glNormal3s GlobalOpenGL().m_glNormal3s
-#define glNormal3sv GlobalOpenGL().m_glNormal3sv
-#define glNormalPointer GlobalOpenGL().m_glNormalPointer
-#define glOrtho GlobalOpenGL().m_glOrtho
-#define glPassThrough GlobalOpenGL().m_glPassThrough
-#define glPixelMapfv GlobalOpenGL().m_glPixelMapfv
-#define glPixelMapuiv GlobalOpenGL().m_glPixelMapuiv
-#define glPixelMapusv GlobalOpenGL().m_glPixelMapusv
-#define glPixelStoref GlobalOpenGL().m_glPixelStoref
-#define glPixelStorei GlobalOpenGL().m_glPixelStorei
-#define glPixelTransferf GlobalOpenGL().m_glPixelTransferf
-#define glPixelTransferi GlobalOpenGL().m_glPixelTransferi
-#define glPixelZoom GlobalOpenGL().m_glPixelZoom
-#define glPointSize GlobalOpenGL().m_glPointSize
-#define glPolygonMode GlobalOpenGL().m_glPolygonMode
-#define glPolygonOffset GlobalOpenGL().m_glPolygonOffset
-#define glPolygonStipple GlobalOpenGL().m_glPolygonStipple
-#define glPopAttrib GlobalOpenGL().m_glPopAttrib
-#define glPopClientAttrib GlobalOpenGL().m_glPopClientAttrib
-#define glPopMatrix GlobalOpenGL().m_glPopMatrix
-#define glPopName GlobalOpenGL().m_glPopName
-#define glPrioritizeTextures GlobalOpenGL().m_glPrioritizeTextures
-#define glPushAttrib GlobalOpenGL().m_glPushAttrib
-#define glPushClientAttrib GlobalOpenGL().m_glPushClientAttrib
-#define glPushMatrix GlobalOpenGL().m_glPushMatrix
-#define glPushName GlobalOpenGL().m_glPushName
-#define glRasterPos2d GlobalOpenGL().m_glRasterPos2d
-#define glRasterPos2dv GlobalOpenGL().m_glRasterPos2dv
-#define glRasterPos2f GlobalOpenGL().m_glRasterPos2f
-#define glRasterPos2fv GlobalOpenGL().m_glRasterPos2fv
-#define glRasterPos2i GlobalOpenGL().m_glRasterPos2i
-#define glRasterPos2iv GlobalOpenGL().m_glRasterPos2iv
-#define glRasterPos2s GlobalOpenGL().m_glRasterPos2s
-#define glRasterPos2sv GlobalOpenGL().m_glRasterPos2sv
-#define glRasterPos3d GlobalOpenGL().m_glRasterPos3d
-#define glRasterPos3dv GlobalOpenGL().m_glRasterPos3dv
-#define glRasterPos3f GlobalOpenGL().m_glRasterPos3f
-#define glRasterPos3fv GlobalOpenGL().m_glRasterPos3fv
-#define glRasterPos3i GlobalOpenGL().m_glRasterPos3i
-#define glRasterPos3iv GlobalOpenGL().m_glRasterPos3iv
-#define glRasterPos3s GlobalOpenGL().m_glRasterPos3s
-#define glRasterPos3sv GlobalOpenGL().m_glRasterPos3sv
-#define glRasterPos4d GlobalOpenGL().m_glRasterPos4d
-#define glRasterPos4dv GlobalOpenGL().m_glRasterPos4dv
-#define glRasterPos4f GlobalOpenGL().m_glRasterPos4f
-#define glRasterPos4fv GlobalOpenGL().m_glRasterPos4fv
-#define glRasterPos4i GlobalOpenGL().m_glRasterPos4i
-#define glRasterPos4iv GlobalOpenGL().m_glRasterPos4iv
-#define glRasterPos4s GlobalOpenGL().m_glRasterPos4s
-#define glRasterPos4sv GlobalOpenGL().m_glRasterPos4sv
-#define glReadBuffer GlobalOpenGL().m_glReadBuffer
-#define glReadPixels GlobalOpenGL().m_glReadPixels
-#define glRectd GlobalOpenGL().m_glRectd
-#define glRectdv GlobalOpenGL().m_glRectdv
-#define glRectf GlobalOpenGL().m_glRectf
-#define glRectfv GlobalOpenGL().m_glRectfv
-#define glRecti GlobalOpenGL().m_glRecti
-#define glRectiv GlobalOpenGL().m_glRectiv
-#define glRects GlobalOpenGL().m_glRects
-#define glRectsv GlobalOpenGL().m_glRectsv
-#define glRenderMode GlobalOpenGL().m_glRenderMode
-#define glRotated GlobalOpenGL().m_glRotated
-#define glRotatef GlobalOpenGL().m_glRotatef
-#define glScaled GlobalOpenGL().m_glScaled
-#define glScalef GlobalOpenGL().m_glScalef
-#define glScissor GlobalOpenGL().m_glScissor
-#define glSelectBuffer GlobalOpenGL().m_glSelectBuffer
-#define glShadeModel GlobalOpenGL().m_glShadeModel
-#define glStencilFunc GlobalOpenGL().m_glStencilFunc
-#define glStencilMask GlobalOpenGL().m_glStencilMask
-#define glStencilOp GlobalOpenGL().m_glStencilOp
-#define glTexCoord1d GlobalOpenGL().m_glTexCoord1d
-#define glTexCoord1dv GlobalOpenGL().m_glTexCoord1dv
-#define glTexCoord1f GlobalOpenGL().m_glTexCoord1f
-#define glTexCoord1fv GlobalOpenGL().m_glTexCoord1fv
-#define glTexCoord1i GlobalOpenGL().m_glTexCoord1i
-#define glTexCoord1iv GlobalOpenGL().m_glTexCoord1iv
-#define glTexCoord1s GlobalOpenGL().m_glTexCoord1s
-#define glTexCoord1sv GlobalOpenGL().m_glTexCoord1sv
-#define glTexCoord2d GlobalOpenGL().m_glTexCoord2d
-#define glTexCoord2dv GlobalOpenGL().m_glTexCoord2dv
-#define glTexCoord2f GlobalOpenGL().m_glTexCoord2f
-#define glTexCoord2fv GlobalOpenGL().m_glTexCoord2fv
-#define glTexCoord2i GlobalOpenGL().m_glTexCoord2i
-#define glTexCoord2iv GlobalOpenGL().m_glTexCoord2iv
-#define glTexCoord2s GlobalOpenGL().m_glTexCoord2s
-#define glTexCoord2sv GlobalOpenGL().m_glTexCoord2sv
-#define glTexCoord3d GlobalOpenGL().m_glTexCoord3d
-#define glTexCoord3dv GlobalOpenGL().m_glTexCoord3dv
-#define glTexCoord3f GlobalOpenGL().m_glTexCoord3f
-#define glTexCoord3fv GlobalOpenGL().m_glTexCoord3fv
-#define glTexCoord3i GlobalOpenGL().m_glTexCoord3i
-#define glTexCoord3iv GlobalOpenGL().m_glTexCoord3iv
-#define glTexCoord3s GlobalOpenGL().m_glTexCoord3s
-#define glTexCoord3sv GlobalOpenGL().m_glTexCoord3sv
-#define glTexCoord4d GlobalOpenGL().m_glTexCoord4d
-#define glTexCoord4dv GlobalOpenGL().m_glTexCoord4dv
-#define glTexCoord4f GlobalOpenGL().m_glTexCoord4f
-#define glTexCoord4fv GlobalOpenGL().m_glTexCoord4fv
-#define glTexCoord4i GlobalOpenGL().m_glTexCoord4i
-#define glTexCoord4iv GlobalOpenGL().m_glTexCoord4iv
-#define glTexCoord4s GlobalOpenGL().m_glTexCoord4s
-#define glTexCoord4sv GlobalOpenGL().m_glTexCoord4sv
-#define glTexCoordPointer GlobalOpenGL().m_glTexCoordPointer
-#define glTexEnvf GlobalOpenGL().m_glTexEnvf
-#define glTexEnvfv GlobalOpenGL().m_glTexEnvfv
-#define glTexEnvi GlobalOpenGL().m_glTexEnvi
-#define glTexEnviv GlobalOpenGL().m_glTexEnviv
-#define glTexGend GlobalOpenGL().m_glTexGend
-#define glTexGendv GlobalOpenGL().m_glTexGendv
-#define glTexGenf GlobalOpenGL().m_glTexGenf
-#define glTexGenfv GlobalOpenGL().m_glTexGenfv
-#define glTexGeni GlobalOpenGL().m_glTexGeni
-#define glTexGeniv GlobalOpenGL().m_glTexGeniv
-#define glTexImage1D GlobalOpenGL().m_glTexImage1D
-#define glTexImage2D GlobalOpenGL().m_glTexImage2D
-#define glTexParameterf GlobalOpenGL().m_glTexParameterf
-#define glTexParameterfv GlobalOpenGL().m_glTexParameterfv
-#define glTexParameteri GlobalOpenGL().m_glTexParameteri
-#define glTexParameteriv GlobalOpenGL().m_glTexParameteriv
-#define glTexSubImage1D GlobalOpenGL().m_glTexSubImage1D
-#define glTexSubImage2D GlobalOpenGL().m_glTexSubImage2D
-#define glTranslated GlobalOpenGL().m_glTranslated
-#define glTranslatef GlobalOpenGL().m_glTranslatef
-#define glVertex2d GlobalOpenGL().m_glVertex2d
-#define glVertex2dv GlobalOpenGL().m_glVertex2dv
-#define glVertex2f GlobalOpenGL().m_glVertex2f
-#define glVertex2fv GlobalOpenGL().m_glVertex2fv
-#define glVertex2i GlobalOpenGL().m_glVertex2i
-#define glVertex2iv GlobalOpenGL().m_glVertex2iv
-#define glVertex2s GlobalOpenGL().m_glVertex2s
-#define glVertex2sv GlobalOpenGL().m_glVertex2sv
-#define glVertex3d GlobalOpenGL().m_glVertex3d
-#define glVertex3dv GlobalOpenGL().m_glVertex3dv
-#define glVertex3f GlobalOpenGL().m_glVertex3f
-#define glVertex3fv GlobalOpenGL().m_glVertex3fv
-#define glVertex3i GlobalOpenGL().m_glVertex3i
-#define glVertex3iv GlobalOpenGL().m_glVertex3iv
-#define glVertex3s GlobalOpenGL().m_glVertex3s
-#define glVertex3sv GlobalOpenGL().m_glVertex3sv
-#define glVertex4d GlobalOpenGL().m_glVertex4d
-#define glVertex4dv GlobalOpenGL().m_glVertex4dv
-#define glVertex4f GlobalOpenGL().m_glVertex4f
-#define glVertex4fv GlobalOpenGL().m_glVertex4fv
-#define glVertex4i GlobalOpenGL().m_glVertex4i
-#define glVertex4iv GlobalOpenGL().m_glVertex4iv
-#define glVertex4s GlobalOpenGL().m_glVertex4s
-#define glVertex4sv GlobalOpenGL().m_glVertex4sv
-#define glVertexPointer GlobalOpenGL().m_glVertexPointer
-#define glViewport GlobalOpenGL().m_glViewport
+#define glAccum GL.m_glAccum
+#define glAlphaFunc GL.m_glAlphaFunc
+#define glAreTexturesResident GL.m_glAreTexturesResident
+#define glArrayElement GL.m_glArrayElement
+#define glBegin GL.m_glBegin
+#define glBindTexture GL.m_glBindTexture
+#define glBitmap GL.m_glBitmap
+#define glBlendFunc GL.m_glBlendFunc
+#define glCallList GL.m_glCallList
+#define glCallLists GL.m_glCallLists
+#define glClear GL.m_glClear
+#define glClearAccum GL.m_glClearAccum
+#define glClearColor GL.m_glClearColor
+#define glClearDepth GL.m_glClearDepth
+#define glClearIndex GL.m_glClearIndex
+#define glClearStencil GL.m_glClearStencil
+#define glClipPlane GL.m_glClipPlane
+#define glColor3b GL.m_glColor3b
+#define glColor3bv GL.m_glColor3bv
+#define glColor3d GL.m_glColor3d
+#define glColor3dv GL.m_glColor3dv
+#define glColor3f GL.m_glColor3f
+#define glColor3fv GL.m_glColor3fv
+#define glColor3i GL.m_glColor3i
+#define glColor3iv GL.m_glColor3iv
+#define glColor3s GL.m_glColor3s
+#define glColor3sv GL.m_glColor3sv
+#define glColor3ub GL.m_glColor3ub
+#define glColor3ubv GL.m_glColor3ubv
+#define glColor3ui GL.m_glColor3ui
+#define glColor3uiv GL.m_glColor3uiv
+#define glColor3us GL.m_glColor3us
+#define glColor3usv GL.m_glColor3usv
+#define glColor4b GL.m_glColor4b
+#define glColor4bv GL.m_glColor4bv
+#define glColor4d GL.m_glColor4d
+#define glColor4dv GL.m_glColor4dv
+#define glColor4f GL.m_glColor4f
+#define glColor4fv GL.m_glColor4fv
+#define glColor4i GL.m_glColor4i
+#define glColor4iv GL.m_glColor4iv
+#define glColor4s GL.m_glColor4s
+#define glColor4sv GL.m_glColor4sv
+#define glColor4ub GL.m_glColor4ub
+#define glColor4ubv GL.m_glColor4ubv
+#define glColor4ui GL.m_glColor4ui
+#define glColor4uiv GL.m_glColor4uiv
+#define glColor4us GL.m_glColor4us
+#define glColor4usv GL.m_glColor4usv
+#define glColorMask GL.m_glColorMask
+#define glColorMaterial GL.m_glColorMaterial
+#define glColorPointer GL.m_glColorPointer
+#define glCopyPixels GL.m_glCopyPixels
+#define glCopyTexImage1D GL.m_glCopyTexImage1D
+#define glCopyTexImage2D GL.m_glCopyTexImage2D
+#define glCopyTexSubImage1D GL.m_glCopyTexSubImage1D
+#define glCopyTexSubImage2D GL.m_glCopyTexSubImage2D
+#define glCullFace GL.m_glCullFace
+#define glDeleteLists GL.m_glDeleteLists
+#define glDeleteTextures GL.m_glDeleteTextures
+#define glDepthFunc GL.m_glDepthFunc
+#define glDepthMask GL.m_glDepthMask
+#define glDepthRange GL.m_glDepthRange
+#define glDisable GL.m_glDisable
+#define glDisableClientState GL.m_glDisableClientState
+#define glDrawArrays GL.m_glDrawArrays
+#define glDrawBuffer GL.m_glDrawBuffer
+#define glDrawElements GL.m_glDrawElements
+#define glDrawPixels GL.m_glDrawPixels
+#define glEdgeFlag GL.m_glEdgeFlag
+#define glEdgeFlagPointer GL.m_glEdgeFlagPointer
+#define glEdgeFlagv GL.m_glEdgeFlagv
+#define glEnable GL.m_glEnable
+#define glEnableClientState GL.m_glEnableClientState
+#define glEnd GL.m_glEnd
+#define glEndList GL.m_glEndList
+#define glEvalCoord1d GL.m_glEvalCoord1d
+#define glEvalCoord1dv GL.m_glEvalCoord1dv
+#define glEvalCoord1f GL.m_glEvalCoord1f
+#define glEvalCoord1fv GL.m_glEvalCoord1fv
+#define glEvalCoord2d GL.m_glEvalCoord2d
+#define glEvalCoord2dv GL.m_glEvalCoord2dv
+#define glEvalCoord2f GL.m_glEvalCoord2f
+#define glEvalCoord2fv GL.m_glEvalCoord2fv
+#define glEvalMesh1 GL.m_glEvalMesh1
+#define glEvalMesh2 GL.m_glEvalMesh2
+#define glEvalPoint1 GL.m_glEvalPoint1
+#define glEvalPoint2 GL.m_glEvalPoint2
+#define glFeedbackBuffer GL.m_glFeedbackBuffer
+#define glFinish GL.m_glFinish
+#define glFlush GL.m_glFlush
+#define glFogf GL.m_glFogf
+#define glFogfv GL.m_glFogfv
+#define glFogi GL.m_glFogi
+#define glFogiv GL.m_glFogiv
+#define glFrontFace GL.m_glFrontFace
+#define glFrustum GL.m_glFrustum
+#define glGenLists GL.m_glGenLists
+#define glGenTextures GL.m_glGenTextures
+#define glGetBooleanv GL.m_glGetBooleanv
+#define glGetClipPlane GL.m_glGetClipPlane
+#define glGetDoublev GL.m_glGetDoublev
+#define glGetError GL.m_glGetError
+#define glGetFloatv GL.m_glGetFloatv
+#define glGetIntegerv GL.m_glGetIntegerv
+#define glGetLightfv GL.m_glGetLightfv
+#define glGetLightiv GL.m_glGetLightiv
+#define glGetMapdv GL.m_glGetMapdv
+#define glGetMapfv GL.m_glGetMapfv
+#define glGetMapiv GL.m_glGetMapiv
+#define glGetMaterialfv GL.m_glGetMaterialfv
+#define glGetMaterialiv GL.m_glGetMaterialiv
+#define glGetPixelMapfv GL.m_glGetPixelMapfv
+#define glGetPixelMapuiv GL.m_glGetPixelMapuiv
+#define glGetPixelMapusv GL.m_glGetPixelMapusv
+#define glGetPointerv GL.m_glGetPointerv
+#define glGetPolygonStipple GL.m_glGetPolygonStipple
+#define glGetString GL.m_glGetString
+#define glGetTexEnvfv GL.m_glGetTexEnvfv
+#define glGetTexEnviv GL.m_glGetTexEnviv
+#define glGetTexGendv GL.m_glGetTexGendv
+#define glGetTexGenfv GL.m_glGetTexGenfv
+#define glGetTexGeniv GL.m_glGetTexGeniv
+#define glGetTexImage GL.m_glGetTexImage
+#define glGetTexLevelParameterfv GL.m_glGetTexLevelParameter
+#define glGetTexLevelParameteriv GL.m_glGetTexLevelParameteriv
+#define glGetTexParameterfv GL.m_glGetTexParameterfv
+#define glGetTexParameteriv GL.m_glGetTexParameteriv
+#define glHint GL.m_glHint
+#define glIndexMask GL.m_glIndexMask
+#define glIndexPointer GL.m_glIndexPointer
+#define glIndexd GL.m_glIndexd
+#define glIndexdv GL.m_glIndexdv
+#define glIndexf GL.m_glIndexf
+#define glIndexfv GL.m_glIndexfv
+#define glIndexi GL.m_glIndexi
+#define glIndexiv GL.m_glIndexiv
+#define glIndexs GL.m_glIndexs
+#define glIndexsv GL.m_glIndexsv
+#define glIndexub GL.m_glIndexub
+#define glIndexubv GL.m_glIndexubv
+#define glInitNames GL.m_glInitNames
+#define glInterleavedArrays GL.m_glInterleavedArrays
+#define glIsEnabled GL.m_glIsEnabled
+#define glIsList GL.m_glIsList
+#define glIsTexture GL.m_glIsTexture
+#define glLightModelf GL.m_glLightModelf
+#define glLightModelfv GL.m_glLightModelfv
+#define glLightModeli GL.m_glLightModeli
+#define glLightModeliv GL.m_glLightModeliv
+#define glLightf GL.m_glLightf
+#define glLightfv GL.m_glLightfv
+#define glLighti GL.m_glLighti
+#define glLightiv GL.m_glLightiv
+#define glLineStipple GL.m_glLineStipple
+#define glLineWidth GL.m_glLineWidth
+#define glListBase GL.m_glListBase
+#define glLoadIdentity GL.m_glLoadIdentity
+#define glLoadMatrixd GL.m_glLoadMatrixd
+#define glLoadMatrixf GL.m_glLoadMatrixf
+#define glLoadName GL.m_glLoadName
+#define glLogicOp GL.m_glLogicOp
+#define glMap1d GL.m_glMap1d
+#define glMap1f GL.m_glMap1f
+#define glMap2d GL.m_glMap2d
+#define glMap2f GL.m_glMap2f
+#define glMapGrid1d GL.m_glMapGrid1d
+#define glMapGrid1f GL.m_glMapGrid1f
+#define glMapGrid2d GL.m_glMapGrid2d
+#define glMapGrid2f GL.m_glMapGrid2f
+#define glMaterialf GL.m_glMaterialf
+#define glMaterialfv GL.m_glMaterialfv
+#define glMateriali GL.m_glMateriali
+#define glMaterialiv GL.m_glMaterialiv
+#define glMatrixMode GL.m_glMatrixMode
+#define glMultMatrixd GL.m_glMultMatrixd
+#define glMultMatrixf GL.m_glMultMatrixf
+#define glNewList GL.m_glNewList
+#define glNormal3b GL.m_glNormal3b
+#define glNormal3bv GL.m_glNormal3bv
+#define glNormal3d GL.m_glNormal3d
+#define glNormal3dv GL.m_glNormal3dv
+#define glNormal3f GL.m_glNormal3f
+#define glNormal3fv GL.m_glNormal3fv
+#define glNormal3i GL.m_glNormal3i
+#define glNormal3iv GL.m_glNormal3iv
+#define glNormal3s GL.m_glNormal3s
+#define glNormal3sv GL.m_glNormal3sv
+#define glNormalPointer GL.m_glNormalPointer
+#define glOrtho GL.m_glOrtho
+#define glPassThrough GL.m_glPassThrough
+#define glPixelMapfv GL.m_glPixelMapfv
+#define glPixelMapuiv GL.m_glPixelMapuiv
+#define glPixelMapusv GL.m_glPixelMapusv
+#define glPixelStoref GL.m_glPixelStoref
+#define glPixelStorei GL.m_glPixelStorei
+#define glPixelTransferf GL.m_glPixelTransferf
+#define glPixelTransferi GL.m_glPixelTransferi
+#define glPixelZoom GL.m_glPixelZoom
+#define glPointSize GL.m_glPointSize
+#define glPolygonMode GL.m_glPolygonMode
+#define glPolygonOffset GL.m_glPolygonOffset
+#define glPolygonStipple GL.m_glPolygonStipple
+#define glPopAttrib GL.m_glPopAttrib
+#define glPopClientAttrib GL.m_glPopClientAttrib
+#define glPopMatrix GL.m_glPopMatrix
+#define glPopName GL.m_glPopName
+#define glPrioritizeTextures GL.m_glPrioritizeTextures
+#define glPushAttrib GL.m_glPushAttrib
+#define glPushClientAttrib GL.m_glPushClientAttrib
+#define glPushMatrix GL.m_glPushMatrix
+#define glPushName GL.m_glPushName
+#define glRasterPos2d GL.m_glRasterPos2d
+#define glRasterPos2dv GL.m_glRasterPos2dv
+#define glRasterPos2f GL.m_glRasterPos2f
+#define glRasterPos2fv GL.m_glRasterPos2fv
+#define glRasterPos2i GL.m_glRasterPos2i
+#define glRasterPos2iv GL.m_glRasterPos2iv
+#define glRasterPos2s GL.m_glRasterPos2s
+#define glRasterPos2sv GL.m_glRasterPos2sv
+#define glRasterPos3d GL.m_glRasterPos3d
+#define glRasterPos3dv GL.m_glRasterPos3dv
+#define glRasterPos3f GL.m_glRasterPos3f
+#define glRasterPos3fv GL.m_glRasterPos3fv
+#define glRasterPos3i GL.m_glRasterPos3i
+#define glRasterPos3iv GL.m_glRasterPos3iv
+#define glRasterPos3s GL.m_glRasterPos3s
+#define glRasterPos3sv GL.m_glRasterPos3sv
+#define glRasterPos4d GL.m_glRasterPos4d
+#define glRasterPos4dv GL.m_glRasterPos4dv
+#define glRasterPos4f GL.m_glRasterPos4f
+#define glRasterPos4fv GL.m_glRasterPos4fv
+#define glRasterPos4i GL.m_glRasterPos4i
+#define glRasterPos4iv GL.m_glRasterPos4iv
+#define glRasterPos4s GL.m_glRasterPos4s
+#define glRasterPos4sv GL.m_glRasterPos4sv
+#define glReadBuffer GL.m_glReadBuffer
+#define glReadPixels GL.m_glReadPixels
+#define glRectd GL.m_glRectd
+#define glRectdv GL.m_glRectdv
+#define glRectf GL.m_glRectf
+#define glRectfv GL.m_glRectfv
+#define glRecti GL.m_glRecti
+#define glRectiv GL.m_glRectiv
+#define glRects GL.m_glRects
+#define glRectsv GL.m_glRectsv
+#define glRenderMode GL.m_glRenderMode
+#define glRotated GL.m_glRotated
+#define glRotatef GL.m_glRotatef
+#define glScaled GL.m_glScaled
+#define glScalef GL.m_glScalef
+#define glScissor GL.m_glScissor
+#define glSelectBuffer GL.m_glSelectBuffer
+#define glShadeModel GL.m_glShadeModel
+#define glStencilFunc GL.m_glStencilFunc
+#define glStencilMask GL.m_glStencilMask
+#define glStencilOp GL.m_glStencilOp
+#define glTexCoord1d GL.m_glTexCoord1d
+#define glTexCoord1dv GL.m_glTexCoord1dv
+#define glTexCoord1f GL.m_glTexCoord1f
+#define glTexCoord1fv GL.m_glTexCoord1fv
+#define glTexCoord1i GL.m_glTexCoord1i
+#define glTexCoord1iv GL.m_glTexCoord1iv
+#define glTexCoord1s GL.m_glTexCoord1s
+#define glTexCoord1sv GL.m_glTexCoord1sv
+#define glTexCoord2d GL.m_glTexCoord2d
+#define glTexCoord2dv GL.m_glTexCoord2dv
+#define glTexCoord2f GL.m_glTexCoord2f
+#define glTexCoord2fv GL.m_glTexCoord2fv
+#define glTexCoord2i GL.m_glTexCoord2i
+#define glTexCoord2iv GL.m_glTexCoord2iv
+#define glTexCoord2s GL.m_glTexCoord2s
+#define glTexCoord2sv GL.m_glTexCoord2sv
+#define glTexCoord3d GL.m_glTexCoord3d
+#define glTexCoord3dv GL.m_glTexCoord3dv
+#define glTexCoord3f GL.m_glTexCoord3f
+#define glTexCoord3fv GL.m_glTexCoord3fv
+#define glTexCoord3i GL.m_glTexCoord3i
+#define glTexCoord3iv GL.m_glTexCoord3iv
+#define glTexCoord3s GL.m_glTexCoord3s
+#define glTexCoord3sv GL.m_glTexCoord3sv
+#define glTexCoord4d GL.m_glTexCoord4d
+#define glTexCoord4dv GL.m_glTexCoord4dv
+#define glTexCoord4f GL.m_glTexCoord4f
+#define glTexCoord4fv GL.m_glTexCoord4fv
+#define glTexCoord4i GL.m_glTexCoord4i
+#define glTexCoord4iv GL.m_glTexCoord4iv
+#define glTexCoord4s GL.m_glTexCoord4s
+#define glTexCoord4sv GL.m_glTexCoord4sv
+#define glTexCoordPointer GL.m_glTexCoordPointer
+#define glTexEnvf GL.m_glTexEnvf
+#define glTexEnvfv GL.m_glTexEnvfv
+#define glTexEnvi GL.m_glTexEnvi
+#define glTexEnviv GL.m_glTexEnviv
+#define glTexGend GL.m_glTexGend
+#define glTexGendv GL.m_glTexGendv
+#define glTexGenf GL.m_glTexGenf
+#define glTexGenfv GL.m_glTexGenfv
+#define glTexGeni GL.m_glTexGeni
+#define glTexGeniv GL.m_glTexGeniv
+#define glTexImage1D GL.m_glTexImage1D
+#define glTexImage2D GL.m_glTexImage2D
+#define glTexParameterf GL.m_glTexParameterf
+#define glTexParameterfv GL.m_glTexParameterfv
+#define glTexParameteri GL.m_glTexParameteri
+#define glTexParameteriv GL.m_glTexParameteriv
+#define glTexSubImage1D GL.m_glTexSubImage1D
+#define glTexSubImage2D GL.m_glTexSubImage2D
+#define glTranslated GL.m_glTranslated
+#define glTranslatef GL.m_glTranslatef
+#define glVertex2d GL.m_glVertex2d
+#define glVertex2dv GL.m_glVertex2dv
+#define glVertex2f GL.m_glVertex2f
+#define glVertex2fv GL.m_glVertex2fv
+#define glVertex2i GL.m_glVertex2i
+#define glVertex2iv GL.m_glVertex2iv
+#define glVertex2s GL.m_glVertex2s
+#define glVertex2sv GL.m_glVertex2sv
+#define glVertex3d GL.m_glVertex3d
+#define glVertex3dv GL.m_glVertex3dv
+#define glVertex3f GL.m_glVertex3f
+#define glVertex3fv GL.m_glVertex3fv
+#define glVertex3i GL.m_glVertex3i
+#define glVertex3iv GL.m_glVertex3iv
+#define glVertex3s GL.m_glVertex3s
+#define glVertex3sv GL.m_glVertex3sv
+#define glVertex4d GL.m_glVertex4d
+#define glVertex4dv GL.m_glVertex4dv
+#define glVertex4f GL.m_glVertex4f
+#define glVertex4fv GL.m_glVertex4fv
+#define glVertex4i GL.m_glVertex4i
+#define glVertex4iv GL.m_glVertex4iv
+#define glVertex4s GL.m_glVertex4s
+#define glVertex4sv GL.m_glVertex4sv
+#define glVertexPointer GL.m_glVertexPointer
+#define glViewport GL.m_glViewport
#endif
#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-#define glActiveTextureARB GlobalOpenGL().m_glActiveTextureARB
-#define glClientActiveTextureARB GlobalOpenGL().m_glClientActiveTextureARB
-#define glMultiTexCoord1dARB GlobalOpenGL().m_glMultiTexCoord1dARB
-#define glMultiTexCoord1dvARB GlobalOpenGL().m_glMultiTexCoord1dvARB
-#define glMultiTexCoord1fARB GlobalOpenGL().m_glMultiTexCoord1fARB
-#define glMultiTexCoord1fvARB GlobalOpenGL().m_glMultiTexCoord1fvARB
-#define glMultiTexCoord1iARB GlobalOpenGL().m_glMultiTexCoord1iARB
-#define glMultiTexCoord1ivARB GlobalOpenGL().m_glMultiTexCoord1ivARB
-#define glMultiTexCoord1sARB GlobalOpenGL().m_glMultiTexCoord1sARB
-#define glMultiTexCoord1svARB GlobalOpenGL().m_glMultiTexCoord1svARB
-#define glMultiTexCoord2dARB GlobalOpenGL().m_glMultiTexCoord2dARB
-#define glMultiTexCoord2dvARB GlobalOpenGL().m_glMultiTexCoord2dvARB
-#define glMultiTexCoord2fARB GlobalOpenGL().m_glMultiTexCoord2fARB
-#define glMultiTexCoord2fvARB GlobalOpenGL().m_glMultiTexCoord2fvARB
-#define glMultiTexCoord2iARB GlobalOpenGL().m_glMultiTexCoord2iARB
-#define glMultiTexCoord2ivARB GlobalOpenGL().m_glMultiTexCoord2ivARB
-#define glMultiTexCoord2sARB GlobalOpenGL().m_glMultiTexCoord2sARB
-#define glMultiTexCoord2svARB GlobalOpenGL().m_glMultiTexCoord2svARB
-#define glMultiTexCoord3dARB GlobalOpenGL().m_glMultiTexCoord3dARB
-#define glMultiTexCoord3dvARB GlobalOpenGL().m_glMultiTexCoord3dvARB
-#define glMultiTexCoord3fARB GlobalOpenGL().m_glMultiTexCoord3fARB
-#define glMultiTexCoord3fvARB GlobalOpenGL().m_glMultiTexCoord3fvARB
-#define glMultiTexCoord3iARB GlobalOpenGL().m_glMultiTexCoord3iARB
-#define glMultiTexCoord3ivARB GlobalOpenGL().m_glMultiTexCoord3ivARB
-#define glMultiTexCoord3sARB GlobalOpenGL().m_glMultiTexCoord3sARB
-#define glMultiTexCoord3svARB GlobalOpenGL().m_glMultiTexCoord3svARB
-#define glMultiTexCoord4dARB GlobalOpenGL().m_glMultiTexCoord4dARB
-#define glMultiTexCoord4dvARB GlobalOpenGL().m_glMultiTexCoord4dvARB
-#define glMultiTexCoord4fARB GlobalOpenGL().m_glMultiTexCoord4fARB
-#define glMultiTexCoord4fvARB GlobalOpenGL().m_glMultiTexCoord4fvARB
-#define glMultiTexCoord4iARB GlobalOpenGL().m_glMultiTexCoord4iARB
-#define glMultiTexCoord4ivARB GlobalOpenGL().m_glMultiTexCoord4ivARB
-#define glMultiTexCoord4sARB GlobalOpenGL().m_glMultiTexCoord4sARB
-#define glMultiTexCoord4svARB GlobalOpenGL().m_glMultiTexCoord4svARB
+#define glActiveTextureARB GL.m_glActiveTextureARB
+#define glClientActiveTextureARB GL.m_glClientActiveTextureARB
+#define glMultiTexCoord1dARB GL.m_glMultiTexCoord1dARB
+#define glMultiTexCoord1dvARB GL.m_glMultiTexCoord1dvARB
+#define glMultiTexCoord1fARB GL.m_glMultiTexCoord1fARB
+#define glMultiTexCoord1fvARB GL.m_glMultiTexCoord1fvARB
+#define glMultiTexCoord1iARB GL.m_glMultiTexCoord1iARB
+#define glMultiTexCoord1ivARB GL.m_glMultiTexCoord1ivARB
+#define glMultiTexCoord1sARB GL.m_glMultiTexCoord1sARB
+#define glMultiTexCoord1svARB GL.m_glMultiTexCoord1svARB
+#define glMultiTexCoord2dARB GL.m_glMultiTexCoord2dARB
+#define glMultiTexCoord2dvARB GL.m_glMultiTexCoord2dvARB
+#define glMultiTexCoord2fARB GL.m_glMultiTexCoord2fARB
+#define glMultiTexCoord2fvARB GL.m_glMultiTexCoord2fvARB
+#define glMultiTexCoord2iARB GL.m_glMultiTexCoord2iARB
+#define glMultiTexCoord2ivARB GL.m_glMultiTexCoord2ivARB
+#define glMultiTexCoord2sARB GL.m_glMultiTexCoord2sARB
+#define glMultiTexCoord2svARB GL.m_glMultiTexCoord2svARB
+#define glMultiTexCoord3dARB GL.m_glMultiTexCoord3dARB
+#define glMultiTexCoord3dvARB GL.m_glMultiTexCoord3dvARB
+#define glMultiTexCoord3fARB GL.m_glMultiTexCoord3fARB
+#define glMultiTexCoord3fvARB GL.m_glMultiTexCoord3fvARB
+#define glMultiTexCoord3iARB GL.m_glMultiTexCoord3iARB
+#define glMultiTexCoord3ivARB GL.m_glMultiTexCoord3ivARB
+#define glMultiTexCoord3sARB GL.m_glMultiTexCoord3sARB
+#define glMultiTexCoord3svARB GL.m_glMultiTexCoord3svARB
+#define glMultiTexCoord4dARB GL.m_glMultiTexCoord4dARB
+#define glMultiTexCoord4dvARB GL.m_glMultiTexCoord4dvARB
+#define glMultiTexCoord4fARB GL.m_glMultiTexCoord4fARB
+#define glMultiTexCoord4fvARB GL.m_glMultiTexCoord4fvARB
+#define glMultiTexCoord4iARB GL.m_glMultiTexCoord4iARB
+#define glMultiTexCoord4ivARB GL.m_glMultiTexCoord4ivARB
+#define glMultiTexCoord4sARB GL.m_glMultiTexCoord4sARB
+#define glMultiTexCoord4svARB GL.m_glMultiTexCoord4svARB
#endif
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-#define glCompressedTexImage3DARB GlobalOpenGL().m_glCompressedTexImage3DARB
-#define glCompressedTexImage2DARB GlobalOpenGL().m_glCompressedTexImage2DARB
-#define glCompressedTexImage1DARB GlobalOpenGL().m_glCompressedTexImage1DARB
-#define glCompressedTexSubImage3DARB GlobalOpenGL().m_glCompressedTexSubImage3DARB
-#define glCompressedTexSubImage2DARB GlobalOpenGL().m_glCompressedTexSubImage2DARB
-#define glCompressedTexSubImage1DARB GlobalOpenGL().m_glCompressedTexSubImage1DARB
-#define glGetCompressedTexImageARB GlobalOpenGL().m_glGetCompressedTexImageARB
+#define glCompressedTexImage3DARB GL.m_glCompressedTexImage3DARB
+#define glCompressedTexImage2DARB GL.m_glCompressedTexImage2DARB
+#define glCompressedTexImage1DARB GL.m_glCompressedTexImage1DARB
+#define glCompressedTexSubImage3DARB GL.m_glCompressedTexSubImage3DARB
+#define glCompressedTexSubImage2DARB GL.m_glCompressedTexSubImage2DARB
+#define glCompressedTexSubImage1DARB GL.m_glCompressedTexSubImage1DARB
+#define glGetCompressedTexImageARB GL.m_glGetCompressedTexImageARB
#endif
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define glCopyTexSubImage3D GlobalOpenGL().m_glCopyTexSubImage3D
-#define glDrawRangeElements GlobalOpenGL().m_glDrawRangeElements
-#define glTexImage3D GlobalOpenGL().m_glTexImage3D
-#define glTexSubImage3D GlobalOpenGL().m_glTexSubImage3D
+#define glCopyTexSubImage3D GL.m_glCopyTexSubImage3D
+#define glDrawRangeElements GL.m_glDrawRangeElements
+#define glTexImage3D GL.m_glTexImage3D
+#define glTexSubImage3D GL.m_glTexSubImage3D
#endif
#define GL_DOT3_RGBA 0x86AF
#define GL_MULTISAMPLE_BIT 0x20000000
-#define glActiveTexture GlobalOpenGL().m_glActiveTexture
-#define glClientActiveTexture GlobalOpenGL().m_glClientActiveTexture
-#define glCompressedTexImage1D GlobalOpenGL().m_glCompressedTexImage1D
-#define glCompressedTexImage2D GlobalOpenGL().m_glCompressedTexImage2D
-#define glCompressedTexImage3D GlobalOpenGL().m_glCompressedTexImage3D
-#define glCompressedTexSubImage1D GlobalOpenGL().m_glCompressedTexSubImage1D
-#define glCompressedTexSubImage2D GlobalOpenGL().m_glCompressedTexSubImage2D
-#define glCompressedTexSubImage3D GlobalOpenGL().m_glCompressedTexSubImage3D
-#define glGetCompressedTexImage GlobalOpenGL().m_glGetCompressedTexImage
-#define glLoadTransposeMatrixd GlobalOpenGL().m_glLoadTransposeMatrixd
-#define glLoadTransposeMatrixf GlobalOpenGL().m_glLoadTransposeMatrixf
-#define glMultTransposeMatrixd GlobalOpenGL().m_glMultTransposeMatrixd
-#define glMultTransposeMatrixf GlobalOpenGL().m_glMultTransposeMatrixf
-#define glMultiTexCoord1d GlobalOpenGL().m_glMultiTexCoord1d
-#define glMultiTexCoord1dv GlobalOpenGL().m_glMultiTexCoord1dv
-#define glMultiTexCoord1f GlobalOpenGL().m_glMultiTexCoord1f
-#define glMultiTexCoord1fv GlobalOpenGL().m_glMultiTexCoord1fv
-#define glMultiTexCoord1i GlobalOpenGL().m_glMultiTexCoord1i
-#define glMultiTexCoord1iv GlobalOpenGL().m_glMultiTexCoord1iv
-#define glMultiTexCoord1s GlobalOpenGL().m_glMultiTexCoord1s
-#define glMultiTexCoord1sv GlobalOpenGL().m_glMultiTexCoord1sv
-#define glMultiTexCoord2d GlobalOpenGL().m_glMultiTexCoord2d
-#define glMultiTexCoord2dv GlobalOpenGL().m_glMultiTexCoord2dv
-#define glMultiTexCoord2f GlobalOpenGL().m_glMultiTexCoord2f
-#define glMultiTexCoord2fv GlobalOpenGL().m_glMultiTexCoord2fv
-#define glMultiTexCoord2i GlobalOpenGL().m_glMultiTexCoord2i
-#define glMultiTexCoord2iv GlobalOpenGL().m_glMultiTexCoord2iv
-#define glMultiTexCoord2s GlobalOpenGL().m_glMultiTexCoord2s
-#define glMultiTexCoord2sv GlobalOpenGL().m_glMultiTexCoord2sv
-#define glMultiTexCoord3d GlobalOpenGL().m_glMultiTexCoord3d
-#define glMultiTexCoord3dv GlobalOpenGL().m_glMultiTexCoord3dv
-#define glMultiTexCoord3f GlobalOpenGL().m_glMultiTexCoord3f
-#define glMultiTexCoord3fv GlobalOpenGL().m_glMultiTexCoord3fv
-#define glMultiTexCoord3i GlobalOpenGL().m_glMultiTexCoord3i
-#define glMultiTexCoord3iv GlobalOpenGL().m_glMultiTexCoord3iv
-#define glMultiTexCoord3s GlobalOpenGL().m_glMultiTexCoord3s
-#define glMultiTexCoord3sv GlobalOpenGL().m_glMultiTexCoord3sv
-#define glMultiTexCoord4d GlobalOpenGL().m_glMultiTexCoord4d
-#define glMultiTexCoord4dv GlobalOpenGL().m_glMultiTexCoord4dv
-#define glMultiTexCoord4f GlobalOpenGL().m_glMultiTexCoord4f
-#define glMultiTexCoord4fv GlobalOpenGL().m_glMultiTexCoord4fv
-#define glMultiTexCoord4i GlobalOpenGL().m_glMultiTexCoord4i
-#define glMultiTexCoord4iv GlobalOpenGL().m_glMultiTexCoord4iv
-#define glMultiTexCoord4s GlobalOpenGL().m_glMultiTexCoord4s
-#define glMultiTexCoord4sv GlobalOpenGL().m_glMultiTexCoord4sv
-#define glSampleCoverage GlobalOpenGL().m_glSampleCoverage
+#define glActiveTexture GL.m_glActiveTexture
+#define glClientActiveTexture GL.m_glClientActiveTexture
+#define glCompressedTexImage1D GL.m_glCompressedTexImage1D
+#define glCompressedTexImage2D GL.m_glCompressedTexImage2D
+#define glCompressedTexImage3D GL.m_glCompressedTexImage3D
+#define glCompressedTexSubImage1D GL.m_glCompressedTexSubImage1D
+#define glCompressedTexSubImage2D GL.m_glCompressedTexSubImage2D
+#define glCompressedTexSubImage3D GL.m_glCompressedTexSubImage3D
+#define glGetCompressedTexImage GL.m_glGetCompressedTexImage
+#define glLoadTransposeMatrixd GL.m_glLoadTransposeMatrixd
+#define glLoadTransposeMatrixf GL.m_glLoadTransposeMatrixf
+#define glMultTransposeMatrixd GL.m_glMultTransposeMatrixd
+#define glMultTransposeMatrixf GL.m_glMultTransposeMatrixf
+#define glMultiTexCoord1d GL.m_glMultiTexCoord1d
+#define glMultiTexCoord1dv GL.m_glMultiTexCoord1dv
+#define glMultiTexCoord1f GL.m_glMultiTexCoord1f
+#define glMultiTexCoord1fv GL.m_glMultiTexCoord1fv
+#define glMultiTexCoord1i GL.m_glMultiTexCoord1i
+#define glMultiTexCoord1iv GL.m_glMultiTexCoord1iv
+#define glMultiTexCoord1s GL.m_glMultiTexCoord1s
+#define glMultiTexCoord1sv GL.m_glMultiTexCoord1sv
+#define glMultiTexCoord2d GL.m_glMultiTexCoord2d
+#define glMultiTexCoord2dv GL.m_glMultiTexCoord2dv
+#define glMultiTexCoord2f GL.m_glMultiTexCoord2f
+#define glMultiTexCoord2fv GL.m_glMultiTexCoord2fv
+#define glMultiTexCoord2i GL.m_glMultiTexCoord2i
+#define glMultiTexCoord2iv GL.m_glMultiTexCoord2iv
+#define glMultiTexCoord2s GL.m_glMultiTexCoord2s
+#define glMultiTexCoord2sv GL.m_glMultiTexCoord2sv
+#define glMultiTexCoord3d GL.m_glMultiTexCoord3d
+#define glMultiTexCoord3dv GL.m_glMultiTexCoord3dv
+#define glMultiTexCoord3f GL.m_glMultiTexCoord3f
+#define glMultiTexCoord3fv GL.m_glMultiTexCoord3fv
+#define glMultiTexCoord3i GL.m_glMultiTexCoord3i
+#define glMultiTexCoord3iv GL.m_glMultiTexCoord3iv
+#define glMultiTexCoord3s GL.m_glMultiTexCoord3s
+#define glMultiTexCoord3sv GL.m_glMultiTexCoord3sv
+#define glMultiTexCoord4d GL.m_glMultiTexCoord4d
+#define glMultiTexCoord4dv GL.m_glMultiTexCoord4dv
+#define glMultiTexCoord4f GL.m_glMultiTexCoord4f
+#define glMultiTexCoord4fv GL.m_glMultiTexCoord4fv
+#define glMultiTexCoord4i GL.m_glMultiTexCoord4i
+#define glMultiTexCoord4iv GL.m_glMultiTexCoord4iv
+#define glMultiTexCoord4s GL.m_glMultiTexCoord4s
+#define glMultiTexCoord4sv GL.m_glMultiTexCoord4sv
+#define glSampleCoverage GL.m_glSampleCoverage
#endif
#define GL_TEXTURE_COMPARE_FUNC 0x884D
#define GL_COMPARE_R_TO_TEXTURE 0x884E
-#define glBlendColor GlobalOpenGL().m_glBlendColor
-#define glBlendEquation GlobalOpenGL().m_glBlendEquation
-#define glBlendFuncSeparate GlobalOpenGL().m_glBlendFuncSeparate
-#define glFogCoordPointer GlobalOpenGL().m_glFogCoordPointer
-#define glFogCoordd GlobalOpenGL().m_glFogCoordd
-#define glFogCoorddv GlobalOpenGL().m_glFogCoorddv
-#define glFogCoordf GlobalOpenGL().m_glFogCoordf
-#define glFogCoordfv GlobalOpenGL().m_glFogCoordfv
-#define glMultiDrawArrays GlobalOpenGL().m_glMultiDrawArrays
-#define glMultiDrawElements GlobalOpenGL().m_glMultiDrawElements
-#define glPointParameterf GlobalOpenGL().m_glPointParameterf
-#define glPointParameterfv GlobalOpenGL().m_glPointParameterfv
-#define glSecondaryColor3b GlobalOpenGL().m_glSecondaryColor3b
-#define glSecondaryColor3bv GlobalOpenGL().m_glSecondaryColor3bv
-#define glSecondaryColor3d GlobalOpenGL().m_glSecondaryColor3d
-#define glSecondaryColor3dv GlobalOpenGL().m_glSecondaryColor3dv
-#define glSecondaryColor3f GlobalOpenGL().m_glSecondaryColor3f
-#define glSecondaryColor3fv GlobalOpenGL().m_glSecondaryColor3fv
-#define glSecondaryColor3i GlobalOpenGL().m_glSecondaryColor3i
-#define glSecondaryColor3iv GlobalOpenGL().m_glSecondaryColor3iv
-#define glSecondaryColor3s GlobalOpenGL().m_glSecondaryColor3s
-#define glSecondaryColor3sv GlobalOpenGL().m_glSecondaryColor3sv
-#define glSecondaryColor3ub GlobalOpenGL().m_glSecondaryColor3ub
-#define glSecondaryColor3ubv GlobalOpenGL().m_glSecondaryColor3ubv
-#define glSecondaryColor3ui GlobalOpenGL().m_glSecondaryColor3ui
-#define glSecondaryColor3uiv GlobalOpenGL().m_glSecondaryColor3uiv
-#define glSecondaryColor3us GlobalOpenGL().m_glSecondaryColor3us
-#define glSecondaryColor3usv GlobalOpenGL().m_glSecondaryColor3usv
-#define glSecondaryColorPointer GlobalOpenGL().m_glSecondaryColorPointer
-#define glWindowPos2d GlobalOpenGL().m_glWindowPos2d
-#define glWindowPos2dv GlobalOpenGL().m_glWindowPos2dv
-#define glWindowPos2f GlobalOpenGL().m_glWindowPos2f
-#define glWindowPos2fv GlobalOpenGL().m_glWindowPos2fv
-#define glWindowPos2i GlobalOpenGL().m_glWindowPos2i
-#define glWindowPos2iv GlobalOpenGL().m_glWindowPos2iv
-#define glWindowPos2s GlobalOpenGL().m_glWindowPos2s
-#define glWindowPos2sv GlobalOpenGL().m_glWindowPos2sv
-#define glWindowPos3d GlobalOpenGL().m_glWindowPos3d
-#define glWindowPos3dv GlobalOpenGL().m_glWindowPos3dv
-#define glWindowPos3f GlobalOpenGL().m_glWindowPos3f
-#define glWindowPos3fv GlobalOpenGL().m_glWindowPos3fv
-#define glWindowPos3i GlobalOpenGL().m_glWindowPos3i
-#define glWindowPos3iv GlobalOpenGL().m_glWindowPos3iv
-#define glWindowPos3s GlobalOpenGL().m_glWindowPos3s
-#define glWindowPos3sv GlobalOpenGL().m_glWindowPos3sv
+#define glBlendColor GL.m_glBlendColor
+#define glBlendEquation GL.m_glBlendEquation
+#define glBlendFuncSeparate GL.m_glBlendFuncSeparate
+#define glFogCoordPointer GL.m_glFogCoordPointer
+#define glFogCoordd GL.m_glFogCoordd
+#define glFogCoorddv GL.m_glFogCoorddv
+#define glFogCoordf GL.m_glFogCoordf
+#define glFogCoordfv GL.m_glFogCoordfv
+#define glMultiDrawArrays GL.m_glMultiDrawArrays
+#define glMultiDrawElements GL.m_glMultiDrawElements
+#define glPointParameterf GL.m_glPointParameterf
+#define glPointParameterfv GL.m_glPointParameterfv
+#define glSecondaryColor3b GL.m_glSecondaryColor3b
+#define glSecondaryColor3bv GL.m_glSecondaryColor3bv
+#define glSecondaryColor3d GL.m_glSecondaryColor3d
+#define glSecondaryColor3dv GL.m_glSecondaryColor3dv
+#define glSecondaryColor3f GL.m_glSecondaryColor3f
+#define glSecondaryColor3fv GL.m_glSecondaryColor3fv
+#define glSecondaryColor3i GL.m_glSecondaryColor3i
+#define glSecondaryColor3iv GL.m_glSecondaryColor3iv
+#define glSecondaryColor3s GL.m_glSecondaryColor3s
+#define glSecondaryColor3sv GL.m_glSecondaryColor3sv
+#define glSecondaryColor3ub GL.m_glSecondaryColor3ub
+#define glSecondaryColor3ubv GL.m_glSecondaryColor3ubv
+#define glSecondaryColor3ui GL.m_glSecondaryColor3ui
+#define glSecondaryColor3uiv GL.m_glSecondaryColor3uiv
+#define glSecondaryColor3us GL.m_glSecondaryColor3us
+#define glSecondaryColor3usv GL.m_glSecondaryColor3usv
+#define glSecondaryColorPointer GL.m_glSecondaryColorPointer
+#define glWindowPos2d GL.m_glWindowPos2d
+#define glWindowPos2dv GL.m_glWindowPos2dv
+#define glWindowPos2f GL.m_glWindowPos2f
+#define glWindowPos2fv GL.m_glWindowPos2fv
+#define glWindowPos2i GL.m_glWindowPos2i
+#define glWindowPos2iv GL.m_glWindowPos2iv
+#define glWindowPos2s GL.m_glWindowPos2s
+#define glWindowPos2sv GL.m_glWindowPos2sv
+#define glWindowPos3d GL.m_glWindowPos3d
+#define glWindowPos3dv GL.m_glWindowPos3dv
+#define glWindowPos3f GL.m_glWindowPos3f
+#define glWindowPos3fv GL.m_glWindowPos3fv
+#define glWindowPos3i GL.m_glWindowPos3i
+#define glWindowPos3iv GL.m_glWindowPos3iv
+#define glWindowPos3s GL.m_glWindowPos3s
+#define glWindowPos3sv GL.m_glWindowPos3sv
#endif
typedef std::ptrdiff_t GLsizeiptr;
typedef std::ptrdiff_t GLintptr;
-#define glBeginQuery GlobalOpenGL().m_glBeginQuery
-#define glBindBuffer GlobalOpenGL().m_glBindBuffer
-#define glBufferData GlobalOpenGL().m_glBufferData
-#define glBufferSubData GlobalOpenGL().m_glBufferSubData
-#define glDeleteBuffers GlobalOpenGL().m_glDeleteBuffers
-#define glDeleteQueries GlobalOpenGL().m_glDeleteQueries
-#define glEndQuery GlobalOpenGL().m_glEndQuery
-#define glGenBuffers GlobalOpenGL().m_glGenBuffers
-#define glGenQueries GlobalOpenGL().m_glGenQueries
-#define glGetBufferParameteriv GlobalOpenGL().m_glGetBufferParameteriv
-#define glGetBufferPointerv GlobalOpenGL().m_glGetBufferPointerv
-#define glGetBufferSubData GlobalOpenGL().m_glGetBufferSubData
-#define glGetQueryObjectiv GlobalOpenGL().m_glGetQueryObjectiv
-#define glGetQueryObjectuiv GlobalOpenGL().m_glGetQueryObjectuiv
-#define glGetQueryiv GlobalOpenGL().m_glGetQueryiv
-#define glIsBuffer GlobalOpenGL().m_glIsBuffer
-#define glIsQuery GlobalOpenGL().m_glIsQuery
-#define glMapBuffer GlobalOpenGL().m_glMapBuffer
-#define glUnmapBuffer GlobalOpenGL().m_glUnmapBuffer
+#define glBeginQuery GL.m_glBeginQuery
+#define glBindBuffer GL.m_glBindBuffer
+#define glBufferData GL.m_glBufferData
+#define glBufferSubData GL.m_glBufferSubData
+#define glDeleteBuffers GL.m_glDeleteBuffers
+#define glDeleteQueries GL.m_glDeleteQueries
+#define glEndQuery GL.m_glEndQuery
+#define glGenBuffers GL.m_glGenBuffers
+#define glGenQueries GL.m_glGenQueries
+#define glGetBufferParameteriv GL.m_glGetBufferParameteriv
+#define glGetBufferPointerv GL.m_glGetBufferPointerv
+#define glGetBufferSubData GL.m_glGetBufferSubData
+#define glGetQueryObjectiv GL.m_glGetQueryObjectiv
+#define glGetQueryObjectuiv GL.m_glGetQueryObjectuiv
+#define glGetQueryiv GL.m_glGetQueryiv
+#define glIsBuffer GL.m_glIsBuffer
+#define glIsQuery GL.m_glIsQuery
+#define glMapBuffer GL.m_glMapBuffer
+#define glUnmapBuffer GL.m_glUnmapBuffer
#endif
#define GL_MATRIX30_ARB 0x88DE
#define GL_MATRIX31_ARB 0x88DF
-#define glVertexAttrib1sARB GlobalOpenGL().m_glVertexAttrib1sARB
-#define glVertexAttrib1fARB GlobalOpenGL().m_glVertexAttrib1fARB
-#define glVertexAttrib1dARB GlobalOpenGL().m_glVertexAttrib1dARB
-#define glVertexAttrib2sARB GlobalOpenGL().m_glVertexAttrib2sARB
-#define glVertexAttrib2fARB GlobalOpenGL().m_glVertexAttrib2fARB
-#define glVertexAttrib2dARB GlobalOpenGL().m_glVertexAttrib2dARB
-#define glVertexAttrib3sARB GlobalOpenGL().m_glVertexAttrib3sARB
-#define glVertexAttrib3fARB GlobalOpenGL().m_glVertexAttrib3fARB
-#define glVertexAttrib3dARB GlobalOpenGL().m_glVertexAttrib3dARB
-#define glVertexAttrib4sARB GlobalOpenGL().m_glVertexAttrib4sARB
-#define glVertexAttrib4fARB GlobalOpenGL().m_glVertexAttrib4fARB
-#define glVertexAttrib4dARB GlobalOpenGL().m_glVertexAttrib4dARB
-#define glVertexAttrib4NubARB GlobalOpenGL().m_glVertexAttrib4NubARB
-#define glVertexAttrib1svARB GlobalOpenGL().m_glVertexAttrib1svARB
-#define glVertexAttrib1fvARB GlobalOpenGL().m_glVertexAttrib1fvARB
-#define glVertexAttrib1dvARB GlobalOpenGL().m_glVertexAttrib1dvARB
-#define glVertexAttrib2svARB GlobalOpenGL().m_glVertexAttrib2svARB
-#define glVertexAttrib2fvARB GlobalOpenGL().m_glVertexAttrib2fvARB
-#define glVertexAttrib2dvARB GlobalOpenGL().m_glVertexAttrib2dvARB
-#define glVertexAttrib3svARB GlobalOpenGL().m_glVertexAttrib3svARB
-#define glVertexAttrib3fvARB GlobalOpenGL().m_glVertexAttrib3fvARB
-#define glVertexAttrib3dvARB GlobalOpenGL().m_glVertexAttrib3dvARB
-#define glVertexAttrib4bvARB GlobalOpenGL().m_glVertexAttrib4bvARB
-#define glVertexAttrib4svARB GlobalOpenGL().m_glVertexAttrib4svARB
-#define glVertexAttrib4ivARB GlobalOpenGL().m_glVertexAttrib4ivARB
-#define glVertexAttrib4ubvARB GlobalOpenGL().m_glVertexAttrib4ubvARB
-#define glVertexAttrib4usvARB GlobalOpenGL().m_glVertexAttrib4usvARB
-#define glVertexAttrib4uivARB GlobalOpenGL().m_glVertexAttrib4uivARB
-#define glVertexAttrib4fvARB GlobalOpenGL().m_glVertexAttrib4fvARB
-#define glVertexAttrib4dvARB GlobalOpenGL().m_glVertexAttrib4dvARB
-#define glVertexAttrib4NbvARB GlobalOpenGL().m_glVertexAttrib4NbvARB
-#define glVertexAttrib4NsvARB GlobalOpenGL().m_glVertexAttrib4NsvARB
-#define glVertexAttrib4NivARB GlobalOpenGL().m_glVertexAttrib4NivARB
-#define glVertexAttrib4NubvARB GlobalOpenGL().m_glVertexAttrib4NubvARB
-#define glVertexAttrib4NusvARB GlobalOpenGL().m_glVertexAttrib4NusvARB
-#define glVertexAttrib4NuivARB GlobalOpenGL().m_glVertexAttrib4NuivARB
-#define glVertexAttribPointerARB GlobalOpenGL().m_glVertexAttribPointerARB
-#define glEnableVertexAttribArrayARB GlobalOpenGL().m_glEnableVertexAttribArrayARB
-#define glDisableVertexAttribArrayARB GlobalOpenGL().m_glDisableVertexAttribArrayARB
-#define glProgramStringARB GlobalOpenGL().m_glProgramStringARB
-#define glBindProgramARB GlobalOpenGL().m_glBindProgramARB
-#define glDeleteProgramsARB GlobalOpenGL().m_glDeleteProgramsARB
-#define glGenProgramsARB GlobalOpenGL().m_glGenProgramsARB
-#define glProgramEnvParameter4dARB GlobalOpenGL().m_glProgramEnvParameter4dARB
-#define glProgramEnvParameter4dvARB GlobalOpenGL().m_glProgramEnvParameter4dvARB
-#define glProgramEnvParameter4fARB GlobalOpenGL().m_glProgramEnvParameter4fARB
-#define glProgramEnvParameter4fvARB GlobalOpenGL().m_glProgramEnvParameter4fvARB
-#define glProgramLocalParameter4dARB GlobalOpenGL().m_glProgramLocalParameter4dARB
-#define glProgramLocalParameter4dvARB GlobalOpenGL().m_glProgramLocalParameter4dvARB
-#define glProgramLocalParameter4fARB GlobalOpenGL().m_glProgramLocalParameter4fARB
-#define glProgramLocalParameter4fvARB GlobalOpenGL().m_glProgramLocalParameter4fvARB
-#define glGetProgramEnvParameterdvARB GlobalOpenGL().m_glGetProgramEnvParameterdvARB
-#define glGetProgramEnvParameterfvARB GlobalOpenGL().m_glGetProgramEnvParameterfvARB
-#define glGetProgramLocalParameterdvARB GlobalOpenGL().m_glGetProgramLocalParameterdvARB
-#define glGetProgramLocalParameterfvARB GlobalOpenGL().m_glGetProgramLocalParameterfvARB
-#define glGetProgramivARB GlobalOpenGL().m_glGetProgramivARB
-#define glGetProgramStringARB GlobalOpenGL().m_glGetProgramStringARB
-#define glGetVertexAttribdvARB GlobalOpenGL().m_glGetVertexAttribdvARB
-#define glGetVertexAttribfvARB GlobalOpenGL().m_glGetVertexAttribfvARB
-#define glGetVertexAttribivARB GlobalOpenGL().m_glGetVertexAttribivARB
-#define glGetVertexAttribPointervARB GlobalOpenGL().m_glGetVertexAttribPointervARB
-#define glIsProgramARB GlobalOpenGL().m_glIsProgramARB
+#define glVertexAttrib1sARB GL.m_glVertexAttrib1sARB
+#define glVertexAttrib1fARB GL.m_glVertexAttrib1fARB
+#define glVertexAttrib1dARB GL.m_glVertexAttrib1dARB
+#define glVertexAttrib2sARB GL.m_glVertexAttrib2sARB
+#define glVertexAttrib2fARB GL.m_glVertexAttrib2fARB
+#define glVertexAttrib2dARB GL.m_glVertexAttrib2dARB
+#define glVertexAttrib3sARB GL.m_glVertexAttrib3sARB
+#define glVertexAttrib3fARB GL.m_glVertexAttrib3fARB
+#define glVertexAttrib3dARB GL.m_glVertexAttrib3dARB
+#define glVertexAttrib4sARB GL.m_glVertexAttrib4sARB
+#define glVertexAttrib4fARB GL.m_glVertexAttrib4fARB
+#define glVertexAttrib4dARB GL.m_glVertexAttrib4dARB
+#define glVertexAttrib4NubARB GL.m_glVertexAttrib4NubARB
+#define glVertexAttrib1svARB GL.m_glVertexAttrib1svARB
+#define glVertexAttrib1fvARB GL.m_glVertexAttrib1fvARB
+#define glVertexAttrib1dvARB GL.m_glVertexAttrib1dvARB
+#define glVertexAttrib2svARB GL.m_glVertexAttrib2svARB
+#define glVertexAttrib2fvARB GL.m_glVertexAttrib2fvARB
+#define glVertexAttrib2dvARB GL.m_glVertexAttrib2dvARB
+#define glVertexAttrib3svARB GL.m_glVertexAttrib3svARB
+#define glVertexAttrib3fvARB GL.m_glVertexAttrib3fvARB
+#define glVertexAttrib3dvARB GL.m_glVertexAttrib3dvARB
+#define glVertexAttrib4bvARB GL.m_glVertexAttrib4bvARB
+#define glVertexAttrib4svARB GL.m_glVertexAttrib4svARB
+#define glVertexAttrib4ivARB GL.m_glVertexAttrib4ivARB
+#define glVertexAttrib4ubvARB GL.m_glVertexAttrib4ubvARB
+#define glVertexAttrib4usvARB GL.m_glVertexAttrib4usvARB
+#define glVertexAttrib4uivARB GL.m_glVertexAttrib4uivARB
+#define glVertexAttrib4fvARB GL.m_glVertexAttrib4fvARB
+#define glVertexAttrib4dvARB GL.m_glVertexAttrib4dvARB
+#define glVertexAttrib4NbvARB GL.m_glVertexAttrib4NbvARB
+#define glVertexAttrib4NsvARB GL.m_glVertexAttrib4NsvARB
+#define glVertexAttrib4NivARB GL.m_glVertexAttrib4NivARB
+#define glVertexAttrib4NubvARB GL.m_glVertexAttrib4NubvARB
+#define glVertexAttrib4NusvARB GL.m_glVertexAttrib4NusvARB
+#define glVertexAttrib4NuivARB GL.m_glVertexAttrib4NuivARB
+#define glVertexAttribPointerARB GL.m_glVertexAttribPointerARB
+#define glEnableVertexAttribArrayARB GL.m_glEnableVertexAttribArrayARB
+#define glDisableVertexAttribArrayARB GL.m_glDisableVertexAttribArrayARB
+#define glProgramStringARB GL.m_glProgramStringARB
+#define glBindProgramARB GL.m_glBindProgramARB
+#define glDeleteProgramsARB GL.m_glDeleteProgramsARB
+#define glGenProgramsARB GL.m_glGenProgramsARB
+#define glProgramEnvParameter4dARB GL.m_glProgramEnvParameter4dARB
+#define glProgramEnvParameter4dvARB GL.m_glProgramEnvParameter4dvARB
+#define glProgramEnvParameter4fARB GL.m_glProgramEnvParameter4fARB
+#define glProgramEnvParameter4fvARB GL.m_glProgramEnvParameter4fvARB
+#define glProgramLocalParameter4dARB GL.m_glProgramLocalParameter4dARB
+#define glProgramLocalParameter4dvARB GL.m_glProgramLocalParameter4dvARB
+#define glProgramLocalParameter4fARB GL.m_glProgramLocalParameter4fARB
+#define glProgramLocalParameter4fvARB GL.m_glProgramLocalParameter4fvARB
+#define glGetProgramEnvParameterdvARB GL.m_glGetProgramEnvParameterdvARB
+#define glGetProgramEnvParameterfvARB GL.m_glGetProgramEnvParameterfvARB
+#define glGetProgramLocalParameterdvARB GL.m_glGetProgramLocalParameterdvARB
+#define glGetProgramLocalParameterfvARB GL.m_glGetProgramLocalParameterfvARB
+#define glGetProgramivARB GL.m_glGetProgramivARB
+#define glGetProgramStringARB GL.m_glGetProgramStringARB
+#define glGetVertexAttribdvARB GL.m_glGetVertexAttribdvARB
+#define glGetVertexAttribfvARB GL.m_glGetVertexAttribfvARB
+#define glGetVertexAttribivARB GL.m_glGetVertexAttribivARB
+#define glGetVertexAttribPointervARB GL.m_glGetVertexAttribPointervARB
+#define glIsProgramARB GL.m_glIsProgramARB
#endif
#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-#define glDeleteObjectARB GlobalOpenGL().m_glDeleteObjectARB
-#define glGetHandleARB GlobalOpenGL().m_glGetHandleARB
-#define glDetachObjectARB GlobalOpenGL().m_glDetachObjectARB
-#define glCreateShaderObjectARB GlobalOpenGL().m_glCreateShaderObjectARB
-#define glShaderSourceARB GlobalOpenGL().m_glShaderSourceARB
-#define glCompileShaderARB GlobalOpenGL().m_glCompileShaderARB
-#define glCreateProgramObjectARB GlobalOpenGL().m_glCreateProgramObjectARB
-#define glAttachObjectARB GlobalOpenGL().m_glAttachObjectARB
-#define glLinkProgramARB GlobalOpenGL().m_glLinkProgramARB
-#define glUseProgramObjectARB GlobalOpenGL().m_glUseProgramObjectARB
-#define glValidateProgramARB GlobalOpenGL().m_glValidateProgramARB
-#define glUniform1fARB GlobalOpenGL().m_glUniform1fARB
-#define glUniform2fARB GlobalOpenGL().m_glUniform2fARB
-#define glUniform3fARB GlobalOpenGL().m_glUniform3fARB
-#define glUniform4fARB GlobalOpenGL().m_glUniform4fARB
-#define glUniform1iARB GlobalOpenGL().m_glUniform1iARB
-#define glUniform2iARB GlobalOpenGL().m_glUniform2iARB
-#define glUniform3iARB GlobalOpenGL().m_glUniform3iARB
-#define glUniform4iARB GlobalOpenGL().m_glUniform4iARB
-#define glUniform1fvARB GlobalOpenGL().m_glUniform1fvARB
-#define glUniform2fvARB GlobalOpenGL().m_glUniform2fvARB
-#define glUniform3fvARB GlobalOpenGL().m_glUniform3fvARB
-#define glUniform4fvARB GlobalOpenGL().m_glUniform4fvARB
-#define glUniform1ivARB GlobalOpenGL().m_glUniform1ivARB
-#define glUniform2ivARB GlobalOpenGL().m_glUniform2ivARB
-#define glUniform3ivARB GlobalOpenGL().m_glUniform3ivARB
-#define glUniform4ivARB GlobalOpenGL().m_glUniform4ivARB
-#define glUniformMatrix2fvARB GlobalOpenGL().m_glUniformMatrix2fvARB
-#define glUniformMatrix3fvARB GlobalOpenGL().m_glUniformMatrix3fvARB
-#define glUniformMatrix4fvARB GlobalOpenGL().m_glUniformMatrix4fvARB
-#define glGetObjectParameterfvARB GlobalOpenGL().m_glGetObjectParameterfvARB
-#define glGetObjectParameterivARB GlobalOpenGL().m_glGetObjectParameterivARB
-#define glGetInfoLogARB GlobalOpenGL().m_glGetInfoLogARB
-#define glGetAttachedObjectsARB GlobalOpenGL().m_glGetAttachedObjectsARB
-#define glGetUniformLocationARB GlobalOpenGL().m_glGetUniformLocationARB
-#define glGetActiveUniformARB GlobalOpenGL().m_glGetActiveUniformARB
-#define glGetUniformfvARB GlobalOpenGL().m_glGetUniformfvARB
-#define glGetUniformivARB GlobalOpenGL().m_glGetUniformivARB
-#define glGetShaderSourceARB GlobalOpenGL().m_glGetShaderSourceARB
+#define glDeleteObjectARB GL.m_glDeleteObjectARB
+#define glGetHandleARB GL.m_glGetHandleARB
+#define glDetachObjectARB GL.m_glDetachObjectARB
+#define glCreateShaderObjectARB GL.m_glCreateShaderObjectARB
+#define glShaderSourceARB GL.m_glShaderSourceARB
+#define glCompileShaderARB GL.m_glCompileShaderARB
+#define glCreateProgramObjectARB GL.m_glCreateProgramObjectARB
+#define glAttachObjectARB GL.m_glAttachObjectARB
+#define glLinkProgramARB GL.m_glLinkProgramARB
+#define glUseProgramObjectARB GL.m_glUseProgramObjectARB
+#define glValidateProgramARB GL.m_glValidateProgramARB
+#define glUniform1fARB GL.m_glUniform1fARB
+#define glUniform2fARB GL.m_glUniform2fARB
+#define glUniform3fARB GL.m_glUniform3fARB
+#define glUniform4fARB GL.m_glUniform4fARB
+#define glUniform1iARB GL.m_glUniform1iARB
+#define glUniform2iARB GL.m_glUniform2iARB
+#define glUniform3iARB GL.m_glUniform3iARB
+#define glUniform4iARB GL.m_glUniform4iARB
+#define glUniform1fvARB GL.m_glUniform1fvARB
+#define glUniform2fvARB GL.m_glUniform2fvARB
+#define glUniform3fvARB GL.m_glUniform3fvARB
+#define glUniform4fvARB GL.m_glUniform4fvARB
+#define glUniform1ivARB GL.m_glUniform1ivARB
+#define glUniform2ivARB GL.m_glUniform2ivARB
+#define glUniform3ivARB GL.m_glUniform3ivARB
+#define glUniform4ivARB GL.m_glUniform4ivARB
+#define glUniformMatrix2fvARB GL.m_glUniformMatrix2fvARB
+#define glUniformMatrix3fvARB GL.m_glUniformMatrix3fvARB
+#define glUniformMatrix4fvARB GL.m_glUniformMatrix4fvARB
+#define glGetObjectParameterfvARB GL.m_glGetObjectParameterfvARB
+#define glGetObjectParameterivARB GL.m_glGetObjectParameterivARB
+#define glGetInfoLogARB GL.m_glGetInfoLogARB
+#define glGetAttachedObjectsARB GL.m_glGetAttachedObjectsARB
+#define glGetUniformLocationARB GL.m_glGetUniformLocationARB
+#define glGetActiveUniformARB GL.m_glGetActiveUniformARB
+#define glGetUniformfvARB GL.m_glGetUniformfvARB
+#define glGetUniformivARB GL.m_glGetUniformivARB
+#define glGetShaderSourceARB GL.m_glGetShaderSourceARB
typedef char GLcharARB;
typedef unsigned int GLhandleARB;
#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
#if 0
-#define glVertexAttrib1fARB GlobalOpenGL().m_glVertexAttrib1fARB
-#define glVertexAttrib1sARB GlobalOpenGL().m_glVertexAttrib1sARB
-#define glVertexAttrib1dARB GlobalOpenGL().m_glVertexAttrib1dARB
-#define glVertexAttrib2fARB GlobalOpenGL().m_glVertexAttrib2fARB
-#define glVertexAttrib2sARB GlobalOpenGL().m_glVertexAttrib2sARB
-#define glVertexAttrib2dARB GlobalOpenGL().m_glVertexAttrib2dARB
-#define glVertexAttrib3fARB GlobalOpenGL().m_glVertexAttrib3fARB
-#define glVertexAttrib3sARB GlobalOpenGL().m_glVertexAttrib3sARB
-#define glVertexAttrib3dARB GlobalOpenGL().m_glVertexAttrib3dARB
-#define glVertexAttrib4fARB GlobalOpenGL().m_glVertexAttrib4fARB
-#define glVertexAttrib4sARB GlobalOpenGL().m_glVertexAttrib4sARB
-#define glVertexAttrib4dARB GlobalOpenGL().m_glVertexAttrib4dARB
-#define glVertexAttrib4NubARB GlobalOpenGL().m_glVertexAttrib4NubARB
-#define glVertexAttrib1fvARB GlobalOpenGL().m_glVertexAttrib1fvARB
-#define glVertexAttrib1svARB GlobalOpenGL().m_glVertexAttrib1svARB
-#define glVertexAttrib1dvARB GlobalOpenGL().m_glVertexAttrib1dvARB
-#define glVertexAttrib2fvARB GlobalOpenGL().m_glVertexAttrib2fvARB
-#define glVertexAttrib2svARB GlobalOpenGL().m_glVertexAttrib2svARB
-#define glVertexAttrib2dvARB GlobalOpenGL().m_glVertexAttrib2dvARB
-#define glVertexAttrib3fvARB GlobalOpenGL().m_glVertexAttrib3fvARB
-#define glVertexAttrib3svARB GlobalOpenGL().m_glVertexAttrib3svARB
-#define glVertexAttrib3dvARB GlobalOpenGL().m_glVertexAttrib3dvARB
-#define glVertexAttrib4fvARB GlobalOpenGL().m_glVertexAttrib4fvARB
-#define glVertexAttrib4svARB GlobalOpenGL().m_glVertexAttrib4svARB
-#define glVertexAttrib4dvARB GlobalOpenGL().m_glVertexAttrib4dvARB
-#define glVertexAttrib4ivARB GlobalOpenGL().m_glVertexAttrib4ivARB
-#define glVertexAttrib4bvARB GlobalOpenGL().m_glVertexAttrib4bvARB
-#define glVertexAttrib4ubvARB GlobalOpenGL().m_glVertexAttrib4ubvARB
-#define glVertexAttrib4usvARB GlobalOpenGL().m_glVertexAttrib4usvARB
-#define glVertexAttrib4uivARB GlobalOpenGL().m_glVertexAttrib4uivARB
-#define glVertexAttrib4NbvARB GlobalOpenGL().m_glVertexAttrib4NbvARB
-#define glVertexAttrib4NsvARB GlobalOpenGL().m_glVertexAttrib4NsvARB
-#define glVertexAttrib4NivARB GlobalOpenGL().m_glVertexAttrib4NivARB
-#define glVertexAttrib4NubvARB GlobalOpenGL().m_glVertexAttrib4NubvARB
-#define glVertexAttrib4NusvARB GlobalOpenGL().m_glVertexAttrib4NusvARB
-#define glVertexAttrib4NuivARB GlobalOpenGL().m_glVertexAttrib4NuivARB
-#define glVertexAttribPointerARB GlobalOpenGL().m_glVertexAttribPointerARB
-#define glEnableVertexAttribArrayARB GlobalOpenGL().m_glEnableVertexAttribArrayARB
-#define glDisableVertexAttribArrayARB GlobalOpenGL().m_glDisableVertexAttribArrayARB
+#define glVertexAttrib1fARB GL.m_glVertexAttrib1fARB
+#define glVertexAttrib1sARB GL.m_glVertexAttrib1sARB
+#define glVertexAttrib1dARB GL.m_glVertexAttrib1dARB
+#define glVertexAttrib2fARB GL.m_glVertexAttrib2fARB
+#define glVertexAttrib2sARB GL.m_glVertexAttrib2sARB
+#define glVertexAttrib2dARB GL.m_glVertexAttrib2dARB
+#define glVertexAttrib3fARB GL.m_glVertexAttrib3fARB
+#define glVertexAttrib3sARB GL.m_glVertexAttrib3sARB
+#define glVertexAttrib3dARB GL.m_glVertexAttrib3dARB
+#define glVertexAttrib4fARB GL.m_glVertexAttrib4fARB
+#define glVertexAttrib4sARB GL.m_glVertexAttrib4sARB
+#define glVertexAttrib4dARB GL.m_glVertexAttrib4dARB
+#define glVertexAttrib4NubARB GL.m_glVertexAttrib4NubARB
+#define glVertexAttrib1fvARB GL.m_glVertexAttrib1fvARB
+#define glVertexAttrib1svARB GL.m_glVertexAttrib1svARB
+#define glVertexAttrib1dvARB GL.m_glVertexAttrib1dvARB
+#define glVertexAttrib2fvARB GL.m_glVertexAttrib2fvARB
+#define glVertexAttrib2svARB GL.m_glVertexAttrib2svARB
+#define glVertexAttrib2dvARB GL.m_glVertexAttrib2dvARB
+#define glVertexAttrib3fvARB GL.m_glVertexAttrib3fvARB
+#define glVertexAttrib3svARB GL.m_glVertexAttrib3svARB
+#define glVertexAttrib3dvARB GL.m_glVertexAttrib3dvARB
+#define glVertexAttrib4fvARB GL.m_glVertexAttrib4fvARB
+#define glVertexAttrib4svARB GL.m_glVertexAttrib4svARB
+#define glVertexAttrib4dvARB GL.m_glVertexAttrib4dvARB
+#define glVertexAttrib4ivARB GL.m_glVertexAttrib4ivARB
+#define glVertexAttrib4bvARB GL.m_glVertexAttrib4bvARB
+#define glVertexAttrib4ubvARB GL.m_glVertexAttrib4ubvARB
+#define glVertexAttrib4usvARB GL.m_glVertexAttrib4usvARB
+#define glVertexAttrib4uivARB GL.m_glVertexAttrib4uivARB
+#define glVertexAttrib4NbvARB GL.m_glVertexAttrib4NbvARB
+#define glVertexAttrib4NsvARB GL.m_glVertexAttrib4NsvARB
+#define glVertexAttrib4NivARB GL.m_glVertexAttrib4NivARB
+#define glVertexAttrib4NubvARB GL.m_glVertexAttrib4NubvARB
+#define glVertexAttrib4NusvARB GL.m_glVertexAttrib4NusvARB
+#define glVertexAttrib4NuivARB GL.m_glVertexAttrib4NuivARB
+#define glVertexAttribPointerARB GL.m_glVertexAttribPointerARB
+#define glEnableVertexAttribArrayARB GL.m_glEnableVertexAttribArrayARB
+#define glDisableVertexAttribArrayARB GL.m_glDisableVertexAttribArrayARB
#endif
-#define glBindAttribLocationARB GlobalOpenGL().m_glBindAttribLocationARB
-#define glGetActiveAttribARB GlobalOpenGL().m_glGetActiveAttribARB
-#define glGetAttribLocationARB GlobalOpenGL().m_glGetAttribLocationARB
+#define glBindAttribLocationARB GL.m_glBindAttribLocationARB
+#define glGetActiveAttribARB GL.m_glGetActiveAttribARB
+#define glGetAttribLocationARB GL.m_glGetAttribLocationARB
#if 0
-#define glGetVertexAttribdvARB GlobalOpenGL().m_glGetVertexAttribdvARB
-#define glGetVertexAttribfvARB GlobalOpenGL().m_glGetVertexAttribfvARB
-#define glGetVertexAttribivARB GlobalOpenGL().m_glGetVertexAttribivARB
-#define glGetVertexAttribPointervARB GlobalOpenGL().m_glGetVertexAttribPointervARB
+#define glGetVertexAttribdvARB GL.m_glGetVertexAttribdvARB
+#define glGetVertexAttribfvARB GL.m_glGetVertexAttribfvARB
+#define glGetVertexAttribivARB GL.m_glGetVertexAttribivARB
+#define glGetVertexAttribPointervARB GL.m_glGetVertexAttribPointervARB
#endif
#endif
#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-#define glAreProgramsResidentNV GlobalOpenGL().m_glAreProgramsResidentNV
-#define glBindProgramNV GlobalOpenGL().m_glBindProgramNV
-#define glDeleteProgramsNV GlobalOpenGL().m_glDeleteProgramsNV
-#define glExecuteProgramNV GlobalOpenGL().m_glExecuteProgramNV
-#define glGenProgramsNV GlobalOpenGL().m_glGenProgramsNV
-#define glGetProgramParameterdvNV GlobalOpenGL().m_glGetProgramParameterdvNV
-#define glGetProgramParameterfvNV GlobalOpenGL().m_glGetProgramParameterfvNV
-#define glGetProgramivNV GlobalOpenGL().m_glGetProgramivNV
-#define glGetProgramStringNV GlobalOpenGL().m_glGetProgramStringNV
-#define glGetTrackMatrixivNV GlobalOpenGL().m_glGetTrackMatrixivNV
-#define glGetVertexAttribdvNV GlobalOpenGL().m_glGetVertexAttribdvNV
-#define glGetVertexAttribfvNV GlobalOpenGL().m_glGetVertexAttribfvNV
-#define glGetVertexAttribivNV GlobalOpenGL().m_glGetVertexAttribivNV
-#define glGetVertexAttribPointervNV GlobalOpenGL().m_glGetVertexAttribPointervNV
-#define glIsProgramNV GlobalOpenGL().m_glIsProgramNV
-#define glLoadProgramNV GlobalOpenGL().m_glLoadProgramNV
-#define glProgramParameter4fNV GlobalOpenGL().m_glProgramParameter4fNV
-#define glProgramParameter4fvNV GlobalOpenGL().m_glProgramParameter4fvNV
-#define glProgramParameters4fvNV GlobalOpenGL().m_glProgramParameters4fvNV
-#define glRequestResidentProgramsNV GlobalOpenGL().m_glRequestResidentProgramsNV
-#define glTrackMatrixNV GlobalOpenGL().m_glTrackMatrixNV
-#define glVertexAttribPointerNV GlobalOpenGL().m_glVertexAttribPointerNV
-#define glVertexAttrib1fNV GlobalOpenGL().m_glVertexAttrib1fNV
-#define glVertexAttrib1fvNV GlobalOpenGL().m_glVertexAttrib1fvNV
-#define glVertexAttrib2fNV GlobalOpenGL().m_glVertexAttrib2fNV
-#define glVertexAttrib2fvNV GlobalOpenGL().m_glVertexAttrib2fvNV
-#define glVertexAttrib3fNV GlobalOpenGL().m_glVertexAttrib3fNV
-#define glVertexAttrib3fvNV GlobalOpenGL().m_glVertexAttrib3fvNV
-#define glVertexAttrib4fNV GlobalOpenGL().m_glVertexAttrib4fNV
-#define glVertexAttrib4fvNV GlobalOpenGL().m_glVertexAttrib4fvNV
-#define glVertexAttribs1fvNV GlobalOpenGL().m_glVertexAttribs1fvNV
-#define glVertexAttribs2fvNV GlobalOpenGL().m_glVertexAttribs2fvNV
-#define glVertexAttribs3fvNV GlobalOpenGL().m_glVertexAttribs3fvNV
-#define glVertexAttribs4fvNV GlobalOpenGL().m_glVertexAttribs4fvNV
+#define glAreProgramsResidentNV GL.m_glAreProgramsResidentNV
+#define glBindProgramNV GL.m_glBindProgramNV
+#define glDeleteProgramsNV GL.m_glDeleteProgramsNV
+#define glExecuteProgramNV GL.m_glExecuteProgramNV
+#define glGenProgramsNV GL.m_glGenProgramsNV
+#define glGetProgramParameterdvNV GL.m_glGetProgramParameterdvNV
+#define glGetProgramParameterfvNV GL.m_glGetProgramParameterfvNV
+#define glGetProgramivNV GL.m_glGetProgramivNV
+#define glGetProgramStringNV GL.m_glGetProgramStringNV
+#define glGetTrackMatrixivNV GL.m_glGetTrackMatrixivNV
+#define glGetVertexAttribdvNV GL.m_glGetVertexAttribdvNV
+#define glGetVertexAttribfvNV GL.m_glGetVertexAttribfvNV
+#define glGetVertexAttribivNV GL.m_glGetVertexAttribivNV
+#define glGetVertexAttribPointervNV GL.m_glGetVertexAttribPointervNV
+#define glIsProgramNV GL.m_glIsProgramNV
+#define glLoadProgramNV GL.m_glLoadProgramNV
+#define glProgramParameter4fNV GL.m_glProgramParameter4fNV
+#define glProgramParameter4fvNV GL.m_glProgramParameter4fvNV
+#define glProgramParameters4fvNV GL.m_glProgramParameters4fvNV
+#define glRequestResidentProgramsNV GL.m_glRequestResidentProgramsNV
+#define glTrackMatrixNV GL.m_glTrackMatrixNV
+#define glVertexAttribPointerNV GL.m_glVertexAttribPointerNV
+#define glVertexAttrib1fNV GL.m_glVertexAttrib1fNV
+#define glVertexAttrib1fvNV GL.m_glVertexAttrib1fvNV
+#define glVertexAttrib2fNV GL.m_glVertexAttrib2fNV
+#define glVertexAttrib2fvNV GL.m_glVertexAttrib2fvNV
+#define glVertexAttrib3fNV GL.m_glVertexAttrib3fNV
+#define glVertexAttrib3fvNV GL.m_glVertexAttrib3fvNV
+#define glVertexAttrib4fNV GL.m_glVertexAttrib4fNV
+#define glVertexAttrib4fvNV GL.m_glVertexAttrib4fvNV
+#define glVertexAttribs1fvNV GL.m_glVertexAttribs1fvNV
+#define glVertexAttribs2fvNV GL.m_glVertexAttribs2fvNV
+#define glVertexAttribs3fvNV GL.m_glVertexAttribs3fvNV
+#define glVertexAttribs4fvNV GL.m_glVertexAttribs4fvNV
#endif
#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-#define glProgramNamedParameter4fNV GlobalOpenGL().m_glProgramNamedParameter4fNV
-#define glProgramNamedParameter4fvNV GlobalOpenGL().m_glProgramNamedParameter4fvNV
-#define glGetProgramNamedParameterfvNV GlobalOpenGL().m_glGetProgramNamedParameterfvNV
+#define glProgramNamedParameter4fNV GL.m_glProgramNamedParameter4fNV
+#define glProgramNamedParameter4fvNV GL.m_glProgramNamedParameter4fvNV
+#define glGetProgramNamedParameterfvNV GL.m_glGetProgramNamedParameterfvNV
#endif
}
/// \brief Asserts that there no OpenGL errors have occurred since the last call to glGetError.
- void ( *assertNoErrors )( const char *file, int line );
+ void ( *assertNoErrors_ )( OpenGLBinding &GL, const char *file, int line );
+ void assertNoErrors(const char *file, int line)
+ {
+ assertNoErrors_(*this, file, line);
+ }
GLFont *m_font; // MUST be set!
/// \brief Renders \p string at the current raster-position of the current context.
- void drawString( const char* string ) const {
- m_font->printString( string );
+ void drawString( const char* string ) {
+ m_font->printString( *this, string );
}
/// \brief Renders \p character at the current raster-position of the current context.
- void drawChar( char character ) const {
+ void drawChar( char character ) {
char s[2];
s[0] = character;
s[1] = 0;
class GlobalModuleRef;
typedef GlobalModuleRef<OpenGLBinding> GlobalOpenGLModuleRef;
-inline OpenGLBinding& GlobalOpenGL(){
- return GlobalOpenGLModule::getTable();
+/// @deprecated
+inline OpenGLBinding &GlobalOpenGL()
+{
+ return GlobalOpenGLModule::getTable();
}
#if GDEF_DEBUG
-#define GlobalOpenGL_debugAssertNoErrors() GlobalOpenGL().assertNoErrors( __FILE__, __LINE__ )
+#define GlobalOpenGL_debugAssertNoErrors() GL.assertNoErrors( __FILE__, __LINE__ )
#else
#define GlobalOpenGL_debugAssertNoErrors()
#endif
class GLProgram
{
public:
-virtual void enable() = 0;
-virtual void disable() = 0;
-virtual void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ) = 0;
+virtual void enable(OpenGLBinding &GL) = 0;
+virtual void disable(OpenGLBinding &GL) = 0;
+virtual void setParameters( OpenGLBinding &GL, const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ) = 0;
};
class OpenGLFogState
#include <uilib/uilib.h>
#include "generic/constant.h"
+struct OpenGLBinding;
+
template<class T>
using func = T *;
STRING_CONSTANT(Name, "gtkgl");
INTEGER_CONSTANT(Version, 1);
- func<ui::GLArea(bool zbufffer)> glwidget_new;
+ func<ui::GLArea(OpenGLBinding &GL, bool zbufffer)> glwidget_new;
func<void(ui::GLArea self)> glwidget_swap_buffers;
func<bool(ui::GLArea self)> glwidget_make_current;
func<void(ui::GLArea self)> glwidget_destroy_context;
const int c_attr_Tangent = 3;
const int c_attr_Binormal = 4;
+struct OpenGLBinding;
+
class OpenGLRenderable
{
public:
virtual ~OpenGLRenderable() = default;
-virtual void render( RenderStateFlags state ) const = 0;
+virtual void render( OpenGLBinding &GL, RenderStateFlags state ) const = 0;
};
class Matrix4;
virtual Shader* capture( const char* name ) = 0;
virtual void release( const char* name ) = 0;
/*! Render all Shader objects. */
-virtual void render( RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer = Vector3( 0, 0, 0 ) ) = 0;
+virtual void render( OpenGLBinding &GL, RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer = Vector3( 0, 0, 0 ) ) = 0;
virtual void realise() = 0;
virtual void unrealise() = 0;
#include <list>
#include <set>
-inline void arrow_draw( const Vector3& origin, const Vector3& direction_forward, const Vector3& direction_left, const Vector3& direction_up ){
+inline void arrow_draw( OpenGLBinding &GL, const Vector3& origin, const Vector3& direction_forward, const Vector3& direction_left, const Vector3& direction_up ){
Vector3 endpoint( vector3_added( origin, vector3_scaled( direction_forward, 32.0 ) ) );
Vector3 tip1( vector3_added( vector3_added( endpoint, vector3_scaled( direction_forward, -8.0 ) ), vector3_scaled( direction_up, -4.0 ) ) );
test.TestQuads( VertexPointer( reinterpret_cast<VertexPointer::pointer>( points ), sizeof( Vector3 ) ), IndexPointer( indices, 24 ), best );
}
-inline void aabb_draw_wire( const Vector3 points[8] ){
+inline void aabb_draw_wire( OpenGLBinding &GL, const Vector3 points[8] ){
unsigned int indices[26] = {
0, 1, 1, 2, 2, 3, 3, 0,
4, 5, 5, 6, 6, 7, 7, 4,
#endif
}
-inline void aabb_draw_flatshade( const Vector3 points[8] ){
+inline void aabb_draw_flatshade( OpenGLBinding &GL, const Vector3 points[8] ){
glBegin( GL_QUADS );
glNormal3fv( vector3_to_array( aabb_normals[0] ) );
glEnd();
}
-inline void aabb_draw_wire( const AABB& aabb ){
+inline void aabb_draw_wire( OpenGLBinding &GL, const AABB& aabb ){
Vector3 points[8];
aabb_corners( aabb, points );
- aabb_draw_wire( points );
+ aabb_draw_wire( GL, points );
}
-inline void aabb_draw_flatshade( const AABB& aabb ){
+inline void aabb_draw_flatshade( OpenGLBinding &GL, const AABB& aabb ){
Vector3 points[8];
aabb_corners( aabb, points );
- aabb_draw_flatshade( points );
+ aabb_draw_flatshade( GL, points );
}
-inline void aabb_draw_textured( const AABB& aabb ){
+inline void aabb_draw_textured( OpenGLBinding &GL, const AABB& aabb ){
Vector3 points[8];
aabb_corners( aabb, points );
glEnd();
}
-inline void aabb_draw_solid( const AABB& aabb, RenderStateFlags state ){
+inline void aabb_draw_solid( OpenGLBinding &GL, const AABB& aabb, RenderStateFlags state ){
if ( state & RENDER_TEXTURE ) {
- aabb_draw_textured( aabb );
+ aabb_draw_textured( GL, aabb );
}
else
{
- aabb_draw_flatshade( aabb );
+ aabb_draw_flatshade( GL, aabb );
}
}
-inline void aabb_draw( const AABB& aabb, RenderStateFlags state ){
+inline void aabb_draw( OpenGLBinding &GL, const AABB& aabb, RenderStateFlags state ){
if ( state & RENDER_FILL ) {
- aabb_draw_solid( aabb, state );
+ aabb_draw_solid( GL, aabb, state );
}
else
{
- aabb_draw_wire( aabb );
+ aabb_draw_wire( GL, aabb );
}
}
public:
RenderableSolidAABB( const AABB& aabb ) : m_aabb( aabb ){
}
-void render( RenderStateFlags state ) const {
- aabb_draw_solid( m_aabb, state );
+void render( OpenGLBinding &GL, RenderStateFlags state ) const {
+ aabb_draw_solid( GL, m_aabb, state );
}
};
public:
RenderableWireframeAABB( const AABB& aabb ) : m_aabb( aabb ){
}
-void render( RenderStateFlags state ) const {
- aabb_draw_wire( m_aabb );
+void render( OpenGLBinding &GL, RenderStateFlags state ) const {
+ aabb_draw_wire( GL, m_aabb );
}
};
return BindFirstOpaque<detail::FreeCallerWrapper<R(Ts...)>>(pVoid);
}
+template<typename Lambda>
+inline Callback<get_func<Lambda>> makeCallbackL(const Lambda &lambda) {
+ static_assert(sizeof(Lambda) == 1, "lambda must not capture");
+ return makeCallbackF(+lambda);
+}
+
+template<typename Lambda>
+inline Callback<detail::ArgShift<get_func<Lambda>>> makeCallbackL(get_argument<Lambda, 0> env, const Lambda &lambda) {
+ static_assert(sizeof(Lambda) == 1, "lambda must not capture");
+ using R = get_result_type<Lambda>;
+ using Env = get_argument<Lambda, 0>;
+ struct Caller {
+ using func = R(Env);
+ static R call(Env env) {
+ (void) (func *) nullptr;
+ const Lambda &x = *(const Lambda *) nullptr;
+ x(env);
+ }
+ };
+ return makeCallback<Caller>(Caller(), env);
+}
+
#endif
// generic string printing with call lists
class GLFontCallList : public GLFont {
+ OpenGLBinding &GL;
GLuint m_displayList;
int m_pixelHeight;
int m_pixelAscent;
int m_pixelDescent;
public:
- GLFontCallList(GLuint displayList, int asc, int desc, int pixelHeight) : m_displayList(displayList),
- m_pixelHeight(pixelHeight),
- m_pixelAscent(asc), m_pixelDescent(desc)
+ GLFontCallList(OpenGLBinding &GL, GLuint displayList, int asc, int desc, int pixelHeight)
+ : GL(GL),
+ m_displayList(displayList),
+ m_pixelHeight(pixelHeight),
+ m_pixelAscent(asc),
+ m_pixelDescent(desc)
{
}
void printString(const char *s)
{
- GlobalOpenGL().m_glListBase(m_displayList);
- GlobalOpenGL().m_glCallLists(GLsizei(strlen(s)), GL_UNSIGNED_BYTE, reinterpret_cast<const GLubyte *>( s ));
+ GL.m_glListBase(m_displayList);
+ GL.m_glCallLists(GLsizei(strlen(s)), GL_UNSIGNED_BYTE, reinterpret_cast<const GLubyte *>( s ));
}
virtual int getPixelAscent() const
// just a hair outside of the viewport (meaning the current raster position is invalid),
// then no text will be rendered. The solution to this is a very hacky one. You can search
// Google for "glDrawPixels clipping".
- virtual void printString(const char *s)
+ virtual void printString(OpenGLBinding &GL, const char *s)
{
// The idea for this code initially came from the font-pangoft2.c example that comes with GtkGLExt.
bitmap.pixel_mode = FT_PIXEL_MODE_GRAY;
pango_ft2_render_layout_subpixel(&bitmap, layout, -log_rect.x,
y_offset_bitmap_render_pango_units);
- GlobalOpenGL().m_glGetFloatv(GL_CURRENT_COLOR, color);
+ GL.m_glGetFloatv(GL_CURRENT_COLOR, color);
// Save state. I didn't see any OpenGL push/pop operations for these.
// Question: Is saving/restoring this state necessary? Being safe.
- GlobalOpenGL().m_glGetIntegerv(GL_UNPACK_ALIGNMENT, &previous_unpack_alignment);
- previous_blend_enabled = GlobalOpenGL().m_glIsEnabled(GL_BLEND);
- GlobalOpenGL().m_glGetIntegerv(GL_BLEND_SRC, &previous_blend_func_src);
- GlobalOpenGL().m_glGetIntegerv(GL_BLEND_DST, &previous_blend_func_dst);
- GlobalOpenGL().m_glGetFloatv(GL_RED_BIAS, &previous_red_bias);
- GlobalOpenGL().m_glGetFloatv(GL_GREEN_BIAS, &previous_green_bias);
- GlobalOpenGL().m_glGetFloatv(GL_BLUE_BIAS, &previous_blue_bias);
- GlobalOpenGL().m_glGetFloatv(GL_ALPHA_SCALE, &previous_alpha_scale);
-
- GlobalOpenGL().m_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- GlobalOpenGL().m_glEnable(GL_BLEND);
- GlobalOpenGL().m_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- GlobalOpenGL().m_glPixelTransferf(GL_RED_BIAS, color[0]);
- GlobalOpenGL().m_glPixelTransferf(GL_GREEN_BIAS, color[1]);
- GlobalOpenGL().m_glPixelTransferf(GL_BLUE_BIAS, color[2]);
- GlobalOpenGL().m_glPixelTransferf(GL_ALPHA_SCALE, color[3]);
-
- GlobalOpenGL().m_glDrawPixels(bitmap.width, bitmap.rows,
+ GL.m_glGetIntegerv(GL_UNPACK_ALIGNMENT, &previous_unpack_alignment);
+ previous_blend_enabled = GL.m_glIsEnabled(GL_BLEND);
+ GL.m_glGetIntegerv(GL_BLEND_SRC, &previous_blend_func_src);
+ GL.m_glGetIntegerv(GL_BLEND_DST, &previous_blend_func_dst);
+ GL.m_glGetFloatv(GL_RED_BIAS, &previous_red_bias);
+ GL.m_glGetFloatv(GL_GREEN_BIAS, &previous_green_bias);
+ GL.m_glGetFloatv(GL_BLUE_BIAS, &previous_blue_bias);
+ GL.m_glGetFloatv(GL_ALPHA_SCALE, &previous_alpha_scale);
+
+ GL.m_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ GL.m_glEnable(GL_BLEND);
+ GL.m_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ GL.m_glPixelTransferf(GL_RED_BIAS, color[0]);
+ GL.m_glPixelTransferf(GL_GREEN_BIAS, color[1]);
+ GL.m_glPixelTransferf(GL_BLUE_BIAS, color[2]);
+ GL.m_glPixelTransferf(GL_ALPHA_SCALE, color[3]);
+
+ GL.m_glDrawPixels(bitmap.width, bitmap.rows,
GL_ALPHA, GL_UNSIGNED_BYTE, begin_bitmap_buffer);
g_free(begin_bitmap_buffer);
// Restore state in reverse order of how we set it.
- GlobalOpenGL().m_glPixelTransferf(GL_ALPHA_SCALE, previous_alpha_scale);
- GlobalOpenGL().m_glPixelTransferf(GL_BLUE_BIAS, previous_blue_bias);
- GlobalOpenGL().m_glPixelTransferf(GL_GREEN_BIAS, previous_green_bias);
- GlobalOpenGL().m_glPixelTransferf(GL_RED_BIAS, previous_red_bias);
- GlobalOpenGL().m_glBlendFunc(previous_blend_func_src, previous_blend_func_dst);
+ GL.m_glPixelTransferf(GL_ALPHA_SCALE, previous_alpha_scale);
+ GL.m_glPixelTransferf(GL_BLUE_BIAS, previous_blue_bias);
+ GL.m_glPixelTransferf(GL_GREEN_BIAS, previous_green_bias);
+ GL.m_glPixelTransferf(GL_RED_BIAS, previous_red_bias);
+ GL.m_glBlendFunc(previous_blend_func_src, previous_blend_func_dst);
if (!previous_blend_enabled) {
- GlobalOpenGL().m_glDisable(GL_BLEND);
+ GL.m_glDisable(GL_BLEND);
}
- GlobalOpenGL().m_glPixelStorei(GL_UNPACK_ALIGNMENT, previous_unpack_alignment);
+ GL.m_glPixelStorei(GL_UNPACK_ALIGNMENT, previous_unpack_alignment);
}
g_object_unref(G_OBJECT(layout));
typedef unsigned int GLuint;
+struct OpenGLBinding;
+
class GLFont {
public:
virtual int getPixelHeight() const = 0;
virtual int getPixelDescent() const = 0;
- virtual void printString(const char *s) = 0;
+ virtual void printString(OpenGLBinding &GL, const char *s) = 0;
virtual ~GLFont()
{
#include "igl.h"
-void (*GLWidget_sharedContextCreated)() = 0;
+void (*GLWidget_sharedContextCreated)(OpenGLBinding &GL) = 0;
-void (*GLWidget_sharedContextDestroyed)() = 0;
+void (*GLWidget_sharedContextDestroyed)(OpenGLBinding &GL) = 0;
unsigned int g_context_count = 0;
ui::GLArea g_shared{ui::null};
-void _glwidget_context_created(ui::GLArea self, void *data)
+void _glwidget_context_created(OpenGLBinding &GL, ui::GLArea self)
{
if (++g_context_count == 1) {
g_shared = self;
g_object_ref(g_shared._handle);
glwidget_make_current(g_shared);
- GlobalOpenGL().contextValid = true;
+ GL.contextValid = true;
- GLWidget_sharedContextCreated();
+ GLWidget_sharedContextCreated(GL);
}
}
-void _glwidget_context_destroyed(ui::GLArea self, void *data)
+void _glwidget_context_destroyed(OpenGLBinding &GL, ui::GLArea self)
{
if (--g_context_count == 0) {
- GlobalOpenGL().contextValid = false;
+ GL.contextValid = false;
- GLWidget_sharedContextDestroyed();
+ GLWidget_sharedContextDestroyed(GL);
g_shared.unref();
g_shared = ui::GLArea(ui::null);
// glwidget_context_created(self);
// }
gtk_gl_area_make_current(self);
- auto valid = GlobalOpenGL().contextValid;
+ auto valid = GL.contextValid;
return true;
}
return gdk_gl_config_new_by_mode((GdkGLConfigMode) (GDK_GL_MODE_RGBA | GDK_GL_MODE_DOUBLE | GDK_GL_MODE_DEPTH));
}
-int glwidget_context_created(ui::GLArea self, void *data)
+int glwidget_context_created(ui::GLArea self, OpenGLBinding *data)
{
- _glwidget_context_created(self, data);
+ _glwidget_context_created(*data, self);
return false;
}
-int glwidget_context_destroyed(ui::GLArea self, void *data)
+int glwidget_context_destroyed(ui::GLArea self, OpenGLBinding *data)
{
- _glwidget_context_destroyed(self, data);
+ _glwidget_context_destroyed(*data, self);
return false;
}
return false;
}
-ui::GLArea glwidget_new(bool zbuffer)
+ui::GLArea glwidget_new(OpenGLBinding &GL, bool zbuffer)
{
auto self = ui::GLArea::from(gtk_drawing_area_new());
self.connect("hierarchy-changed", G_CALLBACK(glwidget_enable_gl), 0);
- self.connect("realize", G_CALLBACK(glwidget_context_created), 0);
- self.connect("unrealize", G_CALLBACK(glwidget_context_destroyed), 0);
+ self.connect("realize", G_CALLBACK(glwidget_context_created), &GL);
+ self.connect("unrealize", G_CALLBACK(glwidget_context_destroyed), &GL);
return self;
}
#if !defined( INCLUDED_GTKUTIL_GLWIDGET_H )
#define INCLUDED_GTKUTIL_GLWIDGET_H
-extern void (*GLWidget_sharedContextCreated)();
+struct OpenGLBinding;
-extern void (*GLWidget_sharedContextDestroyed)();
+extern void (*GLWidget_sharedContextCreated)(OpenGLBinding &GL);
-ui::GLArea glwidget_new(bool zbuffer);
+extern void (*GLWidget_sharedContextDestroyed)(OpenGLBinding &GL);
+
+ui::GLArea glwidget_new(OpenGLBinding &GL, bool zbuffer);
void glwidget_create_context(ui::GLArea self);
m_vertices.push_back( PointVertex( Vertex3f( 0, 0, 16 ), g_colour_z ) );
}
-void render( RenderStateFlags state ) const {
+void render( OpenGLBinding &GL, RenderStateFlags state ) const {
if ( m_vertices.size() == 0 ) {
return;
}
/// \brief Sets up the OpenGL colour and vertex arrays for \p array.
-inline void pointvertex_gl_array( const PointVertex* array ){
+inline void pointvertex_gl_array( OpenGLBinding &GL, const PointVertex* array ){
glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( PointVertex ), &array->colour );
glVertexPointer( 3, GL_FLOAT, sizeof( PointVertex ), &array->vertex );
}
RenderablePointArray( const Array<PointVertex>& array, GLenum mode )
: m_array( array ), m_mode( mode ){
}
-void render( RenderStateFlags state ) const {
+void render( OpenGLBinding &GL, RenderStateFlags state ) const {
#define NV_DRIVER_BUG 1
#if NV_DRIVER_BUG
glColorPointer( 4, GL_UNSIGNED_BYTE, 0, 0 );
glVertexPointer( 3, GL_FLOAT, 0, 0 );
glDrawArrays( GL_TRIANGLE_FAN, 0, 0 );
#endif
- pointvertex_gl_array( m_array.data() );
+ pointvertex_gl_array( GL, m_array.data() );
glDrawArrays( m_mode, 0, GLsizei( m_array.size() ) );
}
};
: m_mode( mode ){
}
-void render( RenderStateFlags state ) const {
- pointvertex_gl_array( &m_vector.front() );
+void render( OpenGLBinding &GL, RenderStateFlags state ) const {
+ pointvertex_gl_array( GL, &m_vector.front() );
glDrawArrays( m_mode, 0, GLsizei( m_vector.size() ) );
}
: m_mode( mode ), m_vertices( vertices ){
}
-void render( RenderStateFlags state ) const {
- pointvertex_gl_array( m_vertices.data() );
+void render( OpenGLBinding &GL, RenderStateFlags state ) const {
+ pointvertex_gl_array( GL, m_vertices.data() );
glDrawArrays( m_mode, 0, m_vertices.size() );
}
};
: m_mode( mode ), m_indices( indices ), m_vertices( vertices ){
}
-void render( RenderStateFlags state ) const {
+void render( OpenGLBinding &GL, RenderStateFlags state ) const {
#if 1
- pointvertex_gl_array( m_vertices.data() );
+ pointvertex_gl_array( GL, m_vertices.data() );
glDrawElements( m_mode, GLsizei( m_indices.size() ), RenderIndexTypeID, m_indices.data() );
#else
glBegin( m_mode );
idVec3 idSplineList::zero( 0,0,0 );
-void glLabeledPoint( idVec3 &color, idVec3 &point, float size, const char *label ) {
+void glLabeledPoint( OpenGLBinding &GL, idVec3 &color, idVec3 &point, float size, const char *label ) {
glColor3fv( color );
glPointSize( size );
glBegin( GL_POINTS );
}
-void glBox( idVec3 &color, idVec3 &point, float size ) {
+void glBox( OpenGLBinding &GL, idVec3 &color, idVec3 &point, float size ) {
idVec3 mins( point );
idVec3 maxs( point );
mins[0] -= size;
}
-void idSplineList::draw( bool editMode ) {
+void idSplineList::draw( OpenGLBinding &GL, bool editMode ) {
int i;
idVec4 yellow( 1, 1, 0, 1 );
if ( editMode ) {
for ( i = 0; i < controlPoints.Num(); i++ ) {
- glBox( activeColor, *controlPoints[i], 4 );
+ glBox( GL, activeColor, *controlPoints[i], 4 );
}
}
if ( count > 0 ) {
//assert(activeSegment >=0 && activeSegment < count);
if ( activeSegment >= 0 && activeSegment < count ) {
- glBox( activeColor, *splinePoints[activeSegment], 6 );
- glBox( yellow, *splinePoints[activeSegment], 8 );
+ glBox( GL, activeColor, *splinePoints[activeSegment], 6 );
+ glBox( GL, yellow, *splinePoints[activeSegment], 8 );
}
}
typedef int fileHandle_t;
-extern void glBox( idVec3 &color, idVec3 &point, float size );
-extern void glLabeledPoint( idVec3 &color, idVec3 &point, float size, const char *label );
+extern void glBox( OpenGLBinding &GL, idVec3 &color, idVec3 &point, float size );
+extern void glLabeledPoint( OpenGLBinding &GL, idVec3 &color, idVec3 &point, float size, const char *label );
static idVec4 blue( 0, 0, 1, 1 );
static idVec4 red( 1, 0, 0, 1 );
}
}
-void drawSelection() {
+void drawSelection(OpenGLBinding &GL) {
int count = selectedPoints.Num();
for ( int i = 0; i < count; i++ ) {
- glBox( red, *getPoint( selectedPoints[i] ), 4 );
+ glBox( GL, red, *getPoint( selectedPoints[i] ), 4 );
}
}
const idVec3 *getPosition( long time );
-void draw( bool editMode );
+void draw( OpenGLBinding &GL, bool editMode );
void addToRenderer();
void setSelectedPoint( idVec3 *p );
return NULL;
}
-virtual void draw( bool editMode ) {};
+virtual void draw( OpenGLBinding &GL, bool editMode ) {};
virtual void parse( const char *( *text ) ) {};
virtual void write( fileHandle_t file, const char *name );
return &pos;
}
-virtual void draw( bool editMode ) {
- glLabeledPoint( blue, pos, ( editMode ) ? 5 : 3, "Fixed point" );
+virtual void draw( OpenGLBinding &GL, bool editMode ) {
+ glLabeledPoint( GL, blue, pos, ( editMode ) ? 5 : 3, "Fixed point" );
}
protected:
}
}
-virtual void draw( bool editMode ) {
- glLabeledPoint( blue, startPos, ( editMode ) ? 5 : 3, "Start interpolated" );
- glLabeledPoint( blue, endPos, ( editMode ) ? 5 : 3, "End interpolated" );
+virtual void draw( OpenGLBinding &GL, bool editMode ) {
+ glLabeledPoint( GL, blue, startPos, ( editMode ) ? 5 : 3, "Start interpolated" );
+ glLabeledPoint( GL, blue, endPos, ( editMode ) ? 5 : 3, "End interpolated" );
glBegin( GL_LINES );
glVertex3fv( startPos );
glVertex3fv( endPos );
target.addPoint( x, y, z );
}
-virtual void draw( bool editMode ) {
- target.draw( editMode );
+virtual void draw( OpenGLBinding &GL, bool editMode ) {
+ target.draw( GL, editMode );
}
virtual void updateSelection( const idVec3 &move ) {
return b;
}
-void draw( bool editMode ) {
+void draw( OpenGLBinding &GL, bool editMode ) {
// gcc doesn't allow casting away from bools
// why? I've no idea...
if ( cameraPosition ) {
- cameraPosition->draw( (bool)( ( editMode || cameraRunning ) && cameraEdit ) );
+ cameraPosition->draw( GL, (bool)( ( editMode || cameraRunning ) && cameraEdit ) );
int count = targetPositions.Num();
for ( int i = 0; i < count; i++ ) {
- targetPositions[i]->draw( (bool)( ( editMode || cameraRunning ) && i == activeTarget && !cameraEdit ) );
+ targetPositions[i]->draw( GL, (bool)( ( editMode || cameraRunning ) && i == activeTarget && !cameraEdit ) );
}
}
}
public:
std::vector<PointVertex> m_vertices;
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
- pointvertex_gl_array(&m_vertices.front());
+ pointvertex_gl_array(GL, &m_vertices.front());
glDrawArrays(GL_LINE_STRIP, 0, GLsizei(m_vertices.size()));
}
};
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
Matrix4 mat = matrix4_rotation_for_euler_xyz_degrees(m_angles);
- arrow_draw(m_origin, matrix4_transformed_direction(mat, Vector3(1, 0, 0)),
+ arrow_draw(GL, m_origin, matrix4_transformed_direction(mat, Vector3(1, 0, 0)),
matrix4_transformed_direction(mat, Vector3(0, 1, 0)),
matrix4_transformed_direction(mat, Vector3(0, 0, 1)));
}
extern bool g_newLightDraw;
-void sphere_draw_fill(const Vector3 &origin, float radius, int sides)
+void sphere_draw_fill(OpenGLBinding &GL, const Vector3 &origin, float radius, int sides)
{
if (radius <= 0) {
return;
glEnd();
}
-void sphere_draw_wire(const Vector3 &origin, float radius, int sides)
+void sphere_draw_wire(OpenGLBinding &GL, const Vector3 &origin, float radius, int sides)
{
{
glBegin(GL_LINE_LOOP);
}
}
-void light_draw_box_lines(const Vector3 &origin, const Vector3 points[8])
+void light_draw_box_lines(OpenGLBinding &GL, const Vector3 &origin, const Vector3 points[8])
{
//draw lines from the center of the bbox to the corners
glBegin(GL_LINES);
glEnd();
}
-void light_draw_radius_wire(const Vector3 &origin, const float envelope[3])
+void light_draw_radius_wire(OpenGLBinding &GL, const Vector3 &origin, const float envelope[3])
{
if (envelope[0] > 0) {
- sphere_draw_wire(origin, envelope[0], 24);
+ sphere_draw_wire(GL, origin, envelope[0], 24);
}
if (envelope[1] > 0) {
- sphere_draw_wire(origin, envelope[1], 24);
+ sphere_draw_wire(GL, origin, envelope[1], 24);
}
if (envelope[2] > 0) {
- sphere_draw_wire(origin, envelope[2], 24);
+ sphere_draw_wire(GL, origin, envelope[2], 24);
}
}
-void light_draw_radius_fill(const Vector3 &origin, const float envelope[3])
+void light_draw_radius_fill(OpenGLBinding &GL, const Vector3 &origin, const float envelope[3])
{
if (envelope[0] > 0) {
- sphere_draw_fill(origin, envelope[0], 16);
+ sphere_draw_fill(GL, origin, envelope[0], 16);
}
if (envelope[1] > 0) {
- sphere_draw_fill(origin, envelope[1], 16);
+ sphere_draw_fill(GL, origin, envelope[1], 16);
}
if (envelope[2] > 0) {
- sphere_draw_fill(origin, envelope[2], 16);
+ sphere_draw_fill(GL, origin, envelope[2], 16);
}
}
points[5] = Vector3(min[0], mid[1], mid[2]);
}
-void light_draw(const AABB &aabb_light, RenderStateFlags state)
+void light_draw(OpenGLBinding &GL, const AABB &aabb_light, RenderStateFlags state)
{
Vector3 points[6];
light_vertices(aabb_light, points);
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
- light_draw_radius_wire(m_origin, m_radii.m_radii);
+ light_draw_radius_wire(GL, m_origin, m_radii.m_radii);
}
};
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
- light_draw_radius_fill(m_origin, m_radii.m_radii);
+ light_draw_radius_fill(GL, m_origin, m_radii.m_radii);
}
};
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
//draw the bounding box of light based on light_radius key
if ((state & RENDER_FILL) != 0) {
- aabb_draw_flatshade(m_points);
+ aabb_draw_flatshade(GL, m_points);
} else {
- aabb_draw_wire(m_points);
+ aabb_draw_wire(GL, m_points);
}
#if 1 //disable if you dont want lines going from the center of the light bbox to the corners
- light_draw_box_lines(m_origin, m_points);
+ light_draw_box_lines(GL, m_origin, m_points);
#endif
}
};
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glBegin(GL_POINTS);
glColor3fv(vector3_to_array(m_eclass.color));
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
Matrix4 unproject(matrix4_full_inverse(m_projection));
Vector3 points[8];
points[7] = vector4_projected(matrix4_transformed_vector4(unproject, Vector4(points[7], 1)));
// Vector4 test1 = matrix4_transformed_vector4( unproject, Vector4( 0.5f, 0.5f, 0.5f, 1 ) );
// Vector3 test2 = vector4_projected( test1 );
- aabb_draw_wire(points);
+ aabb_draw_wire(GL, points);
}
};
m_traverseObservers.detach(*observer);
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
if (!g_newLightDraw) {
- aabb_draw(m_aabb_light, state);
+ aabb_draw(GL, m_aabb_light, state);
} else {
- light_draw(m_aabb_light, state);
+ light_draw(GL, m_aabb_light, state);
}
}
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glRasterPos3fv(vector3_to_array(m_position));
- GlobalOpenGL().drawString(m_named.name());
+ GL.drawString(m_named.name());
}
};
Vector3 start;
Vector3 end;
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
float s1[2], s2[2];
Vector3 dir(vector3_subtracted(end, start));
}
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
#if 1
if ((state & RENDER_BUMP) != 0) {
ReleaseShader();
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
if ((state & RENDER_BUMP) != 0) {
if (GlobalShaderCache().useShaderLanguage()) {
&& fabs(texdef.shift[1]) < (1 << 16);
}
-inline void Winding_DrawWireframe(const Winding &winding)
+inline void Winding_DrawWireframe(OpenGLBinding &GL, const Winding &winding)
{
glVertexPointer(3, GL_FLOAT, sizeof(WindingVertex), &winding.points.data()->vertex);
glDrawArrays(GL_LINE_LOOP, 0, GLsizei(winding.numpoints));
}
-inline void Winding_Draw(const Winding &winding, const Vector3 &normal, RenderStateFlags state)
+inline void Winding_Draw(OpenGLBinding &GL, const Winding &winding, const Vector3 &normal, RenderStateFlags state)
{
glVertexPointer(3, GL_FLOAT, sizeof(WindingVertex), &winding.points.data()->vertex);
m_shader.instanceDetach();
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
- Winding_Draw(m_winding, m_planeTransformed.plane3().normal(), state);
+ Winding_Draw(GL, m_winding, m_planeTransformed.plane3().normal(), state);
}
void updateFiltered()
class RenderableWireframe : public OpenGLRenderable {
public:
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
#if 1
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_vertices->colour);
}
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
if ((state & RENDER_FILL) != 0) {
- Winding_Draw(m_winding, m_plane.normal(), state);
+ Winding_Draw(GL, m_winding, m_plane.normal(), state);
} else {
- Winding_DrawWireframe(m_winding);
+ Winding_DrawWireframe(GL, m_winding);
// also draw a line indicating the direction of the cut
Vector3 lineverts[2];
}
class CamWnd {
+ OpenGLBinding &GL;
View m_view;
camera_t m_Camera;
RadiantCameraView m_cameraview;
guint m_sizeHandler;
guint m_exposeHandler;
- CamWnd();
+ CamWnd(OpenGLBinding &GL);
~CamWnd();
Shader *CamWnd::m_state_select1 = 0;
Shader *CamWnd::m_state_select2 = 0;
-CamWnd *NewCamWnd()
+CamWnd *NewCamWnd(OpenGLBinding &GL)
{
- return new CamWnd;
+ return new CamWnd(GL);
}
void DeleteCamWnd(CamWnd *camwnd)
g_signal_handler_disconnect(G_OBJECT(camwnd.m_gl_widget), camwnd.m_freelook_button_press_handler);
}
-CamWnd::CamWnd() :
+CamWnd::CamWnd(OpenGLBinding &GL) :
+ GL(GL),
m_view(true),
m_Camera(&m_view, CamWndQueueDraw(*this)),
m_cameraview(m_Camera, &m_view, ReferenceCaller<CamWnd, void(), CamWnd_Update>(*this)),
- m_gl_widget(glwidget_new(TRUE)),
+ m_gl_widget(glwidget_new(GL, TRUE)),
m_window_observer(NewWindowObserver()),
m_XORRectangle(m_gl_widget),
m_deferredDraw(WidgetQueueDrawCaller(m_gl_widget)),
m_state_stack.back().m_state->addRenderable(renderable, world, m_state_stack.back().m_lights);
}
- void render(const Matrix4 &modelview, const Matrix4 &projection)
+ void render(OpenGLBinding &GL, const Matrix4 &modelview, const Matrix4 &projection)
{
- GlobalShaderCache().render(m_globalstate, modelview, projection, m_viewer);
+ GlobalShaderCache().render(GL, m_globalstate, modelview, projection, m_viewer);
}
};
Scene_Render(renderer, m_view);
- renderer.render(m_Camera.modelview, m_Camera.projection);
+ renderer.render(GL, m_Camera.modelview, m_Camera.projection);
}
// prepare for 2d stuff
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- if (GlobalOpenGL().GL_1_3()) {
+ if (GL.GL_1_3()) {
glClientActiveTexture(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0);
}
}
if (g_camwindow_globals_private.m_showStats) {
- glRasterPos3f(1.0f, static_cast<float>( m_Camera.height ) - GlobalOpenGL().m_font->getPixelDescent(), 0.0f);
+ glRasterPos3f(1.0f, static_cast<float>( m_Camera.height ) - GL.m_font->getPixelDescent(), 0.0f);
extern const char *Renderer_GetStats();
- GlobalOpenGL().drawString(Renderer_GetStats());
+ GL.drawString(Renderer_GetStats());
- glRasterPos3f(1.0f, static_cast<float>( m_Camera.height ) - GlobalOpenGL().m_font->getPixelDescent() -
- GlobalOpenGL().m_font->getPixelHeight(), 0.0f);
+ glRasterPos3f(1.0f, static_cast<float>( m_Camera.height ) - GL.m_font->getPixelDescent() -
+ GL.m_font->getPixelHeight(), 0.0f);
extern const char *Cull_GetStats();
- GlobalOpenGL().drawString(Cull_GetStats());
+ GL.drawString(Cull_GetStats());
}
// bind back to the default texture so that we don't have problems
class CamWnd;
-CamWnd *NewCamWnd();
+struct OpenGLBinding;
+
+CamWnd *NewCamWnd(OpenGLBinding &GL);
void DeleteCamWnd(CamWnd *camwnd);
CDbgDlg g_DbgDlg;
-void Feedback_draw2D(VIEWTYPE viewType)
+void Feedback_draw2D(OpenGLBinding &GL, VIEWTYPE viewType)
{
- g_DbgDlg.draw2D(viewType);
+ g_DbgDlg.draw2D(GL, viewType);
}
void CSelectMsg::saxStartElement(message_info_t *ctx, const xmlChar *name, const xmlChar **attrs)
{
}
-void CPointMsg::Draw2D(VIEWTYPE vt)
+void CPointMsg::Draw2D(OpenGLBinding &GL, VIEWTYPE vt)
{
int nDim1 = (vt == YZ) ? 1 : 0;
int nDim2 = (vt == XY) ? 1 : 2;
{
}
-void CWindingMsg::Draw2D(VIEWTYPE vt)
+void CWindingMsg::Draw2D(OpenGLBinding &GL, VIEWTYPE vt)
{
int i;
#include "dialog.h"
#include "xywindow.h"
+struct OpenGLBinding;
+
// we use these classes to let plugins draw inside the Radiant windows
// 2D window like YZ XZ XY
class IGL2DWindow {
// Decrement the reference count
virtual void DecRef() = 0;
- virtual void Draw2D(VIEWTYPE vt) = 0;
+ virtual void Draw2D(OpenGLBinding &GL, VIEWTYPE vt) = 0;
};
// 3D window
}
}
- void Draw2D(VIEWTYPE vt);
+ void Draw2D(OpenGLBinding &GL, VIEWTYPE vt);
};
class CWindingMsg : public ISAXHandler, public IGL2DWindow {
}
}
- void Draw2D(VIEWTYPE vt);
+ void Draw2D(OpenGLBinding &GL, VIEWTYPE vt);
};
void DropHighlight();
- void draw2D(VIEWTYPE viewType)
+ void draw2D(OpenGLBinding &GL, VIEWTYPE viewType)
{
if (m_pDraw2D != 0) {
- m_pDraw2D->Draw2D(viewType);
+ m_pDraw2D->Draw2D(GL, viewType);
}
}
extern CDbgDlg g_DbgDlg;
-void Feedback_draw2D(VIEWTYPE viewType);
+void Feedback_draw2D(OpenGLBinding &GL, VIEWTYPE viewType);
#endif
OpenURL(cred.c_str());
}
-void DoAbout()
+void DoAbout(OpenGLBinding &GL)
{
ModalDialog dialog;
ModalDialogButton ok_button(dialog, eIDOK);
void DoSides(int type, int axis);
-void DoAbout();
+struct OpenGLBinding;
+void DoAbout(OpenGLBinding &GL);
#if GDEF_OS_WINDOWS
*/
+#include <igl.h>
#include "main.h"
#include "globaldefs.h"
user_shortcuts_init();
- g_pParentWnd = 0;
- g_pParentWnd = new MainFrame();
+ OpenGLBinding &GL = GlobalOpenGLModule::getTable();
+ g_pParentWnd = new MainFrame(GL);
hide_splash();
return patch_menu_item;
}
-ui::MenuItem create_help_menu()
+ui::MenuItem create_help_menu(OpenGLBinding &GL)
{
// Help menu
auto help_menu_item = new_sub_menu_item_with_mnemonic("_Help");
create_menu_item_with_mnemonic(menu, "Bug report", makeCallbackF(OpenBugReportURL));
create_menu_item_with_mnemonic(menu, "Shortcuts list", makeCallbackF(DoCommandListDlg));
- create_menu_item_with_mnemonic(menu, "_About", makeCallbackF(DoAbout));
+ create_menu_item_with_mnemonic(menu, "_About", makeCallbackL(GL, [](OpenGLBinding &GL) {
+ DoAbout(GL);
+ }));
return help_menu_item;
}
-ui::MenuBar create_main_menu(MainFrame::EViewStyle style)
+ui::MenuBar create_main_menu(MainFrame::EViewStyle style, OpenGLBinding &GL)
{
auto menu_bar = ui::MenuBar::from(gtk_menu_bar_new());
menu_bar.show();
menu_bar.add(create_brush_menu());
menu_bar.add(create_patch_menu());
menu_bar.add(create_plugins_menu());
- menu_bar.add(create_help_menu());
+ menu_bar.add(create_help_menu(GL));
return menu_bar;
}
std::vector<ui::Widget> g_floating_windows;
-MainFrame::MainFrame() : m_idleRedrawStatusText(RedrawStatusTextCaller(*this))
+MainFrame::MainFrame(OpenGLBinding &GL) : m_idleRedrawStatusText(RedrawStatusTextCaller(*this))
{
m_pXYWnd = 0;
m_pCamWnd = 0;
m_bSleeping = false;
- Create();
+ Create(GL);
}
MainFrame::~MainFrame()
return TRUE;
}
-void MainFrame::Create()
+void MainFrame::Create(OpenGLBinding &GL)
{
ui::Window window = ui::Window(ui::window_type::TOP);
register_shortcuts();
- auto main_menu = create_main_menu(CurrentStyle());
+ auto main_menu = create_main_menu(CurrentStyle(), GL);
vbox.pack_start(main_menu, FALSE, FALSE, 0);
auto main_toolbar = create_main_toolbar(CurrentStyle());
gtk_paned_add1(GTK_PANED(vsplit), hsplit);
// xy
- m_pXYWnd = new XYWnd();
+ m_pXYWnd = new XYWnd(GL);
m_pXYWnd->SetViewType(XY);
ui::Widget xy_window = ui::Widget(create_framed_widget(m_pXYWnd->GetWidget()));
// camera
- m_pCamWnd = NewCamWnd();
+ m_pCamWnd = NewCamWnd(GL);
GlobalCamera_setCamWnd(*m_pCamWnd);
CamWnd_setParent(*m_pCamWnd, window);
auto camera_window = create_framed_widget(CamWnd_getWidget(*m_pCamWnd));
gtk_paned_add1(GTK_PANED(vsplit2), camera_window);
// textures
- auto texture_window = create_framed_widget(TextureBrowser_constructWindow(window));
+ auto texture_window = create_framed_widget(TextureBrowser_constructWindow(window, GL));
gtk_paned_add2(GTK_PANED(vsplit2), texture_window);
}
window.show();
- m_pCamWnd = NewCamWnd();
+ m_pCamWnd = NewCamWnd(GL);
GlobalCamera_setCamWnd(*m_pCamWnd);
{
global_accel_connect_window(window);
g_posXYWnd.connect(window);
- m_pXYWnd = new XYWnd();
+ m_pXYWnd = new XYWnd(GL);
m_pXYWnd->m_parent = window;
m_pXYWnd->SetViewType(XY);
global_accel_connect_window(window);
g_posXZWnd.connect(window);
- m_pXZWnd = new XYWnd();
+ m_pXZWnd = new XYWnd(GL);
m_pXZWnd->m_parent = window;
m_pXZWnd->SetViewType(XZ);
global_accel_connect_window(window);
g_posYZWnd.connect(window);
- m_pYZWnd = new XYWnd();
+ m_pYZWnd = new XYWnd(GL);
m_pYZWnd->m_parent = window;
m_pYZWnd->SetViewType(YZ);
}
{
- auto frame = create_framed_widget(TextureBrowser_constructWindow(GroupDialog_getWindow()));
+ auto frame = create_framed_widget(TextureBrowser_constructWindow(GroupDialog_getWindow(), GL));
g_page_textures = GroupDialog_addPage("Textures", frame, TextureBrowserExportTitleCaller());
}
GroupDialog_show();
} else // 4 way
{
- m_pCamWnd = NewCamWnd();
+ m_pCamWnd = NewCamWnd(GL);
GlobalCamera_setCamWnd(*m_pCamWnd);
CamWnd_setParent(*m_pCamWnd, window);
ui::Widget camera = CamWnd_getWidget(*m_pCamWnd);
- m_pYZWnd = new XYWnd();
+ m_pYZWnd = new XYWnd(GL);
m_pYZWnd->SetViewType(YZ);
ui::Widget yz = m_pYZWnd->GetWidget();
- m_pXYWnd = new XYWnd();
+ m_pXYWnd = new XYWnd(GL);
m_pXYWnd->SetViewType(XY);
ui::Widget xy = m_pXYWnd->GetWidget();
- m_pXZWnd = new XYWnd();
+ m_pXZWnd = new XYWnd(GL);
m_pXZWnd->SetViewType(XZ);
ui::Widget xz = m_pXZWnd->GetWidget();
vbox.pack_start(split, TRUE, TRUE, 0);
{
- auto frame = create_framed_widget(TextureBrowser_constructWindow(window));
+ auto frame = create_framed_widget(TextureBrowser_constructWindow(window, GL));
g_page_textures = GroupDialog_addPage("Textures", frame, TextureBrowserExportTitleCaller());
}
}
}
}
-void GlobalGL_sharedContextCreated()
+void GlobalGL_sharedContextCreated(OpenGLBinding &GL)
{
GLFont *g_font = NULL;
const auto extensions = reinterpret_cast<const char *>( glGetString(GL_EXTENSIONS));
globalOutputStream() << "GL_EXTENSIONS: " << (extensions ? extensions : "") << "\n";
- QGL_sharedContextCreated(GlobalOpenGL());
+ QGL_sharedContextCreated(GL);
- ShaderCache_extensionsInitialised();
+ ShaderCache_extensionsInitialised(GL);
GlobalShaderCache().realise();
- Textures_Realise();
+ Textures_Realise(GL);
#if GDEF_OS_WINDOWS
/* win32 is dodgy here, just use courier new then */
g_font = glfont_create(fontname);
#endif
- GlobalOpenGL().m_font = g_font;
+ GL.m_font = g_font;
}
-void GlobalGL_sharedContextDestroyed()
+void GlobalGL_sharedContextDestroyed(OpenGLBinding &GL)
{
- Textures_Unrealise();
+ Textures_Unrealise(GL);
GlobalShaderCache().unrealise();
- QGL_sharedContextDestroyed(GlobalOpenGL());
+ QGL_sharedContextDestroyed(GL);
}
const int c_grid_status = 4;
const int c_count_status = 5;
+struct OpenGLBinding;
+
class MainFrame {
public:
enum EViewStyle {
eRegularLeft = 3,
};
- MainFrame();
+ MainFrame(OpenGLBinding &GL);
~MainFrame();
CopiedString m_grid_status;
private:
- void Create();
+ void Create(OpenGLBinding &GL);
void SaveWindowInfo();
*/
void Map_Free()
{
- Pointfile_Clear();
+ OpenGLBinding &GL = GlobalOpenGL();
+ Pointfile_Clear(GL);
g_map.m_resource->detach(g_map);
GlobalReferenceCache().release(g_map.m_name.c_str());
bool Map_Save()
{
- Pointfile_Clear();
+ OpenGLBinding &GL = GlobalOpenGL();
+ Pointfile_Clear(GL);
ScopeTimer timer("map save");
SaveReferences();
NaturalTexture();
}
-void Patch::RenderDebug(RenderStateFlags state) const
+void Patch::RenderDebug(OpenGLBinding &GL, RenderStateFlags state) const
{
for (std::size_t i = 0; i < m_tess.m_numStrips; i++) {
glBegin(GL_QUAD_STRIP);
}
}
-void RenderablePatchSolid::RenderNormals() const
+void RenderablePatchSolid::RenderNormals(OpenGLBinding &GL) const
{
const std::size_t width = m_tess.m_numStrips + 1;
const std::size_t height = m_tess.m_lenStrips >> 1;
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
{
#if NV_DRIVER_BUG
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glVertexPointer(3, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_tess.m_vertices.data()->vertex);
const RenderIndex *strip_indices = m_tess.m_indices.data();
{
}
- void RenderNormals() const;
+ void RenderNormals(OpenGLBinding &GL) const;
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
#if 0
if ( ( state & RENDER_FILL ) == 0 ) {
}
#if GDEF_DEBUG
- RenderNormals();
+ RenderNormals(GL);
#endif
}
};
}
- void RenderDebug(RenderStateFlags state) const;
+ void RenderDebug(OpenGLBinding &GL, RenderStateFlags state) const;
void RenderNormals(RenderStateFlags state) const;
void PushPoint(const Vector3 &v);
- void GenerateDisplayList();
+ void GenerateDisplayList(OpenGLBinding &GL);
// SAX interface
void Release()
return m_displaylist != 0;
}
- void show(bool show)
+ void show(OpenGLBinding &GL, bool show)
{
if (show && !shown()) {
Pointfile_Parse(*this);
- GenerateDisplayList();
+ GenerateDisplayList(GL);
SceneChangeNotify();
} else if (!show && shown()) {
glDeleteLists(m_displaylist, 1);
}
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glCallList(m_displaylist);
}
}
// create the display list at the end
-void CPointfile::GenerateDisplayList()
+void CPointfile::GenerateDisplayList(OpenGLBinding &GL)
{
m_displaylist = glGenLists(1);
g_free(text);
}
-void Pointfile_Clear()
+void Pointfile_Clear(OpenGLBinding &GL)
{
- s_pointfile.show(false);
+ s_pointfile.show(GL, false);
}
void Pointfile_Toggle()
{
- s_pointfile.show(!s_pointfile.shown());
+ OpenGLBinding &GL = GlobalOpenGL();
+ s_pointfile.show(GL, !s_pointfile.shown());
s_check_point = s_pointfile.begin();
}
{
if (string_equal(reinterpret_cast<const char *>( name ), "polyline")) {
// we are done
- GenerateDisplayList();
+ OpenGLBinding &GL = GlobalOpenGL();
+ GenerateDisplayList(GL);
SceneChangeNotify();
s_check_point = begin();
} else if (string_equal(reinterpret_cast<const char *>( name ), "point")) {
#if !defined( INCLUDED_POINTS_H )
#define INCLUDED_POINTS_H
-void Pointfile_Clear();
+struct OpenGLBinding;
+
+void Pointfile_Clear(OpenGLBinding &GL);
void Pointfile_Delete(void);
#define EXTENSIONS_ENABLED 1
-bool QGL_ExtensionSupported(const char *extension)
+bool QGL_ExtensionSupported(OpenGLBinding &GL, const char *extension)
{
#if EXTENSIONS_ENABLED
const GLubyte *extensions = 0;
return false;
}
- extensions = GlobalOpenGL().m_glGetString(GL_EXTENSIONS);
+ extensions = GL.m_glGetString(GL_EXTENSIONS);
#if !GDEF_OS_MACOS
if (!extensions) {
return false;
int g_qglMinorVersion = 0;
// requires a valid gl context
-void QGL_InitVersion()
+void QGL_InitVersion(OpenGLBinding &GL)
{
#if EXTENSIONS_ENABLED
const std::size_t versionSize = 256;
char version[versionSize];
- strncpy(version, reinterpret_cast<const char *>( GlobalOpenGL().m_glGetString(GL_VERSION)), versionSize - 1);
+ strncpy(version, reinterpret_cast<const char *>( GL.m_glGetString(GL_VERSION)), versionSize - 1);
version[versionSize - 1] = '\0';
char *firstDot = strchr(version, '.');
ASSERT_NOTNULL(firstDot);
void QGL_sharedContextCreated(OpenGLBinding &table)
{
- QGL_InitVersion();
+ QGL_InitVersion(table);
table.major_version = g_qglMajorVersion;
table.minor_version = g_qglMinorVersion;
table.m_glVertexPointer = glVertexPointer;
table.m_glViewport = glViewport;
- if (QGL_ExtensionSupported("GL_ARB_multitexture")) {
+ if (QGL_ExtensionSupported(table, "GL_ARB_multitexture")) {
table.support_ARB_multitexture =
QGL_constructExtensionFunc(table.m_glActiveTextureARB, "glActiveTextureARB")
&& QGL_constructExtensionFunc(table.m_glClientActiveTextureARB, "glClientActiveTextureARB")
table.support_ARB_multitexture = false;
}
- if (QGL_ExtensionSupported("GL_ARB_texture_compression")) {
+ if (QGL_ExtensionSupported(table, "GL_ARB_texture_compression")) {
table.support_ARB_texture_compression =
QGL_constructExtensionFunc(table.m_glCompressedTexImage3DARB, "glCompressedTexImage3DARB")
&& QGL_constructExtensionFunc(table.m_glCompressedTexImage2DARB, "glCompressedTexImage2DARB")
table.support_ARB_texture_compression = false;
}
- table.support_EXT_texture_compression_s3tc = QGL_ExtensionSupported("GL_EXT_texture_compression_s3tc");
+ table.support_EXT_texture_compression_s3tc = QGL_ExtensionSupported(table, "GL_EXT_texture_compression_s3tc");
// GL 1.2
if (table.major_version > 1 || table.minor_version >= 2) {
}
- if (QGL_ExtensionSupported("GL_ARB_vertex_program")) {
+ if (QGL_ExtensionSupported(table, "GL_ARB_vertex_program")) {
table.support_ARB_vertex_program =
QGL_constructExtensionFunc(table.m_glVertexAttrib1sARB, "glVertexAttrib1sARB")
&& QGL_constructExtensionFunc(table.m_glVertexAttrib1fARB, "glVertexAttrib1fARB")
}
- table.support_ARB_fragment_program = QGL_ExtensionSupported("GL_ARB_fragment_program");
+ table.support_ARB_fragment_program = QGL_ExtensionSupported(table, "GL_ARB_fragment_program");
- if (QGL_ExtensionSupported("GL_ARB_shader_objects")) {
+ if (QGL_ExtensionSupported(table, "GL_ARB_shader_objects")) {
table.support_ARB_shader_objects =
QGL_constructExtensionFunc(table.m_glDeleteObjectARB, "glDeleteObjectARB")
&& QGL_constructExtensionFunc(table.m_glGetHandleARB, "glGetHandleARB")
table.support_ARB_shader_objects = false;
}
- if (QGL_ExtensionSupported("GL_ARB_vertex_shader")) {
+ if (QGL_ExtensionSupported(table, "GL_ARB_vertex_shader")) {
table.support_ARB_vertex_shader =
QGL_constructExtensionFunc(table.m_glVertexAttrib1fARB, "glVertexAttrib1fARB")
&& QGL_constructExtensionFunc(table.m_glVertexAttrib1sARB, "glVertexAttrib1sARB")
table.support_ARB_vertex_shader = false;
}
- if (QGL_ExtensionSupported("GL_NV_vertex_program2")) {
+ if (QGL_ExtensionSupported(table, "GL_NV_vertex_program2")) {
table.support_NV_vertex_program2 =
QGL_constructExtensionFunc(table.m_glAreProgramsResidentNV, "glAreProgramsResidentNV")
&& QGL_constructExtensionFunc(table.m_glBindProgramNV, "glBindProgramNV")
QGL_invalidateExtensionFunc(table.m_glVertexAttribs4fvNV);
}
- if (QGL_ExtensionSupported("GL_NV_fragment_program")) {
+ if (QGL_ExtensionSupported(table, "GL_NV_fragment_program")) {
table.support_NV_fragment_program =
QGL_constructExtensionFunc(table.m_glProgramNamedParameter4fNV, "glProgramNamedParameter4fNV")
&& QGL_constructExtensionFunc(table.m_glProgramNamedParameter4fvNV, "glProgramNamedParameter4fvNV")
table.support_NV_fragment_program = false;
}
- table.support_ARB_fragment_shader = QGL_ExtensionSupported("GL_ARB_fragment_shader");
- table.support_ARB_shading_language_100 = QGL_ExtensionSupported("GL_ARB_shading_language_100");
+ table.support_ARB_fragment_shader = QGL_ExtensionSupported(table, "GL_ARB_fragment_shader");
+ table.support_ARB_shading_language_100 = QGL_ExtensionSupported(table, "GL_ARB_shading_language_100");
- if (QGL_ExtensionSupported("GL_EXT_texture_filter_anisotropic")) {
+ if (QGL_ExtensionSupported(table, "GL_EXT_texture_filter_anisotropic")) {
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &g_maxTextureAnisotropy);
globalOutputStream() << "Anisotropic filtering possible (max " << g_maxTextureAnisotropy << "x)\n";
} else {
}
-void QGL_assertNoErrors(const char *file, int line)
+void QGL_assertNoErrors(OpenGLBinding &GL, const char *file, int line)
{
- GLenum error = GlobalOpenGL().m_glGetError();
+ GLenum error = GL.m_glGetError();
while (error != GL_NO_ERROR) {
const char *errorString = reinterpret_cast<const char *>( qgluErrorString(error));
if (error == GL_OUT_OF_MEMORY) {
} else {
ERROR_MESSAGE("OpenGL error at " << file << ":" << line << ": " << errorString);
}
- error = GlobalOpenGL().m_glGetError();
+ error = GL.m_glGetError();
}
}
{
QGL_Init(m_qgl);
- m_qgl.assertNoErrors = &QGL_assertNoErrors;
+ m_qgl.assertNoErrors_ = &QGL_assertNoErrors;
}
~QglAPI()
void QGL_sharedContextDestroyed(OpenGLBinding &table);
-bool QGL_ExtensionSupported(const char *extension);
+bool QGL_ExtensionSupported(OpenGLBinding &GL, const char *extension);
float QGL_maxTextureAnisotropy();
}
-void printShaderLog(GLhandleARB object)
+void printShaderLog(OpenGLBinding &GL, GLhandleARB object)
{
GLint log_length = 0;
glGetObjectParameterivARB(object, GL_OBJECT_INFO_LOG_LENGTH_ARB, &log_length);
globalErrorStream() << StringRange(log.begin(), log.begin() + log_length) << "\n";
}
-void createShader(GLhandleARB program, const char *filename, GLenum type)
+void createShader(OpenGLBinding &GL, GLhandleARB program, const char *filename, GLenum type)
{
GLhandleARB shader = glCreateShaderObjectARB(type);
GlobalOpenGL_debugAssertNoErrors();
glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &compiled);
if (!compiled) {
- printShaderLog(shader);
+ printShaderLog(GL, shader);
}
ASSERT_MESSAGE(compiled, "shader compile failed: " << makeQuoted(filename));
GlobalOpenGL_debugAssertNoErrors();
}
-void GLSLProgram_link(GLhandleARB program)
+void GLSLProgram_link(OpenGLBinding &GL, GLhandleARB program)
{
glLinkProgramARB(program);
glGetObjectParameterivARB(program, GL_OBJECT_LINK_STATUS_ARB, &linked);
if (!linked) {
- printShaderLog(program);
+ printShaderLog(GL, program);
}
ASSERT_MESSAGE(linked, "program link failed");
}
-void GLSLProgram_validate(GLhandleARB program)
+void GLSLProgram_validate(OpenGLBinding &GL, GLhandleARB program)
{
glValidateProgramARB(program);
glGetObjectParameterivARB(program, GL_OBJECT_VALIDATE_STATUS_ARB, &validated);
if (!validated) {
- printShaderLog(program);
+ printShaderLog(GL, program);
}
ASSERT_MESSAGE(validated, "program validation failed");
{
}
- void create()
+ void create(OpenGLBinding &GL)
{
// create program
m_program = glCreateProgramObjectARB();
{
StringOutputStream filename(256);
filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.glsl";
- createShader(m_program, filename.c_str(), GL_VERTEX_SHADER_ARB);
+ createShader(GL, m_program, filename.c_str(), GL_VERTEX_SHADER_ARB);
filename.clear();
filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.glsl";
- createShader(m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB);
+ createShader(GL, m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB);
}
- GLSLProgram_link(m_program);
- GLSLProgram_validate(m_program);
+ GLSLProgram_link(GL, m_program);
+ GLSLProgram_validate(GL, m_program);
glUseProgramObjectARB(m_program);
GlobalOpenGL_debugAssertNoErrors();
}
- void destroy()
+ void destroy(OpenGLBinding &GL)
{
glDeleteObjectARB(m_program);
m_program = 0;
}
- void enable()
+ void enable(OpenGLBinding &GL)
{
glUseProgramObjectARB(m_program);
g_bumpGLSLPass_enabled = true;
}
- void disable()
+ void disable(OpenGLBinding &GL)
{
glUseProgramObjectARB(0);
g_bumpGLSLPass_enabled = false;
}
- void setParameters(const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
+ void setParameters(OpenGLBinding &GL, const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
const Matrix4 &world2light)
{
Matrix4 world2local(localToWorld);
public:
GLhandleARB m_program;
- void create()
+ void create(OpenGLBinding &GL)
{
// create program
m_program = glCreateProgramObjectARB();
{
StringOutputStream filename(256);
filename << GlobalRadiant().getAppPath() << "gl/zfill_vp.glsl";
- createShader(m_program, filename.c_str(), GL_VERTEX_SHADER_ARB);
+ createShader(GL, m_program, filename.c_str(), GL_VERTEX_SHADER_ARB);
filename.clear();
filename << GlobalRadiant().getAppPath() << "gl/zfill_fp.glsl";
- createShader(m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB);
+ createShader(GL, m_program, filename.c_str(), GL_FRAGMENT_SHADER_ARB);
}
- GLSLProgram_link(m_program);
- GLSLProgram_validate(m_program);
+ GLSLProgram_link(GL, m_program);
+ GLSLProgram_validate(GL, m_program);
GlobalOpenGL_debugAssertNoErrors();
}
- void destroy()
+ void destroy(OpenGLBinding &GL)
{
glDeleteObjectARB(m_program);
m_program = 0;
}
- void enable()
+ void enable(OpenGLBinding &GL)
{
glUseProgramObjectARB(m_program);
GlobalOpenGL_debugAssertNoErrors();
g_depthfillPass_enabled = true;
}
- void disable()
+ void disable(OpenGLBinding &GL)
{
glUseProgramObjectARB(0);
GlobalOpenGL_debugAssertNoErrors();
g_depthfillPass_enabled = false;
}
- void setParameters(const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
+ void setParameters(OpenGLBinding &GL, const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
const Matrix4 &world2light)
{
}
// ARB path
-void createProgram(const char *filename, GLenum type)
+void createProgram(OpenGLBinding &GL, const char *filename, GLenum type)
{
std::size_t size = file_size(filename);
FileInputStream file(filename);
GLuint m_vertex_program;
GLuint m_fragment_program;
- void create()
+ void create(OpenGLBinding &GL)
{
glEnable(GL_VERTEX_PROGRAM_ARB);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, m_vertex_program);
StringOutputStream filename(256);
filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_vp.glp";
- createProgram(filename.c_str(), GL_VERTEX_PROGRAM_ARB);
+ createProgram(GL, filename.c_str(), GL_VERTEX_PROGRAM_ARB);
glGenProgramsARB(1, &m_fragment_program);
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_fragment_program);
filename.clear();
filename << GlobalRadiant().getAppPath() << "gl/lighting_DBS_omni_fp.glp";
- createProgram(filename.c_str(), GL_FRAGMENT_PROGRAM_ARB);
+ createProgram(GL, filename.c_str(), GL_FRAGMENT_PROGRAM_ARB);
}
glDisable(GL_VERTEX_PROGRAM_ARB);
GlobalOpenGL_debugAssertNoErrors();
}
- void destroy()
+ void destroy(OpenGLBinding &GL)
{
glDeleteProgramsARB(1, &m_vertex_program);
glDeleteProgramsARB(1, &m_fragment_program);
GlobalOpenGL_debugAssertNoErrors();
}
- void enable()
+ void enable(OpenGLBinding &GL)
{
glEnable(GL_VERTEX_PROGRAM_ARB);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
GlobalOpenGL_debugAssertNoErrors();
}
- void disable()
+ void disable(OpenGLBinding &GL)
{
glDisable(GL_VERTEX_PROGRAM_ARB);
glDisable(GL_FRAGMENT_PROGRAM_ARB);
GlobalOpenGL_debugAssertNoErrors();
}
- void setParameters(const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
+ void setParameters(OpenGLBinding &GL, const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
const Matrix4 &world2light)
{
Matrix4 world2local(localToWorld);
GLuint m_vertex_program;
GLuint m_fragment_program;
- void create()
+ void create(OpenGLBinding &GL)
{
glEnable(GL_VERTEX_PROGRAM_ARB);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, m_vertex_program);
StringOutputStream filename(256);
filename << GlobalRadiant().getAppPath() << "gl/zfill_vp.glp";
- createProgram(filename.c_str(), GL_VERTEX_PROGRAM_ARB);
+ createProgram(GL, filename.c_str(), GL_VERTEX_PROGRAM_ARB);
glGenProgramsARB(1, &m_fragment_program);
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_fragment_program);
filename.clear();
filename << GlobalRadiant().getAppPath() << "gl/zfill_fp.glp";
- createProgram(filename.c_str(), GL_FRAGMENT_PROGRAM_ARB);
+ createProgram(GL, filename.c_str(), GL_FRAGMENT_PROGRAM_ARB);
}
glDisable(GL_VERTEX_PROGRAM_ARB);
GlobalOpenGL_debugAssertNoErrors();
}
- void destroy()
+ void destroy(OpenGLBinding &GL)
{
glDeleteProgramsARB(1, &m_vertex_program);
glDeleteProgramsARB(1, &m_fragment_program);
GlobalOpenGL_debugAssertNoErrors();
}
- void enable()
+ void enable(OpenGLBinding &GL)
{
glEnable(GL_VERTEX_PROGRAM_ARB);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
GlobalOpenGL_debugAssertNoErrors();
}
- void disable()
+ void disable(OpenGLBinding &GL)
{
glDisable(GL_VERTEX_PROGRAM_ARB);
glDisable(GL_FRAGMENT_PROGRAM_ARB);
GlobalOpenGL_debugAssertNoErrors();
}
- void setParameters(const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
+ void setParameters(OpenGLBinding &GL, const Vector3 &viewer, const Matrix4 &localToWorld, const Vector3 &origin, const Vector3 &colour,
const Matrix4 &world2light)
{
}
return m_state;
}
- void render(OpenGLState ¤t, unsigned int globalstate, const Vector3 &viewer);
+ void render(OpenGLBinding &GL, OpenGLState ¤t, unsigned int globalstate, const Vector3 &viewer);
};
#define LIGHT_SHADER_DEBUG 0
}
};
-inline void setFogState(const OpenGLFogState &state)
+inline void setFogState(OpenGLBinding &GL, const OpenGLFogState &state)
{
glFogi(GL_FOG_MODE, state.mode);
glFogf(GL_FOG_DENSITY, state.density);
}
void
- render(RenderStateFlags globalstate, const Matrix4 &modelview, const Matrix4 &projection, const Vector3 &viewer)
+ render(OpenGLBinding &GL, RenderStateFlags globalstate, const Matrix4 &modelview, const Matrix4 &projection, const Vector3 &viewer)
{
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(reinterpret_cast<const float *>( &projection ));
g_vertexArray_enabled = true;
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
- if (GlobalOpenGL().GL_1_3()) {
+ if (GL.GL_1_3()) {
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
}
- if (GlobalOpenGL().ARB_shader_objects()) {
+ if (GL.ARB_shader_objects()) {
glUseProgramObjectARB(0);
glDisableVertexAttribArrayARB(c_attr_TexCoord0);
glDisableVertexAttribArrayARB(c_attr_Tangent);
glHint(GL_FOG_HINT, GL_NICEST);
glDisable(GL_FOG);
- setFogState(OpenGLFogState());
+ setFogState(GL, OpenGLFogState());
GlobalOpenGL_debugAssertNoErrors();
debug_string("begin rendering");
for (OpenGLStates::iterator i = g_state_sorted.begin(); i != g_state_sorted.end(); ++i) {
- (*i).second->render(current, globalstate, viewer);
+ (*i).second->render(GL, current, globalstate, viewer);
}
debug_string("end rendering");
}
void realise()
{
+ OpenGLBinding &GL = GlobalOpenGL();
if (--m_unrealised == 0) {
if (lightingSupported() && lightingEnabled()) {
if (useShaderLanguage()) {
- g_bumpGLSL.create();
- g_depthFillGLSL.create();
+ g_bumpGLSL.create(GL);
+ g_depthFillGLSL.create(GL);
} else {
- g_bumpARB.create();
- g_depthFillARB.create();
+ g_bumpARB.create(GL);
+ g_depthFillARB.create(GL);
}
}
void unrealise()
{
+ OpenGLBinding &GL = GlobalOpenGL();
if (++m_unrealised == 1) {
for (Shaders::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i) {
if (!(*i).value.empty()) {
(*i).value->unrealise();
}
}
- if (GlobalOpenGL().contextValid && lightingSupported() && lightingEnabled()) {
+ if (GL.contextValid && lightingSupported() && lightingEnabled()) {
if (useShaderLanguage()) {
- g_bumpGLSL.destroy();
- g_depthFillGLSL.destroy();
+ g_bumpGLSL.destroy(GL);
+ g_depthFillGLSL.destroy(GL);
} else {
- g_bumpARB.destroy();
- g_depthFillARB.destroy();
+ g_bumpARB.destroy(GL);
+ g_depthFillARB.destroy(GL);
}
}
}
}
}
- void extensionsInitialised()
+ void extensionsInitialised(OpenGLBinding &GL)
{
- setLighting(GlobalOpenGL().GL_1_3()
- && GlobalOpenGL().ARB_vertex_program()
- && GlobalOpenGL().ARB_fragment_program()
- && GlobalOpenGL().ARB_shader_objects()
- && GlobalOpenGL().ARB_vertex_shader()
- && GlobalOpenGL().ARB_fragment_shader()
- && GlobalOpenGL().ARB_shading_language_100(),
+ setLighting(GL.GL_1_3()
+ && GL.ARB_vertex_program()
+ && GL.ARB_fragment_program()
+ && GL.ARB_shader_objects()
+ && GL.ARB_vertex_shader()
+ && GL.ARB_fragment_shader()
+ && GL.ARB_shading_language_100(),
m_lightingEnabled
);
if (!lightingSupported()) {
globalOutputStream() << "Lighting mode requires OpenGL features not supported by your graphics drivers:\n";
- if (!GlobalOpenGL().GL_1_3()) {
+ if (!GL.GL_1_3()) {
globalOutputStream() << " GL version 1.3 or better\n";
}
- if (!GlobalOpenGL().ARB_vertex_program()) {
+ if (!GL.ARB_vertex_program()) {
globalOutputStream() << " GL_ARB_vertex_program\n";
}
- if (!GlobalOpenGL().ARB_fragment_program()) {
+ if (!GL.ARB_fragment_program()) {
globalOutputStream() << " GL_ARB_fragment_program\n";
}
- if (!GlobalOpenGL().ARB_shader_objects()) {
+ if (!GL.ARB_shader_objects()) {
globalOutputStream() << " GL_ARB_shader_objects\n";
}
- if (!GlobalOpenGL().ARB_vertex_shader()) {
+ if (!GL.ARB_vertex_shader()) {
globalOutputStream() << " GL_ARB_vertex_shader\n";
}
- if (!GlobalOpenGL().ARB_fragment_shader()) {
+ if (!GL.ARB_fragment_shader()) {
globalOutputStream() << " GL_ARB_fragment_shader\n";
}
- if (!GlobalOpenGL().ARB_shading_language_100()) {
+ if (!GL.ARB_shading_language_100()) {
globalOutputStream() << " GL_ARB_shading_language_100\n";
}
}
static OpenGLShaderCache *g_ShaderCache;
-void ShaderCache_extensionsInitialised()
+void ShaderCache_extensionsInitialised(OpenGLBinding &GL)
{
- g_ShaderCache->extensionsInitialised();
+ g_ShaderCache->extensionsInitialised(GL);
}
void ShaderCache_setBumpEnabled(bool enabled)
return g_ShaderCache;
}
-inline void setTextureState(GLint ¤t, const GLint &texture, GLenum textureUnit)
+inline void setTextureState(OpenGLBinding &GL, GLint ¤t, const GLint &texture, GLenum textureUnit)
{
if (texture != current) {
glActiveTexture(textureUnit);
}
}
-inline void setTextureState(GLint ¤t, const GLint &texture)
+inline void setTextureState(OpenGLBinding &GL, GLint ¤t, const GLint &texture)
{
if (texture != current) {
glBindTexture(GL_TEXTURE_2D, texture);
}
}
-inline void setState(unsigned int state, unsigned int delta, unsigned int flag, GLenum glflag)
+inline void setState(OpenGLBinding &GL, unsigned int state, unsigned int delta, unsigned int flag, GLenum glflag)
{
if (delta & state & flag) {
glEnable(glflag);
}
}
-void OpenGLState_apply(const OpenGLState &self, OpenGLState ¤t, unsigned int globalstate)
+void OpenGLState_apply(const OpenGLState &self, OpenGLState ¤t, unsigned int globalstate, OpenGLBinding &GL)
{
debug_int("sort", int(self.m_sort));
debug_int("texture", self.m_texture);
if (program != current.m_program) {
if (current.m_program != 0) {
- current.m_program->disable();
+ current.m_program->disable(GL);
glColor4fv(vector4_to_array(current.m_colour));
debug_colour("cleaning program");
}
current.m_program = program;
if (current.m_program != 0) {
- current.m_program->enable();
+ current.m_program->enable(GL);
}
}
GlobalOpenGL_debugAssertNoErrors();
}
- setState(state, delta, RENDER_OFFSETLINE, GL_POLYGON_OFFSET_LINE);
+ setState(GL, state, delta, RENDER_OFFSETLINE, GL_POLYGON_OFFSET_LINE);
if (delta & state & RENDER_LIGHTING) {
glEnable(GL_LIGHTING);
if (delta & state & RENDER_TEXTURE) {
GlobalOpenGL_debugAssertNoErrors();
- if (GlobalOpenGL().GL_1_3()) {
+ if (GL.GL_1_3()) {
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
}
GlobalOpenGL_debugAssertNoErrors();
g_texcoordArray_enabled = true;
} else if (delta & ~state & RENDER_TEXTURE) {
- if (GlobalOpenGL().GL_1_3()) {
+ if (GL.GL_1_3()) {
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
}
// this could get better if you can get glTexEnviv (GL_TEXTURE_ENV, to work .. patches are welcome
glEnable(GL_BLEND);
- if (GlobalOpenGL().GL_1_3()) {
+ if (GL.GL_1_3()) {
glActiveTexture(GL_TEXTURE0);
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
GlobalOpenGL_debugAssertNoErrors();
} else if (delta & ~state & RENDER_BLEND) {
glDisable(GL_BLEND);
- if (GlobalOpenGL().GL_1_3()) {
+ if (GL.GL_1_3()) {
glActiveTexture(GL_TEXTURE0);
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
GlobalOpenGL_debugAssertNoErrors();
}
- setState(state, delta, RENDER_CULLFACE, GL_CULL_FACE);
+ setState(GL, state, delta, RENDER_CULLFACE, GL_CULL_FACE);
if (delta & state & RENDER_SMOOTH) {
glShadeModel(GL_SMOOTH);
GlobalOpenGL_debugAssertNoErrors();
}
- setState(state, delta, RENDER_SCALED, GL_NORMALIZE); // not GL_RESCALE_NORMAL
+ setState(GL, state, delta, RENDER_SCALED, GL_NORMALIZE); // not GL_RESCALE_NORMAL
- setState(state, delta, RENDER_DEPTHTEST, GL_DEPTH_TEST);
+ setState(GL, state, delta, RENDER_DEPTHTEST, GL_DEPTH_TEST);
if (delta & state & RENDER_DEPTHWRITE) {
glDepthMask(GL_TRUE);
GlobalOpenGL_debugAssertNoErrors();
}
- setState(state, delta, RENDER_ALPHATEST, GL_ALPHA_TEST);
+ setState(GL, state, delta, RENDER_ALPHATEST, GL_ALPHA_TEST);
if (delta & state & RENDER_COLOURARRAY) {
glEnableClientState(GL_COLOR_ARRAY);
GlobalOpenGL_debugAssertNoErrors();
}
- setState(state, delta, RENDER_LINESTIPPLE, GL_LINE_STIPPLE);
- setState(state, delta, RENDER_LINESMOOTH, GL_LINE_SMOOTH);
+ setState(GL, state, delta, RENDER_LINESTIPPLE, GL_LINE_STIPPLE);
+ setState(GL, state, delta, RENDER_LINESMOOTH, GL_LINE_SMOOTH);
- setState(state, delta, RENDER_POLYGONSTIPPLE, GL_POLYGON_STIPPLE);
- setState(state, delta, RENDER_POLYGONSMOOTH, GL_POLYGON_SMOOTH);
+ setState(GL, state, delta, RENDER_POLYGONSTIPPLE, GL_POLYGON_STIPPLE);
+ setState(GL, state, delta, RENDER_POLYGONSMOOTH, GL_POLYGON_SMOOTH);
- setState(state, delta, RENDER_FOG, GL_FOG);
+ setState(GL, state, delta, RENDER_FOG, GL_FOG);
if ((state & RENDER_FOG) != 0) {
- setFogState(self.m_fog);
+ setFogState(GL, self.m_fog);
GlobalOpenGL_debugAssertNoErrors();
current.m_fog = self.m_fog;
}
texture7 = self.m_texture7;
}
- if (GlobalOpenGL().GL_1_3()) {
- setTextureState(current.m_texture, texture0, GL_TEXTURE0);
- setTextureState(current.m_texture1, texture1, GL_TEXTURE1);
- setTextureState(current.m_texture2, texture2, GL_TEXTURE2);
- setTextureState(current.m_texture3, texture3, GL_TEXTURE3);
- setTextureState(current.m_texture4, texture4, GL_TEXTURE4);
- setTextureState(current.m_texture5, texture5, GL_TEXTURE5);
- setTextureState(current.m_texture6, texture6, GL_TEXTURE6);
- setTextureState(current.m_texture7, texture7, GL_TEXTURE7);
+ if (GL.GL_1_3()) {
+ setTextureState(GL, current.m_texture, texture0, GL_TEXTURE0);
+ setTextureState(GL, current.m_texture1, texture1, GL_TEXTURE1);
+ setTextureState(GL, current.m_texture2, texture2, GL_TEXTURE2);
+ setTextureState(GL, current.m_texture3, texture3, GL_TEXTURE3);
+ setTextureState(GL, current.m_texture4, texture4, GL_TEXTURE4);
+ setTextureState(GL, current.m_texture5, texture5, GL_TEXTURE5);
+ setTextureState(GL, current.m_texture6, texture6, GL_TEXTURE6);
+ setTextureState(GL, current.m_texture7, texture7, GL_TEXTURE7);
} else {
- setTextureState(current.m_texture, texture0);
+ setTextureState(GL, current.m_texture, texture0);
}
}
GlobalOpenGL_debugAssertNoErrors();
}
-void Renderables_flush(OpenGLStateBucket::Renderables &renderables, OpenGLState ¤t, unsigned int globalstate,
+void Renderables_flush(OpenGLBinding &GL, OpenGLStateBucket::Renderables &renderables, OpenGLState ¤t, unsigned int globalstate,
const Vector3 &viewer)
{
const Matrix4 *transform = 0;
? lightShader.lightFalloffImage()->texture_number
: static_cast<OpenGLShader *>( g_defaultPointLight )->getShader().lightFalloffImage()->texture_number;
- setTextureState(current.m_texture3, attenuation_xy, GL_TEXTURE3);
+ setTextureState(GL, current.m_texture3, attenuation_xy, GL_TEXTURE3);
glActiveTexture(GL_TEXTURE3);
glBindTexture(GL_TEXTURE_2D, attenuation_xy);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
- setTextureState(current.m_texture4, attenuation_z, GL_TEXTURE4);
+ setTextureState(GL, current.m_texture4, attenuation_z, GL_TEXTURE4);
glActiveTexture(GL_TEXTURE4);
glBindTexture(GL_TEXTURE_2D, attenuation_z);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
matrix4_translate_by_vec3(world2light, vector3_negated(lightBounds.origin)); // world->lightBounds
}
- current.m_program->setParameters(viewer, *(*i).m_transform, lightBounds.origin + (*i).m_light->offset(),
+ current.m_program->setParameters(GL, viewer, *(*i).m_transform, lightBounds.origin + (*i).m_light->offset(),
(*i).m_light->colour(), world2light);
debug_string("set lightBounds parameters");
}
}
- (*i).m_renderable->render(current.m_state);
+ (*i).m_renderable->render(GL, current.m_state);
}
glPopMatrix();
renderables.clear();
}
-void OpenGLStateBucket::render(OpenGLState ¤t, unsigned int globalstate, const Vector3 &viewer)
+void OpenGLStateBucket::render(OpenGLBinding &GL, OpenGLState ¤t, unsigned int globalstate, const Vector3 &viewer)
{
if ((globalstate & m_state.m_state & RENDER_SCREEN) != 0) {
- OpenGLState_apply(m_state, current, globalstate);
+ OpenGLState_apply(m_state, current, globalstate, GL);
debug_colour("screen fill");
glMatrixMode(GL_PROJECTION);
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
} else if (!m_renderables.empty()) {
- OpenGLState_apply(m_state, current, globalstate);
- Renderables_flush(m_renderables, current, globalstate, viewer);
+ OpenGLState_apply(m_state, current, globalstate, GL);
+ Renderables_flush(GL, m_renderables, current, globalstate, viewer);
}
}
#if !defined( INCLUDED_RENDERSTATE_H )
#define INCLUDED_RENDERSTATE_H
+struct OpenGLBinding;
+
void ShaderCache_setBumpEnabled(bool enabled);
-void ShaderCache_extensionsInitialised();
+void ShaderCache_extensionsInitialised(OpenGLBinding &GL);
#endif
public:
Matrix4 m_world;
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
for (std::size_t i = 0; i < m_primitives.size(); ++i) {
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_primitives[i].m_points[0].colour);
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_vertices.data()->colour);
glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_vertices.data()->vertex);
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_vertices.data()->colour);
glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_vertices.data()->vertex);
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_line[0].colour);
glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_line[0].vertex);
{
}
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(FlatShadedVertex), &m_vertices.data()->colour);
glVertexPointer(3, GL_FLOAT, sizeof(FlatShadedVertex), &m_vertices.data()->vertex);
struct RenderableQuad : public OpenGLRenderable {
PointVertex m_quad[4];
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_quad[0].colour);
glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_quad[0].vertex);
struct RenderableArrow : public OpenGLRenderable {
PointVertex m_line[2];
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_line[0].colour);
glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_line[0].vertex);
struct RenderableQuad : public OpenGLRenderable {
PointVertex m_quad[4];
- void render(RenderStateFlags state) const
+ void render(OpenGLBinding &GL, RenderStateFlags state) const
{
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), &m_quad[0].colour);
glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), &m_quad[0].vertex);
class TextureBrowser;
-extern TextureBrowser g_TextureBrowser;
-
void TextureBrowser_SetSelectedShader(TextureBrowser &textureBrowser, const char *shader);
const char *TextureBrowser_GetSelectedShader(TextureBrowser &textureBrowser);
void Scene_copyClosestTexture(SelectionTest &test)
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
CopiedString shader;
if (Scene_getClosestTexture(GlobalSceneGraph(), test, shader, g_faceTextureClipboard.m_projection,
g_faceTextureClipboard.m_flags)) {
void Scene_applyClosestTexture(SelectionTest &test)
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
UndoableCommand command("facePaintTexture");
Scene_setClosestTexture(GlobalSceneGraph(), test, TextureBrowser_GetSelectedShader(g_TextureBrowser),
face.GetTexdef(g_faceTextureClipboard.m_projection);
g_faceTextureClipboard.m_flags = face.getShader().m_flags;
+ auto &g_TextureBrowser = GlobalTextureBrowser();
TextureBrowser_SetSelectedShader(g_TextureBrowser, face.getShader().getShader());
}
}
void FaceInstance_pasteTexture(FaceInstance &faceInstance)
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
faceInstance.getFace().SetTexdef(g_faceTextureClipboard.m_projection);
faceInstance.getFace().SetShader(TextureBrowser_GetSelectedShader(g_TextureBrowser));
faceInstance.getFace().SetFlags(g_faceTextureClipboard.m_flags);
texture_globals_t g_texture_globals(GL_RGBA);
-void SetTexParameters(ETexturesMode mode)
+void SetTexParameters(OpenGLBinding &GL, ETexturesMode mode)
{
float maxAniso = QGL_maxTextureAnisotropy();
if (maxAniso > 1) {
/// \brief This function does the actual processing of raw RGBA data into a GL texture.
/// It will also resample to power-of-two dimensions, generate the mipmaps and adjust gamma.
-void LoadTextureRGBA(qtexture_t *q, unsigned char *pPixels, int nWidth, int nHeight)
+void LoadTextureRGBA(OpenGLBinding &GL, qtexture_t *q, unsigned char *pPixels, int nWidth, int nHeight)
{
static float fGamma = -1;
float total[3];
glBindTexture(GL_TEXTURE_2D, q->texture_number);
- SetTexParameters(g_texture_mode);
+ SetTexParameters(GL, g_texture_mode);
int gl_width = 1;
while (gl_width < nWidth) {
typedef std::pair<LoadImageCallback, CopiedString> TextureKey;
-void qtexture_realise(qtexture_t &texture, const TextureKey &key)
+void qtexture_realise(OpenGLBinding &GL, qtexture_t &texture, const TextureKey &key)
{
texture.texture_number = 0;
if (!string_empty(key.second.c_str())) {
Image *image = key.first.loadImage(key.second.c_str());
if (image != 0) {
- LoadTextureRGBA(&texture, image->getRGBAPixels(), image->getWidth(), image->getHeight());
+ LoadTextureRGBA(GL, &texture, image->getRGBAPixels(), image->getWidth(), image->getHeight());
texture.surfaceFlags = image->getSurfaceFlags();
texture.contentFlags = image->getContentFlags();
texture.value = image->getValue();
}
}
-void qtexture_unrealise(qtexture_t &texture)
+void qtexture_unrealise(OpenGLBinding &GL, qtexture_t &texture)
{
- if (GlobalOpenGL().contextValid && texture.texture_number != 0) {
+ if (GL.contextValid && texture.texture_number != 0) {
glDeleteTextures(1, &texture.texture_number);
GlobalOpenGL_debugAssertNoErrors();
}
qtexture_t *construct(const TextureKey &key)
{
+ OpenGLBinding &GL = GlobalOpenGL();
qtexture_t *texture = new qtexture_t(key.first, key.second.c_str());
if (m_cache->realised()) {
- qtexture_realise(*texture, key);
+ qtexture_realise(GL, *texture, key);
}
return texture;
}
void destroy(qtexture_t *texture)
{
+ OpenGLBinding &GL = GlobalOpenGL();
if (m_cache->realised()) {
- qtexture_unrealise(*texture);
+ qtexture_unrealise(GL, *texture);
}
delete texture;
}
m_observer = 0;
}
- void realise()
+ void realise(OpenGLBinding &GL)
{
if (--m_unrealised == 0) {
g_texture_globals.bTextureCompressionSupported = false;
- if (GlobalOpenGL().ARB_texture_compression()) {
+ if (GL.ARB_texture_compression()) {
g_texture_globals.bTextureCompressionSupported = true;
g_texture_globals.m_bOpenGLCompressionSupported = true;
}
- if (GlobalOpenGL().EXT_texture_compression_s3tc()) {
+ if (GL.EXT_texture_compression_s3tc()) {
g_texture_globals.bTextureCompressionSupported = true;
g_texture_globals.m_bS3CompressionSupported = true;
}
for (qtextures_t::iterator i = m_qtextures.begin(); i != m_qtextures.end(); ++i) {
if (!(*i).value.empty()) {
- qtexture_realise(*(*i).value, (*i).key);
+ qtexture_realise(GL, *(*i).value, (*i).key);
}
}
if (m_observer != 0) {
}
}
- void unrealise()
+ void unrealise(OpenGLBinding &GL)
{
if (++m_unrealised == 1) {
if (m_observer != 0) {
}
for (qtextures_t::iterator i = m_qtextures.begin(); i != m_qtextures.end(); ++i) {
if (!(*i).value.empty()) {
- qtexture_unrealise(*(*i).value);
+ qtexture_unrealise(GL, *(*i).value);
}
}
}
}
-void Textures_Realise()
+void Textures_Realise(OpenGLBinding &GL)
{
- g_texturesmap->realise();
+ g_texturesmap->realise(GL);
}
-void Textures_Unrealise()
+void Textures_Unrealise(OpenGLBinding &GL)
{
- g_texturesmap->unrealise();
+ g_texturesmap->unrealise(GL);
}
g_texturesModeChangedNotify = notify;
}
-void Textures_ModeChanged()
+void Textures_ModeChanged(OpenGLBinding &GL)
{
if (g_texturesmap->realised()) {
- SetTexParameters(g_texture_mode);
+ SetTexParameters(GL, g_texture_mode);
for (TexturesMap::iterator i = g_texturesmap->begin(); i != g_texturesmap->end(); ++i) {
glBindTexture(GL_TEXTURE_2D, (*i).value->texture_number);
- SetTexParameters(g_texture_mode);
+ SetTexParameters(GL, g_texture_mode);
}
glBindTexture(GL_TEXTURE_2D, 0);
g_texturesModeChangedNotify();
}
-void Textures_SetMode(ETexturesMode mode)
+void Textures_SetMode(OpenGLBinding &GL, ETexturesMode mode)
{
if (g_texture_mode != mode) {
g_texture_mode = mode;
- Textures_ModeChanged();
+ Textures_ModeChanged(GL);
}
}
-void Textures_setTextureComponents(GLint texture_components)
+void Textures_setTextureComponents(OpenGLBinding &GL, GLint texture_components)
{
if (g_texture_globals.texture_components != texture_components) {
- Textures_Unrealise();
+ Textures_Unrealise(GL);
g_texture_globals.texture_components = texture_components;
- Textures_Realise();
+ Textures_Realise(GL);
}
}
void Textures_UpdateTextureCompressionFormat()
{
+ OpenGLBinding &GL = GlobalOpenGL();
GLint texture_components = GL_RGBA;
switch (g_texture_globals.m_nTextureCompressionFormat) {
}
}
- Textures_setTextureComponents(texture_components);
+ Textures_setTextureComponents(GL, texture_components);
}
struct TextureCompression {
static void Import(float &self, float value)
{
+ OpenGLBinding &GL = GlobalOpenGL();
if (value != self) {
- Textures_Unrealise();
+ Textures_Unrealise(GL);
self = value;
- Textures_Realise();
+ Textures_Realise(GL);
}
}
};
static void Import(ETexturesMode &self, int value)
{
+ OpenGLBinding &GL = GlobalOpenGL();
switch (value) {
case 0:
- Textures_SetMode(eTextures_NEAREST);
+ Textures_SetMode(GL, eTextures_NEAREST);
break;
case 1:
- Textures_SetMode(eTextures_NEAREST_MIPMAP_NEAREST);
+ Textures_SetMode(GL, eTextures_NEAREST_MIPMAP_NEAREST);
break;
case 2:
- Textures_SetMode(eTextures_LINEAR);
+ Textures_SetMode(GL, eTextures_LINEAR);
break;
case 3:
- Textures_SetMode(eTextures_NEAREST_MIPMAP_LINEAR);
+ Textures_SetMode(GL, eTextures_NEAREST_MIPMAP_LINEAR);
break;
case 4:
- Textures_SetMode(eTextures_LINEAR_MIPMAP_NEAREST);
+ Textures_SetMode(GL, eTextures_LINEAR_MIPMAP_NEAREST);
break;
case 5:
- Textures_SetMode(eTextures_LINEAR_MIPMAP_LINEAR);
+ Textures_SetMode(GL, eTextures_LINEAR_MIPMAP_LINEAR);
break;
case 6:
- Textures_SetMode(eTextures_MAX_ANISOTROPY);
+ Textures_SetMode(GL, eTextures_MAX_ANISOTROPY);
}
}
};
}
};
-void Textures_Construct()
+void Textures_Construct(OpenGLBinding &GL)
{
g_texturesmap = new TexturesMap;
Textures_registerPreferencesPage();
- Textures_ModeChanged();
+ Textures_ModeChanged(GL);
}
void Textures_Destroy()
TexturesAPI()
{
- Textures_Construct();
+ OpenGLBinding &GL = GlobalOpenGL();
+ Textures_Construct(GL);
m_textures = &GetTexturesCache();
}
#include "generic/callback.h"
-void Textures_Realise();
+struct OpenGLBinding;
-void Textures_Unrealise();
+void Textures_Realise(OpenGLBinding &GL);
-void Textures_sharedContextDestroyed();
+void Textures_Unrealise(OpenGLBinding &GL);
void Textures_setModeChangedNotify(const Callback<void()> ¬ify);
class TextureBrowser {
public:
+ OpenGLBinding &GL;
int width, height;
int originy;
int m_nTotalHeight;
return height;
}
- TextureBrowser() :
+ TextureBrowser(OpenGLBinding &GL) :
+ GL(GL),
m_texture_scroll(ui::null),
m_hideunused_item(TextureBrowserHideUnusedExport()),
m_hidenotex_item(TextureBrowserFilterFallbackExport()),
inline int TextureBrowser_fontHeight(TextureBrowser &textureBrowser)
{
- return GlobalOpenGL().m_font->getPixelHeight();
+ OpenGLBinding &GL = textureBrowser.GL;
+ return GL.m_font->getPixelHeight();
}
const char *TextureBrowser_GetSelectedShader(TextureBrowser &textureBrowser)
*/
void Texture_Draw(TextureBrowser &textureBrowser)
{
+ OpenGLBinding &GL = textureBrowser.GL;
int originy = TextureBrowser_getOriginY(textureBrowser);
glClearColor(textureBrowser.color_textureback[0],
name--;
}
- GlobalOpenGL().drawString(name);
+ GL.drawString(name);
glEnable(GL_TEXTURE_2D);
}
gboolean TextureBrowser_expose(ui::Widget widget, GdkEventExpose *event, TextureBrowser *textureBrowser)
{
+ OpenGLBinding &GL = textureBrowser->GL;
if (glwidget_make_current(textureBrowser->m_gl_widget) != FALSE) {
GlobalOpenGL_debugAssertNoErrors();
TextureBrowser_evaluateHeight(*textureBrowser);
}
-TextureBrowser g_TextureBrowser;
TextureBrowser &GlobalTextureBrowser()
{
+ static TextureBrowser g_TextureBrowser{GlobalOpenGL()};
return g_TextureBrowser;
}
bool TextureBrowser_hideUnused()
{
- return g_TextureBrowser.m_hideUnused;
+ return GlobalTextureBrowser().m_hideUnused;
}
void TextureBrowser_ToggleHideUnused()
{
- if (g_TextureBrowser.m_hideUnused) {
- TextureBrowser_SetHideUnused(g_TextureBrowser, false);
+ if (GlobalTextureBrowser().m_hideUnused) {
+ TextureBrowser_SetHideUnused(GlobalTextureBrowser(), false);
} else {
- TextureBrowser_SetHideUnused(g_TextureBrowser, true);
+ TextureBrowser_SetHideUnused(GlobalTextureBrowser(), true);
}
}
auto store = ui::TreeStore::from(gtk_tree_store_new(1, G_TYPE_STRING));
TextureGroups_constructTreeModel(groups, store);
- gtk_tree_view_set_model(g_TextureBrowser.m_treeViewTree, store);
+ gtk_tree_view_set_model(GlobalTextureBrowser().m_treeViewTree, store);
g_object_unref(G_OBJECT(store));
}
{
TextureGroups groups;
auto store = ui::TreeStore::from(gtk_tree_store_new(1, G_TYPE_STRING));
- auto model = g_TextureBrowser.m_all_tags_list;
+ auto model = GlobalTextureBrowser().m_all_tags_list;
- gtk_tree_view_set_model(g_TextureBrowser.m_treeViewTags, model);
+ gtk_tree_view_set_model(GlobalTextureBrowser().m_treeViewTags, model);
g_object_unref(G_OBJECT(store));
}
strcpy(dirName, buffer);
g_free(buffer);
- g_TextureBrowser.m_searchedTags = false;
+ GlobalTextureBrowser().m_searchedTags = false;
if (!TextureBrowser_showWads()) {
strcat(dirName, "/");
void TextureBrowser_createTreeViewTree()
{
- gtk_tree_view_set_enable_search(g_TextureBrowser.m_treeViewTree, FALSE);
+ gtk_tree_view_set_enable_search(GlobalTextureBrowser().m_treeViewTree, FALSE);
- gtk_tree_view_set_headers_visible(g_TextureBrowser.m_treeViewTree, FALSE);
- g_TextureBrowser.m_treeViewTree.connect("row-activated", (GCallback) TreeView_onRowActivated, NULL);
+ gtk_tree_view_set_headers_visible(GlobalTextureBrowser().m_treeViewTree, FALSE);
+ GlobalTextureBrowser().m_treeViewTree.connect("row-activated", (GCallback) TreeView_onRowActivated, NULL);
auto renderer = ui::CellRendererText(ui::New);
- gtk_tree_view_insert_column_with_attributes(g_TextureBrowser.m_treeViewTree, -1, "", renderer, "text", 0, NULL);
+ gtk_tree_view_insert_column_with_attributes(GlobalTextureBrowser().m_treeViewTree, -1, "", renderer, "text", 0, NULL);
TextureBrowser_constructTreeStore();
}
void TextureBrowser_createTreeViewTags()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
g_TextureBrowser.m_treeViewTags = ui::TreeView(ui::New);
gtk_tree_view_set_enable_search(g_TextureBrowser.m_treeViewTags, FALSE);
create_menu_item_with_mnemonic(menu, "Show All", "ShowAllTextures");
+ auto &g_TextureBrowser = GlobalTextureBrowser();
+
// we always want to show shaders but don't want a "Show Shaders" menu for doom3 and .wad file games
if (g_pGameDescription->mGameType == "doom3" || !string_empty(g_pGameDescription->getKeyValue("show_wads"))) {
g_TextureBrowser.m_showShaders = true;
GSList *node;
gchar *tag_assigned;
+ auto &g_TextureBrowser = GlobalTextureBrowser();
+
auto selection = gtk_tree_view_get_selection(g_TextureBrowser.m_available_tree);
gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc) TextureBrowser_tagMoveHelper,
GSList *node;
gchar *tag;
+ auto &g_TextureBrowser = GlobalTextureBrowser();
+
auto selection = gtk_tree_view_get_selection(g_TextureBrowser.m_assigned_tree);
gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc) TextureBrowser_tagMoveHelper,
void TextureBrowser_buildTagList()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
g_TextureBrowser.m_all_tags_list.clear();
std::set<CopiedString>::iterator iter;
char buffer[256];
char tags_searched[256];
+ auto &g_TextureBrowser = GlobalTextureBrowser();
+
auto selection = gtk_tree_view_get_selection(g_TextureBrowser.m_treeViewTags);
gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc) TextureBrowser_tagMoveHelper,
void TextureBrowser_toggleSearchButton()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
gint page = gtk_notebook_get_current_page(GTK_NOTEBOOK(g_TextureBrowser.m_tag_notebook));
if (page == 0) { // tag page
void TextureBrowser_constructTagNotebook()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
g_TextureBrowser.m_tag_notebook = ui::Widget::from(gtk_notebook_new());
ui::Widget labelTags = ui::Label("Tags");
ui::Widget labelTextures = ui::Label("Textures");
void TextureBrowser_constructSearchButton()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
auto image = ui::Widget::from(gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_TextureBrowser.m_search_button = ui::Button(ui::New);
g_TextureBrowser.m_search_button.connect("clicked", G_CALLBACK(TextureBrowser_searchTags), NULL);
void TextureBrowser_checkTagFile()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
const char SHADERTAG_FILE[] = "shadertags.xml";
CopiedString default_filename, rc_filename;
StringOutputStream stream(256);
g_shadernotex = name.c_str();
}
-ui::Widget TextureBrowser_constructWindow(ui::Window toplevel)
+ui::Widget TextureBrowser_constructWindow(ui::Window toplevel, OpenGLBinding &GL)
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
// The gl_widget and the tag assignment frame should be packed into a GtkVPaned with the slider
// position stored in local.pref. gtk_paned_get_position() and gtk_paned_set_position() don't
// seem to work in gtk 2.4 and the arrow buttons don't handle GTK_FILL, so here's another thing
g_TextureBrowser.m_texture_scroll.visible(g_TextureBrowser.m_showTextureScrollbar);
}
{ // gl_widget
- g_TextureBrowser.m_gl_widget = glwidget_new(FALSE);
+ g_TextureBrowser.m_gl_widget = glwidget_new(GL, FALSE);
g_object_ref(g_TextureBrowser.m_gl_widget._handle);
gtk_widget_set_events(g_TextureBrowser.m_gl_widget,
void TextureBrowser_destroyWindow()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
GlobalShaderSystem().setActiveShadersChangedNotify(Callback<void()>());
g_signal_handler_disconnect(G_OBJECT(g_TextureBrowser.m_gl_widget), g_TextureBrowser.m_sizeHandler);
void TextureBrowser_shaderInfo()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
const char *name = TextureBrowser_GetSelectedShader(g_TextureBrowser);
IShader *shader = QERApp_Shader_ForName(name);
EMessageBoxReturn result = DoShaderTagDlg(&tag, "Add shader tag");
if (result == eIDOK && !tag.empty()) {
+ auto &g_TextureBrowser = GlobalTextureBrowser();
GtkTreeIter iter;
g_TextureBrowser.m_all_tags.insert(tag.c_str());
gtk_list_store_append(g_TextureBrowser.m_available_store, &iter);
void TextureBrowser_renameTag()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
/* WORKAROUND: The tag treeview is set to GTK_SELECTION_MULTIPLE. Because
gtk_tree_selection_get_selected() doesn't work with GTK_SELECTION_MULTIPLE,
we need to count the number of selected rows first and use
void TextureBrowser_deleteTag()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
GSList *selected = NULL;
auto selection = gtk_tree_view_get_selection(g_TextureBrowser.m_treeViewTags);
void TextureBrowser_copyTag()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
g_TextureBrowser.m_copied_tags.clear();
TagBuilder.GetShaderTags(g_TextureBrowser.shader.c_str(), g_TextureBrowser.m_copied_tags);
}
void TextureBrowser_pasteTag()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
IShader *ishader = QERApp_Shader_ForName(g_TextureBrowser.shader.c_str());
CopiedString shader = g_TextureBrowser.shader.c_str();
void TextureBrowser_ToggleShowShaders()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
g_TextureBrowser.m_showShaders ^= 1;
g_TextureBrowser.m_showshaders_item.update();
TextureBrowser_queueDraw(g_TextureBrowser);
void TextureBrowser_ToggleShowShaderListOnly()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
g_TextureBrowser_shaderlistOnly ^= 1;
g_TextureBrowser.m_showshaderlistonly_item.update();
void TextureBrowser_showAll()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
g_TextureBrowser_currentDirectory = "";
g_TextureBrowser.m_searchedTags = false;
TextureBrowser_heightChanged(g_TextureBrowser);
void TextureBrowser_showUntagged()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
auto result = ui::alert(g_TextureBrowser.m_parent,
"WARNING! This function might need a lot of memory and time. Are you sure you want to use it?",
"Show Untagged", ui::alert_type::YESNO, ui::alert_icon::Warning);
struct UniformTextureSize {
static void Export(const TextureBrowser &self, const Callback<void(int)> &returnz)
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
returnz(g_TextureBrowser.m_uniformTextureSize);
}
void TextureBrowser_Construct()
{
+ auto &g_TextureBrowser = GlobalTextureBrowser();
GlobalCommands_insert("ShaderInfo", makeCallbackF(TextureBrowser_shaderInfo));
GlobalCommands_insert("ShowUntagged", makeCallbackF(TextureBrowser_showUntagged));
GlobalCommands_insert("AddTag", makeCallbackF(TextureBrowser_addTag));
TextureBrowser &GlobalTextureBrowser();
-ui::Widget TextureBrowser_constructWindow(ui::Window toplevel);
+struct OpenGLBinding;
+
+ui::Widget TextureBrowser_constructWindow(ui::Window toplevel, OpenGLBinding &GL);
void TextureBrowser_destroyWindow();
#include "grid.h"
#include "windowobservers.h"
-void LoadTextureRGBA(qtexture_t *q, unsigned char *pPixels, int nWidth, int nHeight);
+void LoadTextureRGBA(OpenGLBinding &GL, qtexture_t *q, unsigned char *pPixels, int nWidth, int nHeight);
// d1223m
extern bool g_brush_always_caulk;
};
/*! Draw clip/path point with rasterized number label */
- void Draw(int num, float scale);
+ void Draw(OpenGLBinding &GL, int num, float scale);
/*! Draw clip/path point with rasterized string label */
- void Draw(const char *label, float scale);
+ void Draw(OpenGLBinding &GL, const char *label, float scale);
};
VIEWTYPE g_clip_viewtype;
ClipPoint *g_pMovingClip = 0;
/* Drawing clip points */
-void ClipPoint::Draw(int num, float scale)
+void ClipPoint::Draw(OpenGLBinding &GL, int num, float scale)
{
StringOutputStream label(4);
label << num;
- Draw(label.c_str(), scale);
+ Draw(GL, label.c_str(), scale);
}
-void ClipPoint::Draw(const char *label, float scale)
+void ClipPoint::Draw(OpenGLBinding &GL, const char *label, float scale)
{
// draw point
glPointSize(4);
return bestClip;
}
-inline void GlobalClipPoints_Draw(float scale)
+inline void GlobalClipPoints_Draw(OpenGLBinding &GL, float scale)
{
// Draw clip points
if (g_Clip1.Set()) {
- g_Clip1.Draw(1, scale);
+ g_Clip1.Draw(GL, 1, scale);
}
if (g_Clip2.Set()) {
- g_Clip2.Draw(2, scale);
+ g_Clip2.Draw(GL, 2, scale);
}
if (g_Clip3.Set()) {
- g_Clip3.Draw(3, scale);
+ g_Clip3.Draw(GL, 3, scale);
}
}
gboolean xywnd_expose(ui::Widget widget, GdkEventExpose *event, XYWnd *xywnd)
{
+ OpenGLBinding &GL = xywnd->GL;
if (glwidget_make_current(xywnd->GetWidget()) != FALSE) {
if (Map_Valid(g_map) && ScreenUpdates_Enabled()) {
GlobalOpenGL_debugAssertNoErrors();
}
}
-XYWnd::XYWnd() :
- m_gl_widget(glwidget_new(FALSE)),
+XYWnd::XYWnd(OpenGLBinding &GL) :
+ GL(GL),
+ m_gl_widget(glwidget_new(GL, FALSE)),
m_deferredDraw(WidgetQueueDrawCaller(m_gl_widget)),
m_deferred_motion(xywnd_motion, this),
m_parent(ui::null),
return;
}
g_pParentWnd->ActiveXY()->m_tex = (qtexture_t *) malloc(sizeof(qtexture_t));
- LoadTextureRGBA(g_pParentWnd->ActiveXY()->XYWnd::m_tex, image->getRGBAPixels(), image->getWidth(),
+ LoadTextureRGBA(GL, g_pParentWnd->ActiveXY()->XYWnd::m_tex, image->getRGBAPixels(), image->getWidth(),
image->getHeight());
globalOutputStream() << "Loaded background texture " << relative << "\n";
g_pParentWnd->ActiveXY()->m_backgroundActivated = true;
// now print axis symbols
glColor3fv(vector3_to_array(colourX));
glRasterPos2f(m_vOrigin[nDim1] - w + 55 / m_fScale, m_vOrigin[nDim2] + h - 55 / m_fScale);
- GlobalOpenGL().drawChar(g_AxisName[nDim1]);
+ GL.drawChar(g_AxisName[nDim1]);
glRasterPos2f(28 / m_fScale, -10 / m_fScale);
- GlobalOpenGL().drawChar(g_AxisName[nDim1]);
+ GL.drawChar(g_AxisName[nDim1]);
glColor3fv(vector3_to_array(colourY));
glRasterPos2f(m_vOrigin[nDim1] - w + 25 / m_fScale, m_vOrigin[nDim2] + h - 30 / m_fScale);
- GlobalOpenGL().drawChar(g_AxisName[nDim2]);
+ GL.drawChar(g_AxisName[nDim2]);
glRasterPos2f(-10 / m_fScale, 28 / m_fScale);
- GlobalOpenGL().drawChar(g_AxisName[nDim2]);
+ GL.drawChar(g_AxisName[nDim2]);
}
}
// draw coordinate text if needed
if (g_xywindow_globals_private.show_coordinates) {
glColor4fv(vector4_to_array(Vector4(g_xywindow_globals.color_gridtext, 1.0f)));
- float offx = m_vOrigin[nDim2] + h - (4 + GlobalOpenGL().m_font->getPixelAscent()) / m_fScale;
+ float offx = m_vOrigin[nDim2] + h - (4 + GL.m_font->getPixelAscent()) / m_fScale;
float offy = m_vOrigin[nDim1] - w + 4 / m_fScale;
for (x = xb - fmod(xb, stepx); x <= xe; x += stepx) {
glRasterPos2f(x, offx);
sprintf(text, "%g", x);
- GlobalOpenGL().drawString(text);
+ GL.drawString(text);
}
for (y = yb - fmod(yb, stepy); y <= ye; y += stepy) {
glRasterPos2f(offy, y);
sprintf(text, "%g", y);
- GlobalOpenGL().drawString(text);
+ GL.drawString(text);
}
if (Active()) {
if (!g_xywindow_globals_private.show_axis) {
glRasterPos2f(m_vOrigin[nDim1] - w + 35 / m_fScale, m_vOrigin[nDim2] + h - 20 / m_fScale);
- GlobalOpenGL().drawString(ViewType_getTitle(m_viewType));
+ GL.drawString(ViewType_getTitle(m_viewType));
}
}
y + (g_xywindow_globals_private.blockSize / 2));
sprintf(text, "%i,%i", (int) floor(x / g_xywindow_globals_private.blockSize),
(int) floor(y / g_xywindow_globals_private.blockSize));
- GlobalOpenGL().drawString(text);
+ GL.drawString(text);
}
}
}
glRasterPos3f(Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0f / m_fScale, 0.0f);
dimensions << g_pDimStrings[nDim1] << vSize[nDim1];
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
dimensions.clear();
glRasterPos3f(vMaxBounds[nDim1] + 16.0f / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]), 0.0f);
dimensions << g_pDimStrings[nDim2] << vSize[nDim2];
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
dimensions.clear();
glRasterPos3f(vMinBounds[nDim1] + 4, vMaxBounds[nDim2] + 8 / m_fScale, 0.0f);
dimensions << "(" << g_pOrgStrings[0][0] << vMinBounds[nDim1] << " " << g_pOrgStrings[0][1]
<< vMaxBounds[nDim2] << ")";
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
} else if (m_viewType == XZ) {
glBegin(GL_LINES);
glRasterPos3f(Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), 0, vMinBounds[nDim2] - 20.0f / m_fScale);
dimensions << g_pDimStrings[nDim1] << vSize[nDim1];
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
dimensions.clear();
glRasterPos3f(vMaxBounds[nDim1] + 16.0f / m_fScale, 0, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]));
dimensions << g_pDimStrings[nDim2] << vSize[nDim2];
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
dimensions.clear();
glRasterPos3f(vMinBounds[nDim1] + 4, 0, vMaxBounds[nDim2] + 8 / m_fScale);
dimensions << "(" << g_pOrgStrings[1][0] << vMinBounds[nDim1] << " " << g_pOrgStrings[1][1]
<< vMaxBounds[nDim2] << ")";
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
} else {
glBegin(GL_LINES);
glRasterPos3f(0, Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0f / m_fScale);
dimensions << g_pDimStrings[nDim1] << vSize[nDim1];
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
dimensions.clear();
glRasterPos3f(0, vMaxBounds[nDim1] + 16.0f / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]));
dimensions << g_pDimStrings[nDim2] << vSize[nDim2];
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
dimensions.clear();
glRasterPos3f(0, vMinBounds[nDim1] + 4.0f, vMaxBounds[nDim2] + 8 / m_fScale);
dimensions << "(" << g_pOrgStrings[2][0] << vMinBounds[nDim1] << " " << g_pOrgStrings[2][1]
<< vMaxBounds[nDim2] << ")";
- GlobalOpenGL().drawString(dimensions.c_str());
+ GL.drawString(dimensions.c_str());
}
}
}
}
- void render(const Matrix4 &modelview, const Matrix4 &projection)
+ void render(OpenGLBinding &GL, const Matrix4 &modelview, const Matrix4 &projection)
{
- GlobalShaderCache().render(m_globalstate, modelview, projection);
+ GlobalShaderCache().render(GL, m_globalstate, modelview, projection);
}
private:
Scene_Render(renderer, m_view);
GlobalOpenGL_debugAssertNoErrors();
- renderer.render(m_modelview, m_projection);
+ renderer.render(GL, m_modelview, m_projection);
GlobalOpenGL_debugAssertNoErrors();
}
GlobalOpenGL_debugAssertNoErrors();
glLineWidth(1);
GlobalOpenGL_debugAssertNoErrors();
- if (GlobalOpenGL().GL_1_3()) {
+ if (GL.GL_1_3()) {
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
}
}
if (ClipMode()) {
- GlobalClipPoints_Draw(m_fScale);
+ GlobalClipPoints_Draw(GL, m_fScale);
}
GlobalOpenGL_debugAssertNoErrors();
DrawCameraIcon(Camera_getOrigin(*g_pParentWnd->GetCamWnd()), Camera_getAngles(*g_pParentWnd->GetCamWnd()));
- Feedback_draw2D(m_viewType);
+ Feedback_draw2D(GL, m_viewType);
if (g_xywindow_globals_private.show_outline) {
if (Active()) {
return "";
}
+struct OpenGLBinding;
+
class XYWnd {
+public:
+ OpenGLBinding &GL;
+private:
ui::GLArea m_gl_widget;
guint m_sizeHandler;
guint m_exposeHandler;
public:
ui::Window m_parent;
- XYWnd();
+ XYWnd(OpenGLBinding &GL);
~XYWnd();