Re: Opengl Constant problem

Wojciech Daniło <[email protected]> Sun, 20 Jan 2013 01:20:14 +0100
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAOWw=Gh25CRq_RqkLTZP2hYPbTA+PbZ=40JPvjZ_UZoKtZm-pw@mail.gmail.com>
Thank you for your response! The version without ARB suffix seems to work.
I'm facing right now another problem with this snippet - the program starts
and gets segmentation fault when calling glUseProgram(self.program).
`print self.program` gives number 1.
Additional, as you can see in the code,  `self.program =
compile_program(self.vertex_shader_src, self.fragment_shader_src)` which is
a function returning the output of `glCreateProgram()`
There is no additional information about it, only segfaul. Could ou please
tell me what can cause this?

Thank you!

2013/1/19 Mike C. Fletcher <[email protected]>

> On 13-01-18 07:32 PM, Wojciech Daniło wrote:
> > Hi! I'm new to OpenGL and PyOpenGL, but Im trying to create a project
> > to my colledge and I'm facing a big problem. I was trying to resolve
> > it but without luck :(
> >
> > I'm trying to execute the python example (volume rendering in
> > pyopengl) from http://www.siafoo.net/snippet/310, which uses the code
> > from http://www.siafoo.net/snippet/142 and in that code the author
> > uses PyOpenGL constant GL_STATIC_DRAW_ARB.
> >
> > Unfortunatelly my Python (2.7) with PyOpengl 3.0.2-r1000 complains,
> > that this variable is not defined (gentoo linux, x86 64).
> >
> > It is used though in some examples like:
> > http://www.songho.ca/opengl/gl_vbo.html.
> >
> > So the api has changed? Or maybe the example is wrong?
> The namespace was cleaned up, so that you only get the ARB constants if
> you explicitly import them, but your snippets are actually using *core*
> entry points, so you may as well use the core constant:
>
> GL_STATIC_DRAW
>
> if you really want to use the ARB version:
>
> from OpenGL.GL.ARB.vertex_buffer_object import *
>
> but there's no reason to do that unless you want to use glBufferDataARB
> too.
>
> > How can I use glBufferData from OpenGl and what to pass as fourth
> > argument to make it working?
> >
> > In the example there was glBufferData(GL_ARRAY_BUFFER, data[i],
> > GL_STATIC_DRAW_ARB), where data is numpy array containing volume
> > representation of an object.
>
> Just drop the _ARB. There is also an OpenGL.arrays.vbo.VBO helper class
> that can be used, should you want to avoid some of the lower-level details.
>
> Hope that helps,
> Mike
>
> --
> ________________________________________________
>    Mike C. Fletcher
>    Designer, VR Plumber, Coder
>    http://www.vrplumber.com
>    http://blog.vrplumber.com
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122912
> _______________________________________________
> PyOpenGL Homepage
> http://pyopengl.sourceforge.net
> _______________________________________________
> PyOpenGL-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyopengl-users
>

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users