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();
   }
 }
Пример #2
0
void glPushMatrix()
{
  next_glPushMatrix();
  printGLError();

  gr_pushMatrix();

  debugPrint("glPushMatrix()\n");
}
Пример #3
0
void glUseProgram(GLuint program)
{
  next_glUseProgram(program);
  printGLError();

  gr_useProgram(program);

  debugPrint("glUseProgram(program= %u)\n", program);
}
Пример #4
0
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);
}
Пример #5
0
void glColor3ubv(const GLubyte* v)
{
  next_glColor3ubv(v);
  printGLError();

  gr_setColorub(v[0], v[1], v[2], 255);

  debugPrint("glColor3ubv(v= %x)\n", v);
}
Пример #6
0
void glEnableVertexAttribArray(GLuint index)
{
  next_glEnableVertexAttribArray(index);
  printGLError();

  gr_enableVertexAttributeArray(index);

  debugPrint("glEnableVertexAttribArray(index= %u)\n", index);
}
Пример #7
0
void glCompileShader(GLuint shader)
{
  next_glCompileShader(shader);
  printGLError();

  gr_compileShader(shader);

  debugPrint("glCompileShader(shader= %u)\n", shader);
}
Пример #8
0
void glAttachShader(GLuint program, GLuint shader)
{
  next_glAttachShader(program, shader);
  printGLError();

  gr_attachShader(program, shader);

  debugPrint("glAttachShader(program= %u, shader= %u)\n", program, shader);
}
Пример #9
0
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);
}
Пример #10
0
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);
}
Пример #11
0
void glTexCoord2fv(const GLfloat* v)
{
  next_glTexCoord2fv(v);
  printGLError();

  gr_texCoord(v[0], v[1], 0.0);

  debugPrint("glTexCoord2fv(v= %x)\n", v);
}
Пример #12
0
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);
}
Пример #13
0
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);
}
Пример #14
0
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);
}
Пример #15
0
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);
}
Пример #16
0
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);
}
Пример #17
0
void glGenBuffers(GLsizei n, GLuint* buffers)
{
  next_glGenBuffers(n, buffers);
  printGLError();

  gr_genBuffers(n, buffers);

  debugPrint("glGenBuffers(n= %u, buffers= %x)\n", n, buffers);
}
Пример #18
0
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);
}
Пример #19
0
void glDeleteShader(GLuint shader)
{
  next_glDeleteShader(shader);
  printGLError();

  gr_deleteShader(shader);

  debugPrint("glDeleteShader(shader= %u)\n", shader);
}
Пример #20
0
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);
}
Пример #21
0
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);
}
Пример #22
0
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);
}
Пример #23
0
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);
}
Пример #24
0
void glBegin(GLenum mode)
{
  next_glBegin(mode);
  printGLError();

  gr_beginPrimitive(mode);

  debugPrint("glBegin(mode= %s)\n", getEnumString(mode));
}
Пример #25
0
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);
}
Пример #26
0
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);
}
Пример #27
0
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);
}
Пример #28
0
void glEnableClientState(GLenum array)
{
  next_glEnableClientState(array);
  printGLError();

  gr_enableClientState(array);

  debugPrint("glEnableClientState(array= %s)\n", getEnumString(array));
}
Пример #29
0
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);
}
Пример #30
0
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);
}