summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-06-09 00:11:13 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-06-09 00:11:13 +0100
commitbc45bdd10b91797e5073076fc4c84ab6bbc63c70 (patch)
treee5c263df2f5fa185c2ca414daaea325d4ad8bab9
parentcbd225f575a0b92a293513223c4c9a74d2d4f8ab (diff)
(Re)trace glClearBuffer*v properly.
-rw-r--r--glapi.py6
-rw-r--r--glsize.hpp19
2 files changed, 22 insertions, 3 deletions
diff --git a/glapi.py b/glapi.py
index d8076ef7..6b7cbfb5 100644
--- a/glapi.py
+++ b/glapi.py
@@ -711,9 +711,9 @@ glapi.add_functions([
GlFunction(Void, "glTexParameterIuiv", [(GLenum, "target"), (GLenum, "pname"), (Const(OpaqueArray(GLuint, "__glTexParameterIuiv_size(pname)")), "params")]),
GlFunction(Void, "glGetTexParameterIiv", [(GLenum, "target"), (GLenum, "pname"), Out(OpaqueArray(GLint, "__glGetTexParameterIiv_size(pname)"), "params")], sideeffects=False),
GlFunction(Void, "glGetTexParameterIuiv", [(GLenum, "target"), (GLenum, "pname"), Out(OpaqueArray(GLuint, "__glGetTexParameterIuiv_size(pname)"), "params")], sideeffects=False),
- GlFunction(Void, "glClearBufferiv", [(GLenum, "buffer"), (GLint, "drawbuffer"), (Const(OpaqueArray(GLint, "__glClearBufferiv_size(buffer)")), "value")]),
- GlFunction(Void, "glClearBufferuiv", [(GLenum, "buffer"), (GLint, "drawbuffer"), (Const(OpaqueArray(GLuint, "__glClearBufferuiv_size(buffer)")), "value")]),
- GlFunction(Void, "glClearBufferfv", [(GLenum, "buffer"), (GLint, "drawbuffer"), (Const(OpaqueArray(GLfloat, "__glClearBufferfv_size(buffer)")), "value")]),
+ GlFunction(Void, "glClearBufferiv", [(GLenum, "buffer"), (GLint, "drawbuffer"), (Const(Array(GLint, "__glClearBuffer_size(buffer)")), "value")]),
+ GlFunction(Void, "glClearBufferuiv", [(GLenum, "buffer"), (GLint, "drawbuffer"), (Const(Array(GLuint, "__glClearBuffer_size(buffer)")), "value")]),
+ GlFunction(Void, "glClearBufferfv", [(GLenum, "buffer"), (GLint, "drawbuffer"), (Const(Array(GLfloat, "__glClearBuffer_size(buffer)")), "value")]),
GlFunction(Void, "glClearBufferfi", [(GLenum, "buffer"), (GLint, "drawbuffer"), (GLfloat, "depth"), (GLint, "stencil")]),
GlFunction(String("const GLubyte *"), "glGetStringi", [(GLenum, "name"), (GLuint, "index")], sideeffects=False),
diff --git a/glsize.hpp b/glsize.hpp
index bd933dc8..81ef0a7c 100644
--- a/glsize.hpp
+++ b/glsize.hpp
@@ -574,6 +574,25 @@ __gl_image_size(GLenum format, GLenum type, GLsizei width, GLsizei height, GLsiz
#define __glBitmap_size(width, height) __glTexImage2D_size(GL_COLOR_INDEX, GL_BITMAP, width, height)
#define __glPolygonStipple_size() __glBitmap_size(32, 32)
+static inline size_t
+__glClearBuffer_size(GLenum buffer)
+{
+ switch (buffer) {
+ case GL_COLOR:
+ case GL_FRONT:
+ case GL_BACK:
+ case GL_LEFT:
+ case GL_RIGHT:
+ case GL_FRONT_AND_BACK:
+ return 4;
+ case GL_DEPTH:
+ case GL_STENCIL:
+ return 1;
+ default:
+ OS::DebugMessage("apitrace: warning: %s: unexpected buffer GLenum 0x%04X\n", __FUNCTION__, buffer);
+ return 0;
+ }
+}
/*
* 0 terminated integer/float attribute list.