void draw(int dummy) { if (tail > head) { // We're straddling the end of the array, so have to do this in two steps draw_arrays(vertexes + tail * 6 * 2, fg + tail * 6 * 4, bg + tail * 6 * 4, tex + tail * 6 * 2, buffersz - tail); draw_arrays(vertexes, fg, bg, tex, head-1); } else { draw_arrays(vertexes + tail * 6 * 2, fg + tail * 6 * 4, bg + tail * 6 * 4, tex + tail * 6 * 2, sum_erasz); } printGLError(); erasz.push_back(current_erasz); current_erasz = 0; if (erasz.size() == redraw_count) { // Right, time to retire the oldest era. tail = (tail + erasz.front()) % buffersz; sum_erasz -= erasz.front(); erasz.pop_front(); } }
void glPushMatrix() { next_glPushMatrix(); printGLError(); gr_pushMatrix(); debugPrint("glPushMatrix()\n"); }
void glUseProgram(GLuint program) { next_glUseProgram(program); printGLError(); gr_useProgram(program); debugPrint("glUseProgram(program= %u)\n", program); }
void glUniform4fv(GLint location, GLsizei count, const GLfloat* value) { next_glUniform4fv(location, count, value); printGLError(); gr_uniform4fv(location, count, value); debugPrint("glUniform4fv(location= %i, count= %u, value= %x)\n", location, count, value); }
void glColor3ubv(const GLubyte* v) { next_glColor3ubv(v); printGLError(); gr_setColorub(v[0], v[1], v[2], 255); debugPrint("glColor3ubv(v= %x)\n", v); }
void glEnableVertexAttribArray(GLuint index) { next_glEnableVertexAttribArray(index); printGLError(); gr_enableVertexAttributeArray(index); debugPrint("glEnableVertexAttribArray(index= %u)\n", index); }
void glCompileShader(GLuint shader) { next_glCompileShader(shader); printGLError(); gr_compileShader(shader); debugPrint("glCompileShader(shader= %u)\n", shader); }
void glAttachShader(GLuint program, GLuint shader) { next_glAttachShader(program, shader); printGLError(); gr_attachShader(program, shader); debugPrint("glAttachShader(program= %u, shader= %u)\n", program, shader); }
void glTranslated(GLdouble x, GLdouble y, GLdouble z) { next_glTranslated(x, y, z); printGLError(); gr_translate(x,y,z); debugPrint("glTranslated(x= %f, y= %f, z= %f)\n", x, y, z); }
void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) { next_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); printGLError(); gr_texImage2D(target, level, internalformat, width, height, border, format, type, pixels); debugPrint("glTexImage2D(target= %s, level= %i, internalformat= %i, width= %u, height= %u, border= %i, format= %s, type= %s, pixels= %x)\n", getEnumString(target), level, internalformat, width, height, border, getEnumString(format), getEnumString(type), pixels); }
void glTexCoord2fv(const GLfloat* v) { next_glTexCoord2fv(v); printGLError(); gr_texCoord(v[0], v[1], 0.0); debugPrint("glTexCoord2fv(v= %x)\n", v); }
void glScalef(GLfloat x, GLfloat y, GLfloat z) { next_glScalef(x, y, z); printGLError(); gr_scale(x,y,z); debugPrint("glScalef(x= %f, y= %f, z= %f)\n", x, y, z); }
void glScaled(GLdouble x, GLdouble y, GLdouble z) { next_glScaled(x, y, z); printGLError(); gr_scale(x,y,z); debugPrint("glScaled(x= %f, y= %f, z= %f)\n", x, y, z); }
void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { next_glRotatef(angle, x, y, z); printGLError(); gr_rotate(angle,x,y,z); debugPrint("glRotatef(angle= %f, x= %f, y= %f, z= %f)\n", angle, x, y, z); }
void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) { next_glRotated(angle, x, y, z); printGLError(); gr_rotate(angle,x,y,z); debugPrint("glRotated(angle= %f, x= %f, y= %f, z= %f)\n", angle, x, y, z); }
void glDeleteBuffers(GLsizei n, const GLuint* buffers) { next_glDeleteBuffers(n, buffers); printGLError(); gr_deleteBuffers(n, buffers); debugPrint("glDeleteBuffers(n= %u, buffers= %x)\n", n, buffers); }
void glGenBuffers(GLsizei n, GLuint* buffers) { next_glGenBuffers(n, buffers); printGLError(); gr_genBuffers(n, buffers); debugPrint("glGenBuffers(n= %u, buffers= %x)\n", n, buffers); }
void glTranslatef(GLfloat x, GLfloat y, GLfloat z) { next_glTranslatef(x, y, z); printGLError(); gr_translate(x,y,z); debugPrint("glTranslatef(x= %f, y= %f, z= %f)\n", x, y, z); }
void glDeleteShader(GLuint shader) { next_glDeleteShader(shader); printGLError(); gr_deleteShader(shader); debugPrint("glDeleteShader(shader= %u)\n", shader); }
void glVertex2d(GLdouble x, GLdouble y) { next_glVertex2d(x, y); printGLError(); gr_addVertex(x,y,0); debugPrint("glVertex2d(x= %f, y= %f)\n", x, y); }
void glColor3iv(const GLint* v) { next_glColor3iv(v); printGLError(); gr_setColor(v[0],v[1],v[2], 1.0f); debugPrint("glColor3iv(v= %x)\n", v); }
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) { next_glViewport(x, y, width, height); printGLError(); gr_viewport(x,y,width,height); debugPrint("glViewport(x= %i, y= %i, width= %u, height= %u)\n", x, y, width, height); }
void glShaderSource(GLuint shader, GLsizei count, const GLchar*const* string, const GLint* length) { next_glShaderSource(shader, count, string, length); printGLError(); gr_shaderSource(shader, count, string, length); debugPrint("glShaderSource(shader= %u, count= %u, string= %x, length= %x)\n", shader, count, string, length); }
void glBegin(GLenum mode) { next_glBegin(mode); printGLError(); gr_beginPrimitive(mode); debugPrint("glBegin(mode= %s)\n", getEnumString(mode)); }
void glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { next_glUniform4f(location, v0, v1, v2, v3); printGLError(); gr_uniform4f(location, v0, v1, v2, v3); debugPrint("glUniform4f(location= %i, v0= %f, v1= %f, v2= %f, v3= %f)\n", location, v0, v1, v2, v3); }
void glColor3f(GLfloat red, GLfloat green, GLfloat blue) { next_glColor3f(red, green, blue); printGLError(); gr_setColor(red,green,blue, 1.0f); debugPrint("glColor3f(red= %f, green= %f, blue= %f)\n", red, green, blue); }
void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) { next_glUniformMatrix4fv(location, count, transpose, value); printGLError(); gr_uniformMatrix4fv(location, count, transpose, value); debugPrint("glUniformMatrix4fv(location= %i, count= %u, transpose= %i, value= %x)\n", location, count, transpose, value); }
void glEnableClientState(GLenum array) { next_glEnableClientState(array); printGLError(); gr_enableClientState(array); debugPrint("glEnableClientState(array= %s)\n", getEnumString(array)); }
void glVertexPointer(GLint size, GLenum type, GLsizei stride, const void * pointer) { next_glVertexPointer(size, type, stride, pointer); printGLError(); gr_vertexPointer(size,type,stride,pointer); debugPrint("glVertexPointer(size= %i, type= %s, stride= %u, pointer= %x)\n", size, getEnumString(type), stride, pointer); }
void glColor3d(GLdouble red, GLdouble green, GLdouble blue) { next_glColor3d(red, green, blue); printGLError(); gr_setColor(red,green,blue, 1.0f); debugPrint("glColor3d(red= %f, green= %f, blue= %f)\n", red, green, blue); }