Turning around the problem of graphic cards with no palette support


Can we change the control window’s dc PIXELFORMATDESCRIPTOR so that the pixel type is a color index instead of RGBA and change dc’s palette?

Most modern graphics boards do not support color indexed rendering anymore. It’s a dying feature.

If you request a PIXELFORMATDESCRIPTOR with iPixelType = PFD_TYPE_COLORINDEX you will get the Microsoft GDI Generic OpenGL implementation normally. You can see that at the PFD_GENERIC_FORMAT bit set in the dwFlags field and the renderer string with glGetString.

Whatever you mean with “change the control window’s dc PIXELFORMATDESCRIPTOR” you can only call SetPixelFormat successfully ONCE in the lifetime of a window.

Thank you for your reply :slight_smile:

What I thought of doing, is that I can create my own palettes and pass the palette I need to apply to the scene to the control’s DC by using the SelectPalette() API. Maybe this can give us the flexibility of the hardware palette?

Did you read the manual for SelectPalette()?
It says, that you need to determine if the device supports palettes with GetDeviceCaps(hdc, RC_PALETTE) and SelectPalette() fails if it doesn’t.
I don’t know if a highcolor or true color display will return true, but I doubt it.
Do the dependent texture lookup trick I described in the other thread.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.