Thread: [PyOpenGL-Users] glGenBuffers problem
Brought to you by:
mcfletch
From: Maximiliano G. <max...@gm...> - 2011-11-06 16:31:57
|
Hi all, this is my first message in this list. Nice to meet you all. I just started learning Computer Graphics. I'm studying in the http://www.arcsynthesis.org/gltut It is very good for graphics concepts as well opengl, their code is in c++ but I'm wanting to do it with python. So I'm tring to do the first tutorial (you can find the code here: bitbucket.org/alfonse/gltut) step by step and I ran in some problems with glGenBuffers. In [1]: from OpenGL.GL import * In [2]: buf = glGenBuffers(1) NullFunctionError: Attempt to call an undefined function glGenBuffers, check for bool(glGenBuffers) before calling In [3]: bool(glGenBuffers) Out[3]: False In [4]: glGenBuffers Out[4]: <OpenGL.platform.baseplatform.glGenBuffers at 0x10313d950> I googled for solutions, and found another way to use it with: In [5]: from OpenGL.GL.ARB.vertex_buffer_object import * In [6]: buf = glGenBuffersARB(1) But it returns me the very same problems above. I even tried to use glInitVertexBufferObjectARB() eto check if everything was ok (as I learned in http://pyopengl.sourceforge.net/documentation/opengl_diffs.html) but it gave me an Segmentation Fault I went ahead and checked the next function I would need to use: glBindBuffer, and its ARB version, both gave me the same errors of glGenBuffer. So there you have it, I'm stuck with this in the first tutorial, any help is greatly appreciated. Thanks in advance! -- Maximiliano Guerra de Medeiros |
From: Mike C. F. <vrp...@gm...> - 2011-11-08 05:20:54
|
On 11-11-06 11:31 AM, Maximiliano Guerra wrote: > Hi all, this is my first message in this list. Nice to meet you all. > > I just started learning Computer Graphics. I'm studying in > the http://www.arcsynthesis.org/gltut > It is very good for graphics concepts as well opengl, their code is in > c++ but I'm wanting to do it with python. > > So I'm tring to do the first tutorial (you can find the code > here: bitbucket.org/alfonse/gltut > <http://bitbucket.org/alfonse/gltut>) step by step and I ran in some > problems with glGenBuffers. > > In [1]: from OpenGL.GL import * > > In [2]: buf = glGenBuffers(1) > NullFunctionError: Attempt to call an undefined function glGenBuffers, > check for bool(glGenBuffers) before calling ... Your code is attempting to call OpenGL-context requiring code without an OpenGL context (window). Do the glGenBuffer and similar calls within a draw callback of your windowing system (e.g. GLUT). You may also need to verify that your machine has a reasonably recent video card that supports modern OpenGL (but most do these days). HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Maximiliano G. <max...@gm...> - 2011-11-13 20:55:58
|
Thank you so much! As I said I just started learning graphics programming, even the pipeline is still confusing to me. This is just one more detail I didn't knew. Sorry for taking so long to respond, thanks again! On Tue, Nov 8, 2011 at 2:20 AM, Mike C. Fletcher <vrp...@gm...>wrote: > On 11-11-06 11:31 AM, Maximiliano Guerra wrote: > > Hi all, this is my first message in this list. Nice to meet you all. > > I just started learning Computer Graphics. I'm studying in the > http://www.arcsynthesis.org/gltut > It is very good for graphics concepts as well opengl, their code is in c++ > but I'm wanting to do it with python. > > So I'm tring to do the first tutorial (you can find the code here: > bitbucket.org/alfonse/gltut) step by step and I ran in some problems with > glGenBuffers. > > In [1]: from OpenGL.GL import * > > In [2]: buf = glGenBuffers(1) > NullFunctionError: Attempt to call an undefined function glGenBuffers, > check for bool(glGenBuffers) before calling > > ... > > Your code is attempting to call OpenGL-context requiring code without an > OpenGL context (window). Do the glGenBuffer and similar calls within a > draw callback of your windowing system (e.g. GLUT). You may also need to > verify that your machine has a reasonably recent video card that supports > modern OpenGL (but most do these days). > > HTH, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- Maximiliano Guerra de Medeiros |