From 4373f59cdbcfa69a79f010ed1c45e074a8bf03a6 Mon Sep 17 00:00:00 2001 From: Runar Tenfjord Date: Tue, 29 Jan 2013 21:37:42 +0100 Subject: [PATCH] Added misc. GL functions --- gltools/@include/glLib.pxd | 2 ++ gltools/@src/Color.pxi | 2 +- gltools/@src/GL.pxi | 12 ++++++++++++ gltools/gltools.pxd | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gltools/@include/glLib.pxd b/gltools/@include/glLib.pxd index 979fc68..3f5436d 100644 --- a/gltools/@include/glLib.pxd +++ b/gltools/@include/glLib.pxd @@ -21,6 +21,7 @@ cdef extern from "GL/glfw3.h": void glClear(GLbitfield mask) void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) void glClearDepth(GLclampd depth) + void glDepthFunc(GLenum func) void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) void glDisable(GLenum cap) void glDrawArrays(GLenum mode, GLint first, GLsizei count) @@ -28,6 +29,7 @@ cdef extern from "GL/glfw3.h": void glEnable(GLenum cap) void glGetIntegerv(GLenum pname, GLint *params) void glHint(GLenum target, GLenum mode) + void glPointSize(GLfloat size) void glLineWidth(GLfloat width) void glLightf(GLenum light, GLenum pname, GLfloat param) void glLightfv(GLenum light, GLenum pname, GLfloat *params ) diff --git a/gltools/@src/Color.pxi b/gltools/@src/Color.pxi index 4dcc831..5790c23 100644 --- a/gltools/@src/Color.pxi +++ b/gltools/@src/Color.pxi @@ -89,7 +89,7 @@ cdef class ColorRGBA: self.red = value & 0x000000FF self.green = (value & 0x0000FF00) >> 8 self.blue = (value & 0x00FF0000) >> 16 - self.alpha = (value & 0xFF000000) >> 14 + self.alpha = (value & 0xFF000000) >> 24 cpdef tuple toFloatVector(self): ''' diff --git a/gltools/@src/GL.pxi b/gltools/@src/GL.pxi index a141d66..373e189 100644 --- a/gltools/@src/GL.pxi +++ b/gltools/@src/GL.pxi @@ -57,6 +57,12 @@ cpdef ClearDepth(double depth): ''' glClearDepth(depth) +cpdef DepthFunc(int func): + ''' + Specify the value used for depth buffer comparisons + ''' + glDepthFunc(func) + cpdef Color(ColorRGBA col): ''' Sets the current color. @@ -110,6 +116,12 @@ cpdef Hint(int target, int mode): ''' glHint(target, mode) +cpdef PointSize(float width): + ''' + Specify the diameter of rasterized points + ''' + glPointSize(width) + cpdef LineWidth(float width): ''' Specify the width of rasterized lines diff --git a/gltools/gltools.pxd b/gltools/gltools.pxd index b66929e..653b2df 100644 --- a/gltools/gltools.pxd +++ b/gltools/gltools.pxd @@ -150,12 +150,14 @@ cpdef BlendFunc(unsigned int sfactor, unsigned int dfactor) cpdef Clear(unsigned int mask) cpdef ClearColor(ColorRGBA col) cpdef ClearDepth(double depth) +cpdef DepthFunc(int func) cpdef Color(ColorRGBA col) cpdef Disable(unsigned int cap) cpdef DrawArrays(unsigned int mode, int first, int count) cpdef DrawElements(unsigned int mode, int count, int type, indices) cpdef Enable(unsigned int cap) cpdef Hint(int target, int mode) +cpdef PointSize(float width) cpdef LineWidth(float width) cpdef LightModeli(int pname, int param) cpdef LoadIdentity()