EGLConformantFlags = Flags(Int, ['EGL_OPENGL_BIT','EGL_OPENGL_ES_BIT', 'EGL_OPENGL_ES2_BIT', 'EGL_OPENVG_BIT',])
-EGLConfigAttribs = AttribArray(EGLenum, [
+EGLConfigAttribs = AttribArray(EGLint_enum, [
('EGL_ALPHA_MASK_SIZE', UInt),
('EGL_ALPHA_SIZE', UInt),
('EGL_BIND_TO_TEXTURE_RGB', EGLBoolean),
EGLTextureTarget = FakeEnum(Int, ['EGL_TEXTURE_2D', 'EGL_NO_TEXTURE' ])
def EGLAttribArray(values):
- return AttribArray(EGLenum, values, terminator = 'EGL_NONE')
+ return AttribArray(EGLint_enum, values, terminator = 'EGL_NONE')
EGLWindowsSurfaceAttribs = EGLAttribArray([
('EGL_RENDER_BUFFER', FakeEnum(Int, ['EGL_SINGLE_BUFFER', 'EGL_BACK_BUFFER'])),
Function(EGLBoolean, "eglSwapInterval", [(EGLDisplay, "dpy"), (EGLint, "interval")]),
- Function(EGLContext, "eglCreateContext", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLContext, "share_context"), (AttribArray(EGLenum, [('EGL_CONTEXT_CLIENT_VERSION', Int)]), "attrib_list")]),
+ Function(EGLContext, "eglCreateContext", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLContext, "share_context"), (AttribArray(EGLint_enum, [('EGL_CONTEXT_CLIENT_VERSION', Int)]), "attrib_list")]),
Function(EGLBoolean, "eglDestroyContext", [(EGLDisplay, "dpy"), (EGLContext, "ctx")]),
Function(EGLBoolean, "eglMakeCurrent", [(EGLDisplay, "dpy"), (EGLSurface, "draw"), (EGLSurface, "read"), (EGLContext, "ctx")]),
Function(EGLBoolean, "eglUnlockSurfaceKHR", [(EGLDisplay, "display"), (EGLSurface, "surface")]),
# EGL_KHR_image_base
- Function(EGLImageKHR, "eglCreateImageKHR", [(EGLDisplay, "dpy"), (EGLContext, "ctx"), (EGLenum, "target"), (EGLClientBuffer, "buffer"), (AttribArray(EGLenum, [('EGL_IMAGE_PRESERVED_KHR', EGLBoolean)]), "attrib_list")]),
+ Function(EGLImageKHR, "eglCreateImageKHR", [(EGLDisplay, "dpy"), (EGLContext, "ctx"), (EGLenum, "target"), (EGLClientBuffer, "buffer"), (AttribArray(EGLint_enum, [('EGL_IMAGE_PRESERVED_KHR', EGLBoolean)]), "attrib_list")]),
Function(EGLBoolean, "eglDestroyImageKHR", [(EGLDisplay, "dpy"), (EGLImageKHR, "image")]),
# EGL_KHR_fence_sync
class AttribArray(Type):
- def __init__(self, keyType, valueTypes, isConst = True, punType = None, terminator = '0'):
- self.baseType = Int
- if punType is not None:
- self.baseType = punType
+ def __init__(self, baseType, valueTypes, isConst = True, terminator = '0'):
+ self.baseType = baseType
if isConst:
Type.__init__(self, (Pointer(Const(self.baseType))).expr)
else:
Type.__init__(self, (Pointer(self.baseType)).expr)
- self.keyType = keyType
self.valueTypes = valueTypes
self.terminator = terminator
self.hasKeysWithoutValues = False
# It is currently assumed that an unknown key means that it is followed by an int value.
# determine the array length which must be passed to writeArray() up front
- count = '_c' + array.keyType.tag
+ count = '_c' + array.baseType.tag
print ' {'
print ' int %s;' % count
print ' for (%(c)s = 0; %(array)s && %(array)s[%(c)s] != %(terminator)s; %(c)s += 2) {' \
# for each key / key-value pair write the key and the value, if the key requires one
- index = '_i' + array.keyType.tag
+ index = '_i' + array.baseType.tag
print ' for (int %(i)s = 0; %(i)s < %(count)s; %(i)s++) {' % {'i': index, 'count': count}
print ' trace::localWriter.beginElement();'
- self.visitEnum(array.keyType, "%(array)s[%(i)s]" % {'array': instance, 'i': index})
+ self.visit(array.baseType, "%(array)s[%(i)s]" % {'array': instance, 'i': index})
print ' trace::localWriter.endElement();'
print ' if (%(i)s + 1 >= %(count)s) {' % {'i': index, 'count': count}
print ' break;'