Re: Drawing a texture into a pyglet window

Ian Mallett <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAG4NV=vdqc++r8uo253TixPKWTxQJ5MioaxWLTcqFfz=_W5k2w@mail.gmail.com>
Hi,

Crashes line 36/38 with index out of bounds.  Changing the index to 0 in
both cases.

As to your problem:
-Line 59, you set GL's color to black.  Set it to white.
-Scale Z by 255.0 on line 82.

Actually, if this is your first OpenGL program, I'm rather
impressed--you've gotten pretty far.  Tips:
-Change line 38 to not fullscreen.  You'll find this is easier to debug.
-Functional programming for right now.  OO design just to wrap up some
functions is overkill.
-Be sure to only load your textures once.  Take it out of your draw method.
-Don't use GL_LUMINANCE.  Use GL_RGB, and GL_RGBA.  If you're all for speed
and are feeling up to it, always use GL_BGRA, because that's often how the
GPU represents it internally.
-Clean up after yourself with glDeleteTextures.  Eventually, you should
make a texture class for all your textures, and you'll put this in its
destructor.
-Check out some tutorials.

Ian

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.