summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clear.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-10-23 09:26:10 -0600
committerBrian Paul <[email protected]>2010-10-23 10:19:29 -0600
commita0bc8eeb3224eec1e713fb9885f5d02c21b30c14 (patch)
tree9773c3b1375f46a05b918dbf6fd49d75d7336ef6 /src/mesa/main/clear.c
parentf6dbb693d211feca9980437c54897ca6619e0a15 (diff)
mesa: _mesa_ClearColorIuiEXT() and _mesa_ClearColorIiEXT()
For GL_EXT_texture_integer.
Diffstat (limited to 'src/mesa/main/clear.c')
-rw-r--r--src/mesa/main/clear.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index b011da04b46..61bc836a38d 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -96,6 +96,68 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
/**
+ * GL_EXT_texture_integer
+ */
+void GLAPIENTRY
+_mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a)
+{
+ GLfloat tmp[4];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ tmp[0] = (GLfloat) r;
+ tmp[1] = (GLfloat) g;
+ tmp[2] = (GLfloat) b;
+ tmp[3] = (GLfloat) a;
+
+ if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
+ return; /* no change */
+
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+
+ /* XXX we should eventually have a float/int/uint union for
+ * the ctx->Color.ClearColor state.
+ */
+ COPY_4V(ctx->Color.ClearColor, tmp);
+
+ if (ctx->Driver.ClearColor) {
+ ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
+ }
+}
+
+
+/**
+ * GL_EXT_texture_integer
+ */
+void GLAPIENTRY
+_mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a)
+{
+ GLfloat tmp[4];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ tmp[0] = (GLfloat) r;
+ tmp[1] = (GLfloat) g;
+ tmp[2] = (GLfloat) b;
+ tmp[3] = (GLfloat) a;
+
+ if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
+ return; /* no change */
+
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+
+ /* XXX we should eventually have a float/int/uint union for
+ * the ctx->Color.ClearColor state.
+ */
+ COPY_4V(ctx->Color.ClearColor, tmp);
+
+ if (ctx->Driver.ClearColor) {
+ ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
+ }
+}
+
+
+/**
* Clear buffers.
*
* \param mask bit-mask indicating the buffers to be cleared.