#include "texturing.h"
#include "texunit.h"
#include "vertexarray.h"
+#include "vertexsetup.h"
#include "windingtest.h"
using namespace std;
if(c)
set_camera(*c);
else
+ {
standard_shdata.uniform("projection_matrix", Matrix());
+ standard_shdata.uniform("eye_world_matrix", Matrix());
+ }
}
Renderer::~Renderer()
{
state->camera = &c;
standard_shdata.uniform("projection_matrix", state->camera->get_projection_matrix());
+ standard_shdata.uniform("eye_world_matrix", state->camera->get_view_matrix());
changed |= STANDARD_SHDATA|LEGACY_PROJECTION;
set_matrix(state->camera->get_view_matrix());
}
state->mesh = m;
}
+void Renderer::set_vertex_setup(const VertexSetup *vs)
+{
+ state->vertex_setup = vs;
+}
+
void Renderer::set_winding_test(const WindingTest *w)
{
state->winding_test = w;
if(camera_changed)
{
if(state->camera)
+ {
standard_shdata.uniform("projection_matrix", state->camera->get_projection_matrix());
+ standard_shdata.uniform("eye_world_matrix", state->camera->get_view_matrix());
+ }
else
+ {
standard_shdata.uniform("projection_matrix", Matrix());
+ standard_shdata.uniform("eye_world_matrix", Matrix());
+ }
changed |= STANDARD_SHDATA|LEGACY_PROJECTION;
}
/* This actually should compare the relevant matrices rather than check for
Lighting::unbind();
Clipping::unbind();
Program::unbind();
+ VertexSetup::unbind();
Buffer::unbind_from(ELEMENT_ARRAY_BUFFER);
WindingTest::unbind();
state->mesh->bind();
}
else
+ {
Mesh::unbind();
+ if(state->vertex_setup)
+ state->vertex_setup->bind();
+ else
+ VertexSetup::unbind();
+ }
+
if(state->winding_test)
{
if(state->reverse_winding)
shprog(0),
shdata_count(0),
mesh(0),
+ vertex_setup(0),
winding_test(0),
reverse_winding(false)
{ }