Re: sharing opengl context with c

amand <[email protected]> Mon, 01 Sep 2014 14:25:19 +0200
Newsgroups gmane.comp.python.opengl.user
Message-ID <[email protected]>
> On 14-08-20 12:38 PM, amand wrote:
>> Hello!
>> 
>> I'am working on a project in C and I need to draw PyOpenGL stuff with
>> embedded python.
>> 
>> So far I have been able to draw with the embedded python. But it does
>> not work every time...
>> 
>> Sometimes, the Python module just raises an error (Exception
>> OpenGL.error.GLError: GLError( err=1281, description = 'invalid 
>> value',
>> baseOperation = glVertexAttribPointer)), and some other times, it's
>> working perfectly...
>> 
>> Is there a way to share the OpenGL context without any errors?
> 
> Carefully.
> 
> Basically you need to make sure that your C code is not interfering 
> with
> the Python code. GL state is a monolithic thing, so if your C code is
> modifying the bound VBO, shader, etc while you are rendering then you
> are going to see failures where your Python is attempting to use the
> modified state. You need to ensure that you are always suspending C
> rendering before you enter Python (and suspending it in a known state),
> and then re-enabling C rendering when you are done.
> 
> HTH,
> Mike

Thanks for your response!
It's now working, there were some gl errors raised by C in my code. I 
will follow your advice!


-- 
amand.

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net