Re: [PyOpenGL-Users] access violation when calling glGenFramebuffers
Brought to you by:
mcfletch
|
From: David V. <cod...@ha...> - 2013-04-16 01:55:13
|
On 4/15/2013 3:30 PM, Mike C. Fletcher wrote:
> On 13-04-14 04:37 PM, David Vierra wrote:
>> On 4/14/2013 10:15 AM, Patrick Dietrich wrote:
>>> Am 13.04.2013 03:50, schrieb David Vierra:
>>>> In OpenGL/platform/baseplatform.py, constructFunction calls
>>>> self.getExtensionProcedure and gets a small negative number as a result.
>>>> I looked at getExtensionProcedure and traced it back to the
>>>> wglGetProcAddress that is implicitly created in
>>>> OpenGL/platform/win32.py. This wglGetProcAddress is a _FuncPtr whose
>>>> restype attribute is ctypes.c_long.
>>>>
>>>> If I add another line to OpenGL/platform/win32.py after the
>>>> `getExtensionProcedure = ` line, that says:
>>>>
>>>> OpenGL.wglGetProcAddress.restype = ctypes.c_void_p
>>>>
>>> I did the same thing and it fixed the problem with glGenFramebuffers,
>>> too! Thanks a lot David!
>>> Is this a fix which can be added to the official distribution or will it
>>> cause problems on other systems?
>> It did not cause problems with my 32-bit Python, at least. I strongly
>> doubt it would cause any problems on other (non-Windows) systems since
>> the change is only made in win32.py. The fix changes the result type of
>> one function pointer, but this hints strongly that the underlying
>> problem is that the default result type for ctypes funcptrs, on 64-bit
>> Python for Windows, is only 32 bits long.
> It also didn't cause problems on my 64-bit Windows 7, and it seems
> correct, the return type *should* be a void pointer. I gather it was
> working for the other drivers because the next 4 bytes were always NULL
> with the other drivers.
>
> bzr head has the fix.
>
> HTH,
> Mike
Thanks Mike!
But I'm afraid bzr head is slightly broken ;)
File "c:\Users\Rio\Documents\src\pyopengl\OpenGL\platform\win32.py",
line 67, in Win32Platform
getExtensionProcedure.restype = ctypes.c_void_p
AttributeError: 'staticmethod' object has no attribute 'restype'
|