Welcome and ok.
Will do a bit more research into why the crash is occurring then.
Current code
class CBlock(ObjCBlock):
def __init__(self, func, restype=None, argtypes=None):
super(CBlock, self).__init__(func, restype=None, argtypes=None)
self.func = func
type_encodings['@?'] = CBlock
default_opt = {
'GLKTextureLoaderApplyPremultiplication': 0,
'GLKTextureLoaderGenerateMipmaps': 0,
'GLKTextureLoaderOriginBottomLeft': 0,
'GLKTextureLoaderGrayscaleAsAlpha': 0,
'GLKTextureLoaderSRGB': 0
}
DEFAULTS = ns(default_opt)
class GLKTextureLoader:
def __init__(self, sharegroup=None):
if sharegroup is None:
sharegroup = currentContext().sharegroup
print sharegroup
tl = ObjCClass('GLKTextureLoader')
self._loader = tl.alloc().initWithSharegroup_(sharegroup._sharegroup)
def textureFromFile(self, path):
callback = CBlock(GLKTextureLoaderCallback, restype=None, argtypes=[ctypes.c_void_p, ctypes.c_void_p])
print dir(self._loader)
print DEFAULTS
# self._loader.textureWithContentsOfFile_options_queue_completionHandler_(path, DEFAULTS, None, callback)
Note currentContext() is just a wrapper for EAGLContext.currentContext() where EAGLContext has not been allocated or initialised.