PDA

View Full Version : QGLWidget : unable to texture a quad



yellowmat
4th November 2006, 16:17
Hi everybody !

I'm learning opengl since the beginning of this week and I have a problem (many problems in fact but I solved some of the others ;) ) with texture.

I saw many examples over the net using glut and other librairies but not Qt so I tried to port samples from glut to Qt with no success.

As a result, I saw my quad but the texture is not mapped despite.

Does someone just could tell me exactly what to to (in which functions) in order to map a texture (in a png file) onto a quad ?

Thanks in advance.

yellowmat
4th November 2006, 16:30
An information that could be of importance, the image I wish to use as a texture has the following size :
width = 140
height = 200

The format of the image is png.

Hope that could help.

yellowmat
4th November 2006, 16:47
I have some news.

The image used as a texture must have width and height power of 2 ... meaning 32, 64, 128, etc, ... power of 2.

It is advise not to use images whose size is greather than 256.

I have test many textures with images whose size are 512x512 and it works. Actually I can't use an image whose size are 3020x3020 ... logical because not power of 2.

The problem is solved :)