Windows Palette

I am replacing an old Windows code with OpenGL code. The palette I used in the old code does not seem to work in OpenGL, as if the indexing in OpenGL is different.

More specifically, I used a 256-color palette to draw various shapes in Windows. All I had to do is “selecting” then “realizing” the palette into a memorry device context, then drawing my shapes.

When I tried selecting this same palette and realizing it for use in OpenGL, the colors are very different, and some drawings don’t even show up. I did the same “selecting” then “realizing” into a memory device context, before creating a resource context then drawing.

Please help.