   SDL Palette Swapping / Cycling
  I'm working on an NES-style game (a Mega Man clone) and am looking for a way to cycle the colors of the player when he charges up his weapon (like was possible in Mega Man 4, 5, 6, etc.).Currently my game uses 32-bit surfaces. From what I understand it would be inefficient to actually cycle colors of surfaces in 32-bit mode. (Is this incorrect/a misconception?)In reading about palette-based surfaces, the SDL documentation talks about surfaces having a logical and a physical palette and gives a brief description about each. I have to admit that the explanation is a little too brief for me and I can't make sense of it.Does anyone have any information or sample code working with palette-based surfaces in SDL?   
  Paletted 8-bit modes should be deprecated in SDL.  They are so broken that I've never gotten the palette-cycling function to work in a window.  It's strictly full-screen and I think it never works on Windows the OS either.  It did work on the older Linux version I tried it on though.You could try making a mask and using per-surface alpha-blending to try to overlay colors on your player instead.  That's about the only solution I can think of short of writing a palette shader in OpenGL's GLSL.   ;  Good to know. I kind of have that feeling, too.I have my palette-swapping code working somewhat (even in a window, on Windows) but I'm still a bit confused as to utilize the logical and physical palettes effectively.I had given some consideration to swapping out my SDL-based drawing code and switching to using OpenGL. Problem is I haven't been able to find a good beginner resource for OpenGL that uses the non-deprecated API.I'm actually very interested in learning how to accomplish this using shaders, and I'm going to research a bit more to see what's involved.   ;  A problem with a palette simulation shader is that it requires the whole screen to be paletted to work properly.  For a MegaMan clone that should be a given since all of the Nintendo 8-bit games never exceeded 56 or so colors.The biggest problem I've run into with OpenGL is trying to find a screenmode that will use 8-bit colors in its pixel-buffers.  The only suggestions I've heard is to use a 32-bit screenmode with 24-bits unused and use the red channel as the source for the shader and use it to do a CLUT (that's Color Look-Up Table) operation.   