View Full Version : Paletted Rasterizing
Does someone have some code to show me how to set the palette when using this function:
glDrawPixels(BitmapInfo->bmiHeader.biWidth, BitmapInfo->bmiHeader.biHeight, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, BitmapBits);
It works when i use GL_LUMINANCE as Color format but that only shows grayscale... so help me with this please http://www.opengl.org/discussion_boards/ubb/smile.gif
I think that the palette functions is part of the OS. Perhaps somw wgl or GDI functions on Windows?
Nope its not OS specific... I though this was an easy question to answer?... Should i post in the advanced forum to get an good reply or what?
If you think you know why do you ask?
From a OpenGL book
"OpenGL does not have any routines to load values into the color-lookup table. Window systems typically already have such operations."
You can read the documentation yourself.
Remember that nobody have to give you a good or any kind of reply.
Well maybe i dont want to load a palette...
All i want to know is how to attach a palette to a glDrawPixels operation!
Nevermind i fixed it somehow...
Heres the code if anyone wondered what i was actually doing...
red[i] = BitmapInfo->bmiColors[i].rgbRed<<8;
green[i] = BitmapInfo->bmiColors[i].rgbGreen<<8;
blue[i] = BitmapInfo->bmiColors[i].rgbBlue<<8;
glPixelMapusv(GL_PIXEL_MAP_I_TO_R, 256,(const unsigned short *)&red );
glPixelMapusv(GL_PIXEL_MAP_I_TO_G, 256, (const unsigned short *)&green);
glPixelMapusv(GL_PIXEL_MAP_I_TO_B, 256, (const unsigned short *)&blue);
GL_COLOR_INDEX, GL_UNSIGNED_BYTE, BitmapBits);
Now its working fine!
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.