Original Post
Can anyone explain me how to use the gluScaleImage function?
Let me get more specific.
gluScaleImage(GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout);
The problem is that i want to be able to load an image with wrong dimensions e.g 144x200 and scale it to e.g 256 x 256 , so that the image data can be uploaded into a texture object.
What i do is this (in pseudo code):
- Copy texture data
- Calculate closest valid dimensions (64 x 64, 128 x 128, etc.)
- Delete the original texture data
- Allocate memory for the original texture data
- call gluScaleImage()
This doesn't work, I only see one line at the bottom of the quad (that line seems the be correct).
After copying the texture data, I check if(pCopiedTextureData[100] == pOriginalTextureData[100]) to see if the copying worked, it does.
Then I checked if the calculated valid dimensions were really valid, so I did and they were. So no problem there.
So now I checked if(pCopiedTextureData[100] == pOriginalTextureData[100]) after i deleted and allocated new memory for the pOriginalTextureData, AND THEY EQUAL?!?!
So I believe that the problem lies there.
----------
Drago
Edited by - drago on 4/29/00 7:51:30 AM