Skip to main content
GameDev.net gamedev.net
🔒 Locked

gluScaleImage() Query....

Started by CheeseMonger Oct 31, 2002 at 11:11 AM 1 replies 350+ views
Original Post
CheeseMonger
CheeseMonger
If you:
//nImageComps = number of image components, ie 3 (R,G and B)

pPreImage = (unsigned char *)malloc(nPreWidth * nPreHeight * nImageComps);

//read in image to pPreImage

//calculate new size for image

pPostImage = (unsigned char *)malloc(nPostWidth * nPostHeight * nImageComps);

gluScaleImage(GL_BGRA_EXT,						nPreWidth, nPreHeight,						GL_UNSIGNED_BYTE, pPreImage,					nPostWidth, nPostHeight,					GL_UNSIGNED_BYTE, pPostImage);			
 
Why does gluScaleImage generate an exception? Can gluScaleImage() write to the malloc''ed memory at pPostImage? Cheers.
CheeseMonger
zedzeek
zedzeek
you say u use RGB data at the top
but use RGBA data in the gluScalemagae fucntion

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
CheeseMonger
CheeseMonger
D''oh, stupid mistake, it meant to be GL_BGR_EXT.... cheers.

- CheeseMonger
CheeseMonger

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.