-
- Downloads
Add Rectangle Rendering
... | ... | @@ -27,7 +27,6 @@ void Presenter::initialize() |
); | ||
// --- BEGIN test_box --- | ||
com::Folder* const test_box = gfx::object_system()->insert_object( | ||
{ "maker", "test_box" }, | ||
gfx::shader_generators()->insert_shader_forward_uniform_color(), | ||
... | ... | @@ -46,6 +45,20 @@ void Presenter::initialize() |
// --- END test_box --- | ||
com::Folder * const test_rect = gfx::object_system()->insert_object( | ||
{ "maker", "test_rect" }, | ||
gfx::shader_generators()->insert_shader_forward_uniform_color_ui(), | ||
gfx::buffer_generators()->insert_procedural_rectangle({ 2.0f, 2.0f }, "test_rect", { "maker" }) | ||
); | ||
gfx::object_system()->push_frame_back( | ||
test_rect, | ||
root()->push_back<com::Folder>("text_rect")->push_back<com::Frame>() | ||
); | ||
gfx::object_system()->get_uniforms(test_rect)->push_back<com::FileVec3>("material_ambient_color", vec3{ 0.75f, 0.75f, 0 }); | ||
gfx::object_system()->get_uniforms(test_rect)->push_back<com::FileMat4x4>("view_matrix", mat4x4{1.0f}); | ||
|
||
gfx::object_system()->get_uniforms(test_rect)->push_back<com::FileMat4x4>("model_matrix", mat4x4{1.0f}); | ||
gfx::object_system()->get_uniforms(test_rect)->push_back<com::FileMat4x4>("projection_matrix", glm::ortho(0, 320, 240, 0, -1, 1)); | ||
|
||
// --- BEGIN directional light --- | ||
com::Frame* const frame_light = root()->push_back<com::Folder>("directional_light")->push_back<com::Frame>(); | ||
... | ... | @@ -66,6 +79,7 @@ void Presenter::release() |
osi::presenters()->find<com::Folder>("maker")->erase(self_name() + ".link"); | ||
root()->erase("test_box"); | ||
root()->erase("test_rect"); | ||
} | ||
void Presenter::next_round() | ||
... | ... |