Code: Select all
diff --git a/gl-api.c b/gl-api.c
index 4a679fd..238b333 100755
--- a/gl-api.c
+++ b/gl-api.c
@@ -278,7 +278,7 @@ GLvoid APIENTRY glTexCoord2fv(const GLfloat *uv) {
GLvoid APIENTRY(*glVertex3f)(GLfloat, GLfloat, GLfloat);
-GLvoid APIENTRY(*glVertex3fv)(GLfloat *);
+GLvoid APIENTRY(*glVertex3fv)(const GLfloat *);
GLvoid APIENTRY glVertex2f(GLfloat x, GLfloat y) {
return _glKosVertex3ft(x, y, 0.0f);
@@ -343,7 +343,7 @@ GLAPI void APIENTRY glRecti(GLint x1, GLint y1, GLint x2, GLint y2) {
}
GLAPI void APIENTRY glRectiv(const GLint *v1, const GLint *v2) {
- return glRectfv((GLfloat *)v1, (GLfloat *)v2);
+ return glRectfv((const GLfloat *)v1, (GLfloat *)v2);
}
GLvoid APIENTRY glKosVertex2f(GLfloat x, GLfloat y) {
@@ -536,7 +536,7 @@ GLvoid _glKosVertex3fs(GLfloat x, GLfloat y, GLfloat z) {
++GL_KOS_VERTEX_COUNT;
}
-GLvoid _glKosVertex3fsv(GLfloat *xyz) {
+GLvoid _glKosVertex3fsv(const GLfloat *xyz) {
pvr_vertex_t *v = _glKosVertexBufPointer();
mat_trans_single3_nomod(xyz[0], xyz[1], xyz[2], v->x, v->y, v->z);
@@ -563,7 +563,7 @@ GLvoid _glKosVertex3ft(GLfloat x, GLfloat y, GLfloat z) {
++GL_KOS_VERTEX_COUNT;
}
-GLvoid _glKosVertex3ftv(GLfloat *xyz) {
+GLvoid _glKosVertex3ftv(const GLfloat *xyz) {
pvr_vertex_t *v = _glKosVertexBufPointer();
mat_trans_single3_nomod(xyz[0], xyz[1], xyz[2], v->x, v->y, v->z);
@@ -592,7 +592,7 @@ GLvoid _glKosVertex3fc(GLfloat x, GLfloat y, GLfloat z) {
++GL_KOS_VERTEX_COUNT;
}
-GLvoid _glKosVertex3fcv(GLfloat *xyz) {
+GLvoid _glKosVertex3fcv(const GLfloat *xyz) {
pvr_vertex_t *v = _glKosClipBufPointer();
v->x = xyz[0];
@@ -638,7 +638,7 @@ GLvoid _glKosVertex3fp(GLfloat x, GLfloat y, GLfloat z) {
_glKosVertex3fpb(x + GL_KOS_POINT_SIZE, y + GL_KOS_POINT_SIZE, z);
}
-GLvoid _glKosVertex3fpv(GLfloat *xyz) {
+GLvoid _glKosVertex3fpv(const GLfloat *xyz) {
_glKosVertex3fpa(xyz[0] - GL_KOS_POINT_SIZE, xyz[1] - GL_KOS_POINT_SIZE, xyz[2]);
_glKosVertex3fpa(xyz[0] + GL_KOS_POINT_SIZE, xyz[1] - GL_KOS_POINT_SIZE, xyz[2]);
_glKosVertex3fpa(xyz[0] - GL_KOS_POINT_SIZE, xyz[1] + GL_KOS_POINT_SIZE, xyz[2]);
@@ -905,4 +905,4 @@ GLuint _glKosDepthFunc() {
GLubyte _glKosDepthMask() {
return !GL_KOS_DEPTH_WRITE;
-}
\ No newline at end of file
+}
diff --git a/gl-api.h b/gl-api.h
index 7848635..9d7475b 100755
--- a/gl-api.h
+++ b/gl-api.h
@@ -92,7 +92,7 @@ unsigned int _glKosClipTriangleStripTransformed(pvr_vertex_t *src, float *w, pvr
void _glKosInitLighting();
void _glKosEnableLight(const GLuint light);
void _glKosDisableLight(const GLuint light);
-void _glKosSetEyePosition(GLfloat *position);
+void _glKosSetEyePosition(const GLfloat *position);
void _glKosVertexComputeLighting(pvr_vertex_t *v, int verts);
void _glKosVertexLight(glVertex *P, pvr_vertex_t *v);
unsigned int _glKosVertexLightColor(glVertex *P);
@@ -100,19 +100,19 @@ void _glKosVertexLights(glVertex *P, pvr_vertex_t *v, GLuint count);
/* Vertex Position Submission Internal Functions */
void _glKosVertex2ft(GLfloat x, GLfloat y);
-void _glKosVertex2ftv(GLfloat *xy);
+void _glKosVertex2ftv(const GLfloat *xy);
void _glKosVertex3ft(GLfloat x, GLfloat y, GLfloat z);
-void _glKosVertex3ftv(GLfloat *xyz);
+void _glKosVertex3ftv(const GLfloat *xyz);
void _glKosVertex3fc(GLfloat x, GLfloat y, GLfloat z);
-void _glKosVertex3fcv(GLfloat *xyz);
+void _glKosVertex3fcv(const GLfloat *xyz);
void _glKosVertex3fp(GLfloat x, GLfloat y, GLfloat z);
-void _glKosVertex3fpv(GLfloat *xyz);
+void _glKosVertex3fpv(const GLfloat *xyz);
void _glKosVertex3fl(GLfloat x, GLfloat y, GLfloat z);
-void _glKosVertex3flv(GLfloat *xyz);
+void _glKosVertex3flv(const GLfloat *xyz);
void _glKosVertex3flc(GLfloat x, GLfloat y, GLfloat z);
-void _glKosVertex3flcv(GLfloat *xyz);
+void _glKosVertex3flcv(const GLfloat *xyz);
void _glKosVertex3fs(GLfloat x, GLfloat y, GLfloat z);
-void _glKosVertex3fsv(GLfloat *xyz);
+void _glKosVertex3fsv(const GLfloat *xyz);
/* Matrix Internal Functions */
void _glKosInitMatrix();
diff --git a/gl-light.c b/gl-light.c
index a4c3ddd..9b5c859 100755
--- a/gl-light.c
+++ b/gl-light.c
@@ -51,7 +51,7 @@ GL_DEFAULT_MATERIAL = { { 0.0, 0.0, 0.0, 1.0 }, /* Emissive Color */
static GLfloat GL_EYE_POSITION[3] = { 0, 0, 0 }; /* Eye Position for Specular Factor */
-void _glKosSetEyePosition(GLfloat *position) { /* Called internally by glhLookAtf() */
+void _glKosSetEyePosition(const GLfloat *position) { /* Called internally by glhLookAtf() */
GL_EYE_POSITION[0] = position[0];
GL_EYE_POSITION[1] = position[1];
GL_EYE_POSITION[2] = position[2];
@@ -342,7 +342,7 @@ float FPOW(float b, float p) {
/* End FPOW Implementation */
-void _glKosVertex3flv(GLfloat *xyz) {
+void _glKosVertex3flv(const GLfloat *xyz) {
glVertex *v = _glKosArrayBufPtr();
v->pos[0] = xyz[0];
@@ -372,7 +372,7 @@ void _glKosVertex3fl(GLfloat x, GLfloat y, GLfloat z) {
_glKosVertex3fs(x, y, z);
}
-void _glKosVertex3flcv(GLfloat *xyz) {
+void _glKosVertex3flcv(const GLfloat *xyz) {
glVertex *v = _glKosArrayBufPtr();
v->pos[0] = xyz[0];
diff --git a/include/gl.h b/include/gl.h
index f6ae8df..4d6f542 100755
--- a/include/gl.h
+++ b/include/gl.h
@@ -403,31 +403,31 @@ GLAPI void APIENTRY glEnd();
/* Primitive Texture Coordinate Submission */
GLAPI void APIENTRY glTexCoord2f(GLfloat u, GLfloat v);
-GLAPI void APIENTRY glTexCoord2fv(GLfloat *uv);
+GLAPI void APIENTRY glTexCoord2fv(const GLfloat *uv);
/* Primitive Color Submission */
GLAPI void APIENTRY glColor1ui(GLuint argb);
GLAPI void APIENTRY glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a);
GLAPI void APIENTRY glColor3f(GLfloat r, GLfloat g, GLfloat b);
-GLAPI void APIENTRY glColor3fv(GLfloat *rgb);
+GLAPI void APIENTRY glColor3fv(const GLfloat *rgb);
GLAPI void APIENTRY glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
-GLAPI void APIENTRY glColor4fv(GLfloat *rgba);
+GLAPI void APIENTRY glColor4fv(const GLfloat *rgba);
/* Primitive Normal Submission */
GLAPI void APIENTRY glNormal3f(float x, float y, float z);
-GLAPI void APIENTRY glNormal3fv(float *xyz);
+GLAPI void APIENTRY glNormal3fv(const float *xyz);
/* Primitive 2D Position Submission */
GLAPI void APIENTRY glVertex2f(GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertex2fv(GLfloat *xy);
+GLAPI void APIENTRY glVertex2fv(const 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);
+GLAPI void APIENTRY glKosVertex2fv(const GLfloat *xy);
/* Primitive 3D Position Submission */
GLAPI void APIENTRY(*glVertex3f)(float, float, float);
-GLAPI void APIENTRY(*glVertex3fv)(float *);
+GLAPI void APIENTRY(*glVertex3fv)(const float *);
/* Enable / Disable Capability */
/* Currently Supported Capabilities:
@@ -556,8 +556,8 @@ GLAPI void APIENTRY glFogfv(GLenum pname, const GLfloat *params);
/* Set Global Ambient Light Color */
GLAPI void APIENTRY glKosLightAmbient3f(GLfloat r, GLfloat g, GLfloat b);
GLAPI void APIENTRY glKosLightAmbient4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
-GLAPI void APIENTRY glKosLightAmbient3fv(GLfloat *rgb);
-GLAPI void APIENTRY glKosLightAmbient4fv(GLfloat *rgba);
+GLAPI void APIENTRY glKosLightAmbient3fv(const GLfloat *rgb);
+GLAPI void APIENTRY glKosLightAmbient4fv(const GLfloat *rgba);
/* Set Individual Light Parameters */
GLAPI void APIENTRY glLightfv(GLenum light, GLenum pname, const GLfloat *params);