Re: glGenTextures fails in python 3

Gary Herron <[email protected]> Thu, 26 Dec 2013 08:47:12 -0800
Newsgroups gmane.comp.python.opengl.user
Message-ID <[email protected]>
On 12/26/2013 01:00 AM, Fabien Castan wrote:
> Hi,
>
> I'm trying to move from python 2.7 to python 3.3, but I have a problem 
> with PyOpenGL.
> The call to "GL.glGenTextures(1)" fails in python 3.
>
> Regards,
> Fabien
>
> =================================================================
> $ ipython3
> *Python 3.3.2*+ (default, Oct  9 2013, 14:50:09)
> Type "copyright", "credits" or "license" for more information.
>
> In [1]: from OpenGL import GL
>
> In [2]: GL.glGenTextures
> Out[2]: OpenGL.lazywrapper.lazy( 'glGenTextures' )
>
> In [3]: GL.glGenTextures(1)
> ---------------------------------------------------------------------------
> ArgumentError                             Traceback (most recent call 
> last)
> <ipython-input-3-60d83e33f6f1> in <module>()
> ----> 1 GL.glGenTextures(1)
>
> /usr/local/lib/python3.3/dist-packages/OpenGL_accelerate/latebind.cpython-33m.so 
> <http://latebind.cpython-33m.so/> in 
> OpenGL_accelerate.latebind.Curry.__call__ (src/latebind.c:1123)()
>
> /usr/local/lib/python3.3/dist-packages/OpenGL/GL/exceptional.py in 
> glGenTextures(baseFunction, count, textures)
>     187         # do so, even though it would be easier not to bother.
>     188         textures = constants.GLuint( 0 )
> --> 189         baseFunction( count, textures)
>     190         return textures.value
>     191     else:
>
> /usr/local/lib/python3.3/dist-packages/OpenGL_accelerate/latebind.cpython-33m.so 
> <http://latebind.cpython-33m.so/> in 
> OpenGL_accelerate.latebind.LateBind.__call__ (src/latebind.c:931)()
>
> /usr/local/lib/python3.3/dist-packages/OpenGL_accelerate/wrapper.cpython-33m.so 
> <http://wrapper.cpython-33m.so/> in 
> OpenGL_accelerate.wrapper.Wrapper.__call__ (src/wrapper.c:6014)()
>
> /usr/local/lib/python3.3/dist-packages/OpenGL_accelerate/wrapper.cpython-33m.so 
> <http://wrapper.cpython-33m.so/> in 
> OpenGL_accelerate.wrapper.Wrapper.__call__ (src/wrapper.c:5948)()
>
> ArgumentError: ("argument 2: <class 'TypeError'>: No array-type 
> handler for type <class 'CArgObject'> (value: <cparam 'P' 
> (0x7fb22779a250)>) registered", (1, <cparam 'P' (0x7fb22779a250)>))
>
>
>
> =================================================================
>
> $ pip3 show PyOpenGL
> ---
> Name: PyOpenGL
> Version: 3.1.0a3
> Location: /usr/local/lib/python3.3/dist-packages



Hmmm... It works for me using Linux (Ubuntu 13.10) and PyOpenGL 3.0.2 
with Python 3.3.2.  I hope that helps.

Gary Herron


q:~> ipython3
Python 3.3.2+ (default, Oct  9 2013, 14:56:03)


In [1]: from OpenGL import GL

In [2]: GL.glGenTextures(1)
Out[2]: 0


q:~> pip3 show PyOpenGL
---
Name: PyOpenGL
Version: 3.0.2
Location: /usr/local/lib/python3.3/dist-packages

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

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