Commit 27681b36 authored by Philip Trettner's avatar Philip Trettner

Default values for camera in GlfwApp

parent 5e5dbb5a
......@@ -90,7 +90,12 @@ void GlfwApp::init()
DefaultShaderParser::addIncludePath(util::pathOf(__FILE__) + "/../../../material/shader");
DefaultShaderParser::addIncludePath(util::pathOf(__FILE__) + "/../../../debugging/shader");
// create camera with some sensible defaults
mCamera = std::make_shared<camera::GenericCamera>();
mCamera->setPosition({2, 2, 2});
mCamera->setTarget({0, 0, 0});
// set up rendering pipeline
mPipeline = pipeline::RenderingPipeline::create(mCamera);
mDebugRenderer = std::make_shared<debugging::DebugRenderer>();
......@@ -140,10 +145,12 @@ void GlfwApp::renderPass(const pipeline::RenderPass &pass, float elapsedSeconds)
void GlfwApp::onResize(int w, int h)
{
if (mUseDefaultRendering && mCamera && mPipeline)
if (mUseDefaultRendering)
{
mCamera->resize(w, h);
mPipeline->resize(w, h);
if (mCamera)
mCamera->resize(w, h);
if (mPipeline)
mPipeline->resize(w, h);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment