jean-bobby
07-06-2004, 08:39 AM
Hello,
I use gluScaleImage function for loading a texture. It works with 32bpp but with 16bpp my texture is totally black. The buffer for the scaled image is well allocated (by SDL) ; moreover I fill it with red color and I think I give the correct parameters to the function :
gluScaleImage(
GL_RGB,
image->w,
image->h,
GL_UNSIGNED_SHORT_5_6_5,
image->pixels,
rescaledImage->w,
rescaledImage->h,
GL_UNSIGNED_SHORT_5_6_5,
rescaledImage->pixels );
...
glTexImage2D(GL_TEXTURE_2D,
0,
3,
rescaledImage->w, rescaledImage->h,
0,
GL_RGB,
GL_UNSIGNED_SHORT_5_6_5,
rescaledImage->pixels
);There is no gl errors and I can display my texture if I don't scale its image source.
Have I forgotten to do something for 16 bits mode?
Thanks in advance
I use gluScaleImage function for loading a texture. It works with 32bpp but with 16bpp my texture is totally black. The buffer for the scaled image is well allocated (by SDL) ; moreover I fill it with red color and I think I give the correct parameters to the function :
gluScaleImage(
GL_RGB,
image->w,
image->h,
GL_UNSIGNED_SHORT_5_6_5,
image->pixels,
rescaledImage->w,
rescaledImage->h,
GL_UNSIGNED_SHORT_5_6_5,
rescaledImage->pixels );
...
glTexImage2D(GL_TEXTURE_2D,
0,
3,
rescaledImage->w, rescaledImage->h,
0,
GL_RGB,
GL_UNSIGNED_SHORT_5_6_5,
rescaledImage->pixels
);There is no gl errors and I can display my texture if I don't scale its image source.
Have I forgotten to do something for 16 bits mode?
Thanks in advance