Added switch for rendering world.
This commit is contained in:
parent
ab6d2e4ffd
commit
a725cf8b43
@ -28,6 +28,7 @@ Graphics::Graphics(glm::uvec2 windowSize, float nearPlane,
|
||||
gameStart = false;
|
||||
renderShadows = true;
|
||||
renderFlames = true;
|
||||
renderWorld = true;
|
||||
renderDebug = false;
|
||||
}
|
||||
|
||||
@ -473,9 +474,12 @@ void Graphics::render(double time)
|
||||
lightingShader->setUniform("movement", wind);
|
||||
|
||||
lightingShader->setUniform("time", (float) time);
|
||||
|
||||
// render the level
|
||||
level->render(lightingShader, true, &lightingViewProjectionMatrix, &depthBiasVPs);
|
||||
|
||||
|
||||
if (renderWorld) {
|
||||
// render the level
|
||||
level->render(lightingShader, true, &lightingViewProjectionMatrix, &depthBiasVPs);
|
||||
}
|
||||
|
||||
// draw flames on top
|
||||
if (renderFlames) {
|
||||
@ -702,3 +706,11 @@ void Graphics::setRenderDebug(bool state) {
|
||||
bool Graphics::getRenderDebug() {
|
||||
return renderDebug;
|
||||
}
|
||||
|
||||
void Graphics::setRenderWorld(bool state) {
|
||||
renderWorld = state;
|
||||
}
|
||||
|
||||
bool Graphics::getRenderWorld() {
|
||||
return renderWorld;
|
||||
}
|
||||
|
@ -28,9 +28,11 @@ class Graphics {
|
||||
void setRenderShadows(bool state);
|
||||
void setRenderFlames(bool state);
|
||||
void setRenderDebug(bool state);
|
||||
void setRenderWorld(bool state);
|
||||
bool getRenderShadows();
|
||||
bool getRenderFlames();
|
||||
bool getRenderDebug();
|
||||
bool getRenderWorld();
|
||||
private:
|
||||
void bindTextureUnits();
|
||||
void updateLights();
|
||||
@ -81,6 +83,7 @@ class Graphics {
|
||||
bool renderShadows;
|
||||
bool renderFlames;
|
||||
bool renderDebug;
|
||||
bool renderWorld;
|
||||
DebugDraw debugDrawer;
|
||||
SharedArrayBuffer debug_ab;
|
||||
SharedVertexArrayObject debug_vao;
|
||||
|
@ -32,6 +32,9 @@ static void keyCallback(GLFWwindow* _window, int _key, int, int _action, int)
|
||||
if (_key == GLFW_KEY_F7 && _action == GLFW_PRESS) {
|
||||
app.getGraphics()->setRenderDebug(!app.getGraphics()->getRenderDebug());
|
||||
}
|
||||
if (_key == GLFW_KEY_F8 && _action == GLFW_PRESS) {
|
||||
app.getGraphics()->setRenderWorld(!app.getGraphics()->getRenderWorld());
|
||||
}
|
||||
}
|
||||
|
||||
static void mouseCallback(GLFWwindow* window, int button, int action, int) {
|
||||
|
Loading…
Reference in New Issue
Block a user