[Pyobjc-dev] Confused on opaque pointers
Brought to you by:
ronaldoussoren
|
From: Andy M. <nzm...@gm...> - 2008-12-31 00:50:26
|
I'm using the OpenGl library (successfully) with an __init__ that looks
like:
import objc as _objc
import sys
__bundle__ = _objc.initFrameworkWrapper("CGL",
frameworkIdentifier="com.apple.opengl",
frameworkPath=_objc.pathForFramework(
"/System/Library/Frameworks/OpenGL.framework"),
globals=globals())
However there is a function that takes an opaque pointer that I'm struggling
to wrap.
The opaque pointer is CGLPixelFormatObj and it's defined as
typedef struct _CGLPixelFormatObject *CGLPicelFormatObj;
The function I need to use is CGLChoosePixelFormat defined as
CGLError CGLChoosePixelFormat ( const CGLPixelFormatAttribute *attribs,
CGLPixelFormatObj *pix, GLint *npix )
The ChoosePixelFormat function uses the Attributes (which I can create OK)
to modify the PixelFormatObj pointer to point to a newly created Object as
well as modifying npix to represent the number of screens..
First problem is that I am unable to create a CGLPixelFormatObj - get a
TypeError: Cannot create CGLPixelFormatObj objects. I've tried using
createOpaquePointerType without any success.. How do I get this pointer
creates - -and then once I do that I presume I'll need to tweak the calling
signature of ChoosePixelFormat to return the modified 'pix' and 'npix' ?
Thanks
Andy
|