summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorLeo2009-02-24 06:04:38 +0000
committerLeo2009-02-24 06:04:38 +0000
commit324e119ed026f5983b4b85a4b6209e27a3d0c0d0 (patch)
treefb0f7ea8cca4a1ad6c561bac6042882f5830bb81 /common
parent6a0c59cd1ef3362a486e9261a000020ce8aacc9c (diff)
Added wrapper for stipple functions.
git-svn-id: http://svn.leocad.org/tags/leocad-0.75@744 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common')
-rwxr-xr-xcommon/opengl.h11
-rw-r--r--common/project.cpp11
2 files changed, 15 insertions, 7 deletions
diff --git a/common/opengl.h b/common/opengl.h
index 6445b5c..4e5fa3a 100755
--- a/common/opengl.h
+++ b/common/opengl.h
@@ -1271,4 +1271,15 @@ extern PFNGLUNLOCKARRAYSEXT pfnglUnlockArraysEXT;
#define glLockArraysEXT pfnglLockArraysEXT
#define glUnlockArraysEXT pfnglUnlockArraysEXT
+inline void glEnableLineStipple()
+{
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple(5, 0x5555);
+}
+
+inline void glDisableLineStipple()
+{
+ glDisable(GL_LINE_STIPPLE);
+}
+
#endif // _OPENGL_H_
diff --git a/common/project.cpp b/common/project.cpp
index 3c35cf7..2a4818b 100644
--- a/common/project.cpp
+++ b/common/project.cpp
@@ -2193,8 +2193,7 @@ void Project::RenderScene(bool bShaded, bool bDrawViewports)
glTranslatef(0.375, 0.375, 0.0);
glDisable(GL_DEPTH_TEST);
- glEnable(GL_LINE_STIPPLE);
- glLineStipple(5, 0x5555);
+ glEnableLineStipple();
glColor3f(0, 0, 0);
float pt1x = (float)(m_nDownX - x);
@@ -2215,7 +2214,7 @@ void Project::RenderScene(bool bShaded, bool bDrawViewports)
glDrawArrays(GL_LINES, 0, 8);
glDisableClientState(GL_VERTEX_ARRAY);
- glDisable(GL_LINE_STIPPLE);
+ glDisableLineStipple();
glEnable(GL_DEPTH_TEST);
}
@@ -2815,8 +2814,7 @@ void Project::RenderOverlays(int Viewport)
glTranslatef(0.375f, 0.375f, 0.0f);
glDisable(GL_DEPTH_TEST);
- glEnable(GL_LINE_STIPPLE);
- glLineStipple(5, 0x5555);
+ glEnableLineStipple();
glColor3f(0, 0, 0);
float pt1x = (float)(m_nDownX - x);
@@ -2837,7 +2835,7 @@ void Project::RenderOverlays(int Viewport)
glDrawArrays(GL_LINES, 0, 8);
glDisableClientState(GL_VERTEX_ARRAY);
- glDisable(GL_LINE_STIPPLE);
+ glDisableLineStipple();
glEnable(GL_DEPTH_TEST);
}
}
@@ -3025,7 +3023,6 @@ void Project::RenderBoxes(bool bHilite)
// Initialize OpenGL
void Project::RenderInitialize()
{
- glLineStipple (1, 65280);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_POLYGON_OFFSET_FILL);