7cbe8acf30
Now the code is being compiled through .lib files!
52 lines
991 B
C++
52 lines
991 B
C++
#include "LitShadowedScene.h"
|
|
|
|
#include <charcoal/deps.h>
|
|
#include <charcoal/Util.h>
|
|
#include <charcoal/MeshFactory.h>
|
|
|
|
#include "GLUtil.h"
|
|
|
|
namespace charcoal
|
|
{
|
|
namespace builtin
|
|
{
|
|
namespace litshadowed
|
|
{
|
|
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, m_p_camera->get_world_to_view_matrix());
|
|
glutil::uniform_vec3(4, m_p_camera->get_position());
|
|
glutil::uniform_uint(5, (unsigned int)m_lights.size());
|
|
glutil::uniform_lights(6, m_lights);
|
|
for (auto iter = m_batches.begin(); iter != m_batches.end(); ++iter)
|
|
{
|
|
iter->render();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |