Commit 647b1570 authored by Philip Trettner's avatar Philip Trettner

changed default to no-rendering-pipeline (and renamed the option)

parent b8ab3f3c
......@@ -83,10 +83,10 @@ bool GlfwApp::shouldClose() const
void GlfwApp::init()
{
if (!mUseDefaultCamera && mUseDefaultRendering)
if (!mUseDefaultCamera && mUseRenderingPipeline)
glow::error() << "Cannot use default rendering without default camera in GlfwApp.";
if (mUseDefaultCamera || mUseDefaultRendering)
if (mUseDefaultCamera || mUseRenderingPipeline)
{
// create camera with some sensible defaults
mCamera = std::make_shared<camera::GenericCamera>();
......@@ -94,7 +94,7 @@ void GlfwApp::init()
mCamera->setTarget({0, 0, 0});
}
if (mUseDefaultRendering)
if (mUseRenderingPipeline)
{
// include paths (BEFORE pipeline init)
DefaultShaderParser::addIncludePath(util::pathOf(__FILE__) + "/../../../pipeline/shader");
......@@ -134,7 +134,7 @@ void GlfwApp::update(float elapsedSeconds)
void GlfwApp::render(float elapsedSeconds)
{
if (mUseDefaultRendering)
if (mUseRenderingPipeline)
{
assert(mPipeline && "did you forgot to call GlfwApp::init() in your init?");
mPipeline->render([this, elapsedSeconds](const pipeline::RenderPass &pass) { renderPass(pass, elapsedSeconds); });
......@@ -143,7 +143,7 @@ void GlfwApp::render(float elapsedSeconds)
void GlfwApp::renderPass(const pipeline::RenderPass &pass, float elapsedSeconds)
{
if (mUseDefaultRendering)
if (mUseRenderingPipeline)
debug()->renderPass(pass);
}
......@@ -256,7 +256,7 @@ bool GlfwApp::onMouseButton(double x, double y, int button, int action, int mods
{
glm::vec3 pos;
float depth;
if (mUseDefaultRendering && mUseDefaultCameraHandling && mPipeline->queryPosition3D(x, y, &pos, &depth))
if (mUseRenderingPipeline && mUseDefaultCameraHandling && mPipeline->queryPosition3D(x, y, &pos, &depth))
{
mCamera->setPosition(pos - mCamera->getForwardDirection() * mCamera->getLookAtDistance());
mCamera->setTarget(pos, {0, 1, 0});
......
......@@ -67,6 +67,9 @@ enum class CursorMode
* - if you use primitive/occlusion queries, use setQueryStats(false);
* - overwrite onResetView if you want a different default view
*
* Defaults:
* - A GenericCamera with input handling on LMB/RMB/WASD/... (setUseDefaultXYZ to configure)
*
* Usage:
* int main(int argc, char *argv[])
* {
......@@ -79,8 +82,8 @@ class GlfwApp
private:
std::string mTitle = "GLFW/GLOW Application"; ///< window title
double mUpdateRate = 60; ///< rate at which update(...) is called
int mMaxFrameSkip = 4; ///< maximum number of update(...) steps that are performed without rendering
double mUpdateRate = 60; ///< rate at which update(...) is called
int mMaxFrameSkip = 4; ///< maximum number of update(...) steps that are performed without rendering
GLFWwindow* mWindow = nullptr; ///< current GLFW window
TwBar* mTweakbar = nullptr; ///< main tweakbar window
......@@ -102,12 +105,13 @@ private:
double mOutputStatsInterval = 5.0; ///< number of seconds between stats output (0.0 for never)
bool mQueryStats = true; ///< if true, queries stats (vertices, fragments, ...)
bool mUseDefaultCamera = true; ///< if true, uses default camera
bool mUseDefaultRendering = true; ///< if true, uses default rendering pipeline setup (requires default cam)
bool mUseDefaultCameraHandling = true; ///< if true, implements default cam handling
bool mUseDefaultCamera = true; ///< if true, uses default camera
bool mUseDefaultCameraHandling = true; ///< if true, implements default cam handling
bool mUseDefaultCameraHandlingLeft = true; ///< if true, activates left mouse button handling
bool mUseDefaultCameraHandlingRight = true; ///< if true, activates right mouse button handling
bool mUseRenderingPipeline = false; ///< if true, uses default rendering pipeline setup (requires default cam)
double mCurrentTime = 0.0; ///< current frame time (starts with 0)
double mDoubleClickTime = 0.35f; ///< max number of seconds for multi clicks
......@@ -153,7 +157,7 @@ public:
GLOW_PROPERTY(VSync);
GLOW_PROPERTY(OutputStatsInterval);
GLOW_PROPERTY(QueryStats);
GLOW_PROPERTY(UseDefaultRendering);
GLOW_PROPERTY(UseRenderingPipeline);
GLOW_PROPERTY(DoubleClickTime);
float getCurrentTime() const { return mCurrentTime; }
double getCurrentTimeD() const { return mCurrentTime; }
......@@ -170,6 +174,7 @@ public:
void setTitle(std::string const& title);
/// Only works with setUseRenderingPipeline(true)
debugging::SharedDebugRenderer const& debug() const { return mDebugRenderer; }
glm::vec2 getMousePosition() const { return {mMouseX, mMouseY}; }
......
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