The vertex buffer implementation uses the shader manager to decide
whether core painting should be used or not. Shader manager is only
used by shaders using vertex attributes instead of gl_Vertex etc.
This includes quite some refactoring. For the cube cap a VBO is used
instead of glLists and all the required transformations are moved into
paintCap() which makes paintScreen more clean.
Currently the mirroring of bottom texture is still missing and cylinder
and sphere caps are not yet ported to using VBO.
I wouldn't be surprised if it is broken for legacy GL atm.
CoverSwitch uses new concept of combining a custom fragment shader with the
built-in generic vertex shader. This shader is used to render the reflection
plane on top of the reflected windows.
The fragment shader uses two uniform colors for front and back and interpolates
between them based on the texcoords (which are not used for texture lookup).
The reflection plane vertices could be buffered.
ShaderManager supports a new concept to load just a fragment shader from file
and use a built-in shader for the vertex shader. This allows an effect to use
a custom fragment shader.
Currently working:
* cube slide
* basic cube
* rotations
* reflections
Not working:
* Cube Inside effects
* Reflection plane (needs to be done in a shader)
* cube caps
* sphere/cylinder
* filled in areas in multi desktop
The ShaderManager provides the built-in shaders for scene and effects.
Scene and effects can simply push one of those built-in shaders or a
custom one on a stack ensuring that the previously bound shader will be
rebound when the shader is poped again.
The class will be extended to not only have built-in shaders but also to
load custom shaders and being the only way to bind a shader at all.