renderer.transform(matrix);
}
+unsigned ObjectInstance::get_level_of_detail(const Renderer &renderer) const
+{
+ return renderer.get_object_lod_bias();
+}
+
ObjectInstance::Loader::Loader(ObjectInstance &o):
DataFile::ObjectLoader<ObjectInstance>(o)
anything. */
virtual void finish_render(Renderer &, const Tag &) const { }
- virtual unsigned get_level_of_detail(const Renderer &) const { return 0; }
+ virtual unsigned get_level_of_detail(const Renderer &) const;
};
} // namespace GL
state->reverse_winding = r;
}
+void Renderer::set_object_lod_bias(unsigned b)
+{
+ state->object_lod_bias = b;
+}
+
void Renderer::push_state()
{
state_stack.push_back(state_stack.back());
mesh(0),
vertex_setup(0),
winding_test(0),
- reverse_winding(false)
+ reverse_winding(false),
+ object_lod_bias(0)
{ }
} // namespace GL
const VertexSetup *vertex_setup;
const WindingTest *winding_test;
bool reverse_winding;
+ unsigned object_lod_bias;
State();
};
void set_winding_test(const WindingTest *);
void set_reverse_winding(bool);
+ void set_object_lod_bias(unsigned);
+ unsigned get_object_lod_bias() const { return state->object_lod_bias; }
+
/** Saves the current state so it can be restored later. */
void push_state();