namespace Msp {
namespace GL {
+Renderer::Renderer():
+ default_camera(0)
+{
+ init();
+}
+
Renderer::Renderer(const Camera *c):
- default_camera(c),
- changed(0),
- state_stack(1)
+ default_camera(c)
+{
+ init();
+
+ if(c)
+ set_camera(*c);
+}
+
+void Renderer::init()
{
state_stack.reserve(16);
+ state_stack.push_back(State());
shdata_stack.reserve(32);
state = &state_stack.back();
- if(c)
- set_camera(*c);
- else
- {
- standard_shdata.uniform("projection_matrix", Matrix());
- standard_shdata.uniform("eye_world_matrix", Matrix());
- }
+ standard_shdata.uniform("projection_matrix", Matrix());
+ standard_shdata.uniform("eye_world_matrix", Matrix());
}
Renderer::~Renderer()
std::set<const Renderable *> excluded;
public:
- Renderer(const Camera *);
+ Renderer();
+ DEPRECATED Renderer(const Camera *);
+private:
+ void init();
+public:
~Renderer();
/** Sets the camera to render from. The modelview matrix is reset to the