2f6c5ee319
Almost there. Just an odd linker error so far.
47 lines
770 B
C++
47 lines
770 B
C++
#include "SpecifiedScene.h"
|
|
|
|
#include <charcoal/deps.h>
|
|
|
|
#include "GLUtil.h"
|
|
|
|
namespace charcoal
|
|
{
|
|
namespace builtin
|
|
{
|
|
namespace specified
|
|
{
|
|
void Scene::init()
|
|
{
|
|
for (auto iter = m_batches.begin(); iter != m_batches.end(); ++iter)
|
|
{
|
|
Batch& batch = *iter;
|
|
batch.init();
|
|
add_prerenderable(&batch);
|
|
}
|
|
}
|
|
|
|
void Scene::use()
|
|
{
|
|
// TODO: move to glutil
|
|
glEnable(GL_DEPTH_TEST);
|
|
glDepthFunc(GL_LESS);
|
|
}
|
|
|
|
void Scene::unuse()
|
|
{
|
|
|
|
}
|
|
|
|
void Scene::render()
|
|
{
|
|
glutil::clear_screen();
|
|
m_shader_program.use();
|
|
glutil::uniform_matrix(0, get_camera()->get_world_to_view_matrix());
|
|
for (auto iter = m_batches.begin(); iter != m_batches.end(); ++iter)
|
|
{
|
|
iter->render();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |