#include "metrics.h"
+/* As of glext.h version 20131008 some types changed.
+ *
+ * I have no idea why some internalFormats changed from GLenum to
+ * GLint while others changed from GLint to GLenum.
+ *
+ * But, in order to compile with either version, we track these.
+ */
+#if GL_GLEXT_VERSION >= 20131008
+#define GLint_or_enum GLenum
+#define GLenum_or_int GLint
+#else
+#define GLint_or_enum GLint
+#define GLenum_or_int GLenum
+#endif
+
static void *gl_handle;
/* Switch metrics operation persistently, (until next SWITCH) */
const char *path;
path = getenv ("FIPS_LIBGL");
+ if (! path)
+ path = getenv ("GLAZE_LIBGL");
if (path) {
gl_handle = dlopen (path, RTLD_LAZY);
ret = dlwrap_real_dlsym (gl_handle, name);
if (ret == NULL) {
- fprintf (stderr, "Error: glwrap_lookup failed to dlsym %s\n",
+ fprintf (stderr, "fips: Error: glwrap_lookup failed to dlsym %s\n",
name);
exit (1);
}
void
glTexImage2DMultisample (GLenum target, GLsizei samples,
- GLint internalformat, GLsizei width, GLsizei height,
+ GLint_or_enum internalformat,
+ GLsizei width, GLsizei height,
GLboolean fixedsamplelocations)
{
SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
}
void
-glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat,
+glTexImage3DMultisample (GLenum target, GLsizei samples,
+ GLint_or_enum internalformat,
GLsizei width, GLsizei height, GLsizei depth,
GLboolean fixedsamplelocations)
{
void
glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
- GLenum internalformat, GLsizei width, GLint border,
+ GLenum_or_int internalformat,
+ GLsizei width, GLint border,
GLenum format, GLenum type, const GLvoid *pixels)
{
SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
void
glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
- GLenum internalformat, GLsizei width, GLsizei height,
+ GLenum_or_int internalformat,
+ GLsizei width, GLsizei height,
GLint border, GLenum format, GLenum type,
const GLvoid *pixels)
{
void
glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level,
- GLenum internalformat, GLsizei width, GLsizei height,
+ GLenum_or_int internalformat,
+ GLsizei width, GLsizei height,
GLsizei depth, GLint border, GLenum format,
GLenum type, const GLvoid *pixels)
{