From 324e119ed026f5983b4b85a4b6209e27a3d0c0d0 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 24 Feb 2009 06:04:38 +0000 Subject: Added wrapper for stipple functions. git-svn-id: http://svn.leocad.org/tags/leocad-0.75@744 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/opengl.h | 11 +++++++++++ common/project.cpp | 11 ++++------- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'common') 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); -- cgit v1.2.3