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;
|
gameStart = false;
|
||||||
renderShadows = true;
|
renderShadows = true;
|
||||||
renderFlames = true;
|
renderFlames = true;
|
||||||
|
renderWorld = true;
|
||||||
renderDebug = false;
|
renderDebug = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,9 +474,12 @@ void Graphics::render(double time)
|
|||||||
lightingShader->setUniform("movement", wind);
|
lightingShader->setUniform("movement", wind);
|
||||||
|
|
||||||
lightingShader->setUniform("time", (float) time);
|
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
|
// draw flames on top
|
||||||
if (renderFlames) {
|
if (renderFlames) {
|
||||||
@ -702,3 +706,11 @@ void Graphics::setRenderDebug(bool state) {
|
|||||||
bool Graphics::getRenderDebug() {
|
bool Graphics::getRenderDebug() {
|
||||||
return renderDebug;
|
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 setRenderShadows(bool state);
|
||||||
void setRenderFlames(bool state);
|
void setRenderFlames(bool state);
|
||||||
void setRenderDebug(bool state);
|
void setRenderDebug(bool state);
|
||||||
|
void setRenderWorld(bool state);
|
||||||
bool getRenderShadows();
|
bool getRenderShadows();
|
||||||
bool getRenderFlames();
|
bool getRenderFlames();
|
||||||
bool getRenderDebug();
|
bool getRenderDebug();
|
||||||
|
bool getRenderWorld();
|
||||||
private:
|
private:
|
||||||
void bindTextureUnits();
|
void bindTextureUnits();
|
||||||
void updateLights();
|
void updateLights();
|
||||||
@ -81,6 +83,7 @@ class Graphics {
|
|||||||
bool renderShadows;
|
bool renderShadows;
|
||||||
bool renderFlames;
|
bool renderFlames;
|
||||||
bool renderDebug;
|
bool renderDebug;
|
||||||
|
bool renderWorld;
|
||||||
DebugDraw debugDrawer;
|
DebugDraw debugDrawer;
|
||||||
SharedArrayBuffer debug_ab;
|
SharedArrayBuffer debug_ab;
|
||||||
SharedVertexArrayObject debug_vao;
|
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) {
|
if (_key == GLFW_KEY_F7 && _action == GLFW_PRESS) {
|
||||||
app.getGraphics()->setRenderDebug(!app.getGraphics()->getRenderDebug());
|
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) {
|
static void mouseCallback(GLFWwindow* window, int button, int action, int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user