Commit f815f022 authored by sumpfralle's avatar sumpfralle

r675@erker: lars | 2010-02-17 00:22:21 +0100

 fixed broken glGet calls (found by Lode)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@133 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 88e0623e
...@@ -140,7 +140,7 @@ class Camera: ...@@ -140,7 +140,7 @@ class Camera:
def position_camera(self): def position_camera(self):
width, height = self._get_screen_dimensions() width, height = self._get_screen_dimensions()
prev_mode = GL.glGetDoublev(GL.GL_MATRIX_MODE) prev_mode = GL.glGetIntegerv(GL.GL_MATRIX_MODE)
GL.glMatrixMode(GL.GL_PROJECTION) GL.glMatrixMode(GL.GL_PROJECTION)
GL.glLoadIdentity() GL.glLoadIdentity()
v = self.view v = self.view
......
...@@ -97,7 +97,7 @@ class GLView: ...@@ -97,7 +97,7 @@ class GLView:
def gtkgl_refresh(func): def gtkgl_refresh(func):
def refresh_wrapper(self, *args, **kwargs): def refresh_wrapper(self, *args, **kwargs):
prev_mode = GL.glGetDoublev(GL.GL_MATRIX_MODE) prev_mode = GL.glGetIntegerv(GL.GL_MATRIX_MODE)
GL.glMatrixMode(GL.GL_MODELVIEW) GL.glMatrixMode(GL.GL_MODELVIEW)
GL.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT) GL.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT)
result = func(self, *args, **kwargs) result = func(self, *args, **kwargs)
......
...@@ -26,17 +26,17 @@ COLORS = { ...@@ -26,17 +26,17 @@ COLORS = {
def keep_gl_mode(func): def keep_gl_mode(func):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
prev_mode = GL.glGetDoublev(GL.GL_MATRIX_MODE) prev_mode = GL.glGetIntegerv(GL.GL_MATRIX_MODE)
func(*args, **kwargs) func(*args, **kwargs)
GL.glMatrixMode(prev_mode) GL.glMatrixMode(prev_mode)
return wrapper return wrapper
def keep_matrix(func): def keep_matrix(func):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
pushed_matrix_mode = GL.glGetDoublev(GL.GL_MATRIX_MODE) pushed_matrix_mode = GL.glGetIntegerv(GL.GL_MATRIX_MODE)
GL.glPushMatrix() GL.glPushMatrix()
func(*args, **kwargs) func(*args, **kwargs)
final_matrix_mode = GL.glGetDoublev(GL.GL_MATRIX_MODE) final_matrix_mode = GL.glGetIntegerv(GL.GL_MATRIX_MODE)
GL.glMatrixMode(pushed_matrix_mode) GL.glMatrixMode(pushed_matrix_mode)
GL.glPopMatrix() GL.glPopMatrix()
GL.glMatrixMode(final_matrix_mode) GL.glMatrixMode(final_matrix_mode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment