Re: [PyOpenGL-Users] Converted C++ project to python project (some issues)
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2011-04-17 23:12:23
|
On 11-04-17 06:50 PM, Derakon wrote: > On Sun, Apr 17, 2011 at 3:36 PM, Abhijeet Rastogi > <abh...@gm...> wrote: >> I have tried my best to explain the issue. Its probably a very small issue >> with textures variable acquiring None value but I am not able to solve the >> bug. > Have you tried printing the value of the textures variable after each > time it's changed? That should quickly tell you where it's going > wrong. > > -Chris Abhijeet, here's the changes I needed to make to get what I *think* is a working version of your code... mcfletch@sturm:~/OpenGL-dev/imagesnone$ diff -w main-orig.py main.py 177c177 < textures = glGenTextures(TEX_COUNT) --- > textures = None 318a319,321 > global textures > if not textures: > textures = glGenTextures(TEX_COUNT) 325d327 < global textures You are calling glGenTextures before you have a valid OpenGL context, this results in getting 4 values of 0 for the textures. Instead, only generate the texture ids the first time you need them. BTW, watch your indentation in Python, try to use either 4-space indents or if you feel very strongly about it, literal tab characters, mixing tabs and spaces is considered very bad form. The modified form does not produce any tracebacks on my machine (a Linux Ubuntu machine) until I hit one of the "buttons" in the palette. Don't have time to track down what that is, but it's likely a problem where the return type for select buffer is a custom object type in PyOpenGL. Good luck, Mike > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |