EGLSurface, pointer, %p
EGLNativeWindowType, int, %lx
EGLNativePixmapType, int, %lx
-EGLenum, int, %s, describe_enum:p.name:'"%s"'%p.type
-EGLenumHack, int, %s, describe_enum:p.name:'"%s"'%p.type
+EGLenum, int, %s, describe_enum
+EGLenumHack, int, %s, describe_enum
EGLClientBuffer, pointer, %p
EGLContext, pointer, %p
__eglMustCastToProperFunctionPointerType, pointer, %p
-enum, int, %s, describe_enum:p.name:'"%s"'%p.type
+enum, int, %s, describe_enum
boolean, char, %i
-bitfield, int, %s, describe_bitfield:p.name:'"%s"'%p.type
+bitfield, int, %s, describe_bitfield
byte, char, %i
ubyte, char, %u
short, short, %i
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)
wl(' GlPrintData *gpd = (GlPrintData *)user_data;')
w(' snprintf(gpd->buffer, gpd->bufsize, "%s(', func.name)
first = True
+pname = None
for p in params:
if not first:
w(', ')
+ if p.name=="pname":
+ pname = p
if p.kind=="value":
- w('%s', p.io[1])
+ if pname and p.name=="param" and p.base_ctype=="GLint":
+ w('%%s')
+ elif p.type=="TextureComponentCount":
+ w('%%s')
+ else:
+ w('%s', p.io[1])
elif p.kind=="reference" and not p.io:
w('<ref:%s %%p>', p.type)
else:
for p in params+[ret]:
if p.ctype!="void":
if p.kind=="value":
- if len(p.io)>=3 and p.io[2]:
+ if pname and p.name=="param" and p.base_ctype=="GLint":
+ w(', print_parameter(%s, %s)', pname.name, p.name)
+ elif p.type=="TextureComponentCount":
+ w(', print_internal_format(%s)', p.name)
+ elif len(p.io)>=3 and p.io[2]:
w(', %s(%s, "%s")', p.io[2], p.name, p.type)
else:
w(', %s', p.name)