Here’s an evil puzzle for you to solve. You’re a programmer trying to create an RTS game engine, and your project has the following restrictions:
-
You are trying to target a very large number of platforms and system configurations, so you shouldn’t use any OpenGL extensions unless you have an alternative for ALL cards that don’t support it.
-
You have a great number of legacy 8-bit palettized textures you have to use, all potentially at the same time, and you can’t change the format in which they are stored on disk.
-
Your code has to be able to change the palette of any 8-bit texture being rendered. The texture may even be rendered several times per frame with a different palette each frame.
-
Memory usage must be kept to a minimum. Therefore, converting every 8-bit texture to 32-bits and having separate copies of each 32-bit image for each palette is NOT an option.
-
Your code must have a reasonable frame rate on a GeForce or better. (It can be slower on older generation cards, but it must be able to run on those slower cards.)
-
You must include support for 32-bit RGBA textures.
Well, I think that’s it for the restrictions. Good luck!