From 0711f10b1f896beba0d9d0105399eb9a5069612a Mon Sep 17 00:00:00 2001 From: "U-PH3NOM-PC\\PH3NOM" Date: Tue, 26 Aug 2014 18:11:41 -0700 Subject: [PATCH] #Fixed glVertex2f to perform as the standard defines. glKosVertex2f is added for direct submission to PVR of 2D vertices with no transform. --- gl-api.c | 19 ++++++++++--------- include/gl.h | 8 ++++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gl-api.c b/gl-api.c index d2b0be2..2577e16 100755 --- a/gl-api.c +++ b/gl-api.c @@ -72,10 +72,6 @@ static GLubyte GL_ENABLE_SUPERSAMP = 0; static GLubyte GL_FACE_FRONT = 0; static GLubyte GL_CLAMP_ST = 0; -/* Primitive 2D Position Submission */ -void (*glVertex2f)(float, float); -void (*glVertex2fv)(float *); - /* Primitive 3D Position Submission */ void (*glVertex3f)(float, float, float); void (*glVertex3fv)(float *); @@ -1038,9 +1034,6 @@ void glBegin(unsigned int mode) { glVertex3f = _glKosVertex3ft; glVertex3fv = _glKosVertex3ftv; } - - glVertex2f = _glKosVertex2ft; - glVertex2fv = _glKosVertex2ftv; } void _glKosTransformClipBuf(pvr_vertex_t *v, GLuint verts) { @@ -1133,7 +1126,15 @@ void glEnd() { } } -void _glKosVertex2ft(float x, float y) { +void glVertex2f(GLfloat x, GLfloat y) { + return _glKosVertex3ft(x, y, 0.0f); +} + +void glVertex2fv(GLfloat *xy) { + return _glKosVertex3ft(xy[0], xy[1], 0.0f); +} + +void glKosVertex2f(GLfloat x, GLfloat y) { pvr_vertex_t *v = _glKosVertexBufPointer(); v->x = x; @@ -1149,7 +1150,7 @@ void _glKosVertex2ft(float x, float y) { ++GL_VERTICES; } -void _glKosVertex2ftv(float *xy) { +void glKosVertex2fv(GLfloat *xy) { pvr_vertex_t *v = _glKosVertexBufPointer(); v->x = xy[0]; diff --git a/include/gl.h b/include/gl.h index b97b4d8..b56d857 100755 --- a/include/gl.h +++ b/include/gl.h @@ -352,8 +352,12 @@ GLAPI void APIENTRY glNormal3f(float x, float y, float z); GLAPI void APIENTRY glNormal3fv(float *xyz); /* Primitive 2D Position Submission */ -GLAPI void APIENTRY(*glVertex2f)(float, float); -GLAPI void APIENTRY(*glVertex2fv)(float *); +GLAPI void APIENTRY glVertex2f(GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertex2fv(GLfloat *xy); + +/* Non-Standard KOS Primitive 2D Submission. This will perform no tranformations on the vertices. */ +GLAPI void APIENTRY glKosVertex2f(GLfloat x, GLfloat y); +GLAPI void APIENTRY glKosVertex2fv(GLfloat *xy); /* Primitive 3D Position Submission */ GLAPI void APIENTRY(*glVertex3f)(float, float, float);