Re: [PyOpenGL-Users] Textures usage
Brought to you by:
mcfletch
From: Frédéric <fre...@gb...> - 2010-01-08 16:10:46
|
On vendredi 08 janvier 2010, Gijs wrote: > > Ok, I will first try glCopyTexImage2D. From where should I call it? > > Should it be in a GL-specific context? What if the image ratio change? > > How do I handle this? Can I resize the texture? > > Well, depends on your implementation where you'd want to put the > glCopyTex command, but probably somewhere after or before the drawing > function. My goal is to make a slideshow program. So, new images are loaded according to the timeline... But I presume that I can't use opengl functions outside initializeGL(), resizeGL() or paintGL() methods, in my callback binded to that timeline? > If you want to draw a texture that has dimensions of 512x512 > on a 640x480 screen, OpenGL just resizes the texture accordingly. The > final image might look a bit crushed or stretched, depending on the > resolution that you draw at and the original resolution of your > texture, so you might need something like mipmapping to fix this. But > try it without mipmapping first. My question was more about the ratio; as you can see in the code, I compute the mapping of the texture from the image size. But then, if I want to load a new image with a different ratio, how do I expand/shrink the previous one? -- Frédéric http://www.gbiloba.org |