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);
}