Re: access violation when calling glGenFramebuffers

Chris Barker - NOAA Federal <[email protected]> Thu, 4 Apr 2013 08:55:35 -0700
Newsgroups gmane.comp.python.opengl.user
Message-ID <CALGmxE+PM7WqN_wEuR3w1K4MwtefM_pxdjw-8nY=z6UkiCw4FQ@mail.gmail.com>
On Wed, Apr 3, 2013 at 10:24 AM, Cyrille Rossant
<[email protected]> wrote:

> How much RAM do you have? If you have an Intel HD card I suppose that you
> don't have so much memory that you absolutely need Python 64 bits (with 32
> bits you're probably limited to ~4GB objects).

actually 2GB on Windows, and I think that's for the whole process --
but that's still a lot for most applications.

>> I replaced
>>
>>          self.framebuffer_id = glGenFramebuffers(1);
>>
>> with
>>
>>          fbo = ctypes.c_uint(1)
>> OpenGL.raw.GL.EXT.framebuffer_object.glGenFramebuffersEXT(1,
>> ctypes.byref(fbo))
>>          self.framebuffer_id = int(fbo.value)
>>
>> I'm not sure if the code is ctype-wise correct but I think that doesn't
>> make a real difference for the error:
>>
>> Traceback (most recent call last):
>> ...
>>    File "C:\Users\Patrick\Dev\PCT\open_gl_widgets.py", line 203, in
>> __init__
>>      OpenGL.raw.GL.EXT.framebuffer_object.glGenFramebuffersEXT(1,
>> ctypes.byref(fbo))
>>    File "C:\Python27\lib\site-packages\OpenGL\platform\baseplatform.py",
>> line 379, in __call__
>>      return self( *args, **named )
>> WindowsError: exception: access violation writing 0xFFFFFFFFE812A790

well, that is a bigger-than-32bit address -- I suppose it's possible
that this is a 32/64 bit issue.

Can you test it with 32 bit python? Even if you don't want to
ultimatley go that route, it may give you a hint.

Also, from teh ctypes docs:

c_uint	is a unsigned int

you may have some issues there, an "int" is a really poorly defined
type, and depending on the compiler, it may be 32 bits on 32bit
systems, and 32 or 64 bit on 64 bit systems (and the MS compilers and
gnu do it differently), so there could be some mis-match there.

It's beyond me that C has survived this long with such soft defining
of type sizes! Here's hoping that people start using the C99 defined
size integer types sooner than later...

(though from the looks of it, ctypes doesn't support those either...)

Not sure this is any help, though.

-Chris



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net