-/* $Id$
-
-This file is part of gldbg
-Copyright © 2009 Mikko Rasa, Mikkosoft Productions
-Distributed under the GPL
-*/
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
*ptr++ = ' ';
}
memcpy(&element, (const char *)data+i*elem_size, elem_size);
- if(type>='e' && type<='g' && elem_size==sizeof(float))
- *(double *)&element = *(float *)&element;
- len = snprintf(ptr, buf_size, fmt, element);
+ if(type>='e' && type<='g')
+ {
+ if(elem_size==sizeof(float))
+ *(double *)&element = *(float *)&element;
+ len = snprintf(ptr, buf_size, fmt, *(double *)&element);
+ }
+ else
+ len = snprintf(ptr, buf_size, fmt, element);
ptr += len;
buf_size -= len;
}
return buffer;
}
+static const char *print_parameter(int pname, int param)
+{
+ char *buffer;
+
+ // XXX Need to move the param names to flavor
+ switch(pname)
+ {
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ return describe_enum(param, "");
+ }
+
+ buffer = tmpalloc(11);
+ snprintf(buffer, 11, "%i", param);
+ return buffer;
+}
+
+static const char *print_internal_format(int fmt)
+{
+ char *buffer;
+
+ if(fmt>4)
+ return describe_enum(fmt, "PixelFormat");
+
+ buffer = tmpalloc(2);
+ snprintf(buffer, 2, "%i", fmt);
+ return buffer;
+}
+
static const char *print_data(const void *data, unsigned size)
{
if(!data)