Re: Drawing a texture into a pyglet window

Brice Thurin <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAMww5+Z1YNCCKyQR_WPwe-+5UJW8KBnn2aFrHV7w_9x-J+7Q1g@mail.gmail.com>
Dear Ian,

Thank you for your reply. What I do not understand is that most of this
code work fine when I am using Pyopengl with GLUT but it fails when I use
is with a pyglet window?


On 14 January 2012 04:12, Ian Mallett <[email protected]> wrote:

> 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.
>

I am intending to apply a gaussian filter with a shader once I got this bit
working. It is why I am using glFloat. I thought the maximum value in that
case would be 1.0.


>
> Actually, if this is your first OpenGL program, I'm rather
> impressed--you've gotten pretty far.
>

Well, I found bits and pieces by searching the web.


> 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.
>
- Could you tell me why I should not use GL_LUMINANCE



> -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
>

Many thanks

Brice

------------------------------------------------------------------------------
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.