Passes, Material Swap, and Attaching Shaders

BlitzMax Forums/BlitzMax OpenGL Programming/Passes, Material Swap, and Attaching Shaders

Look up Vertex Buffer Objects. With a few simple function calls you can have GL store your Vertex Arrays (be it position/color/UVs e.t.c) in video memory on the GFX card rather than system memory.

This obviously saves you having to transfer the arrays every time you want to draw geometry.

Each time you do wish to draw, you simply bind the buffer (tell GL you'll be using the data stored on the GFX card) and call your draw functions as normal but you send it a NULL pointer instead of your vertex array pointer.

This is ideal for any static data, although there are functions for changing data in the 'VBO'.

Also look up setting a priority for your textures, you can give them a value indicating how important it is for GL to keep them in GFX card memory (based on how often they're used)

I can't see there being an issue with shaders unless you're compiling them constantly, highly unlikely.