aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo/vbo_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_context.h')
-rw-r--r--mesalib/src/mesa/vbo/vbo_context.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_context.h b/mesalib/src/mesa/vbo/vbo_context.h
index e22451305..6099b56e6 100644
--- a/mesalib/src/mesa/vbo/vbo_context.h
+++ b/mesalib/src/mesa/vbo/vbo_context.h
@@ -56,6 +56,11 @@
#include "vbo_exec.h"
#include "vbo_save.h"
+#include "main/macros.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
struct vbo_context {
struct gl_client_array currval[VBO_ATTRIB_MAX];
@@ -124,7 +129,7 @@ vbo_draw_method(struct vbo_context *vbo, gl_draw_method method)
ctx->Array._DrawArrays = vbo->save.inputs;
break;
default:
- ASSERT(0);
+ assert(0);
}
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
@@ -146,33 +151,36 @@ vbo_attrtype_to_integer_flag(GLenum format)
case GL_UNSIGNED_INT:
return GL_TRUE;
default:
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
}
-
/**
* Return default component values for the given format.
- * The return type is an array of floats, because that's how we declare
- * the vertex storage despite the fact we sometimes store integers in there.
+ * The return type is an array of fi_types, because that's how we declare
+ * the vertex storage : floats , integers or unsigned integers.
*/
-static inline const GLfloat *
-vbo_get_default_vals_as_float(GLenum format)
+static inline const fi_type *
+vbo_get_default_vals_as_union(GLenum format)
{
static const GLfloat default_float[4] = { 0, 0, 0, 1 };
static const GLint default_int[4] = { 0, 0, 0, 1 };
switch (format) {
case GL_FLOAT:
- return default_float;
+ return (fi_type *)default_float;
case GL_INT:
case GL_UNSIGNED_INT:
- return (const GLfloat*)default_int;
+ return (fi_type *)default_int;
default:
- ASSERT(0);
+ assert(0);
return NULL;
}
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif