trying a texture

hi people, I’m trying to use a texture… but the texture cames all white… and the function is working, cause with some images, the texture it’s right

are you using glEnable(GL_TEXTURE_2D); ??

I’m trying this…
glGenTextures(1, &idTextura);
glBindTexture(GL_TEXTURE_2D, idTextura);
glTexImage2D(GL_TEXTURE_2D, 0, 3, imagemTextura->sizeX, imagemTextura->sizeY,
0, GL_RGB, GL_UNSIGNED_BYTE, imagemTextura->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glEnable(GL_TEXTURE_2D);

it seems to be a paramater
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

If your hardare doesn’t support the ARB_non_power_of_two texture size extension this is probably failing for the images with non-power-of-two width or height values.
You need to resize your images to a power-of-two size then, e.g. with gluScaleImage.

what do u mean by “power-of-two size” ?and how could I do that?

thanks
the size of the image was 200x242, soh I put 256x256 and it works… than… butI still wanna know what do u mean by “power-of-two size”… =) and how the method gluScaleImage works.

Ele quer dizer potênciação de dois, ou seja, um valor de expoente qualquer que tenha base dois. 2^2, 2^3, 2^4, etc
Assim, você só pode usar texturas que tenham tamanho em 32x32(2^5), 64x64(2^6), etc.

valeu cara (thanks man) :slight_smile: