fix wireframe

This commit is contained in:
milek7
2018-07-18 14:08:30 +02:00
parent 78b23b80aa
commit a1d11cb03b
2 changed files with 9 additions and 13 deletions

View File

@@ -356,15 +356,8 @@ void TWorld::OnKeyDown(int cKey) {
// shift + f7 is currently unused
}
else {
// f7: wireframe toggle
// TODO: pass this to renderer instead of making direct calls
// TODO: pass this to renderer instead of poking in globals
Global.bWireFrame = !Global.bWireFrame;
if( true == Global.bWireFrame ) {
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
}
else {
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
}
}
}
break;

View File

@@ -299,6 +299,8 @@ bool opengl_renderer::Render()
m_debugstatstext = "drawcalls: " + to_string(m_debugstats.drawcalls) + "; dyn: " + to_string(m_debugstats.dynamics) + " mod: " + to_string(m_debugstats.models) +
" sub: " + to_string(m_debugstats.submodels) + "; trk: " + to_string(m_debugstats.paths) + " shp: " + to_string(m_debugstats.shapes) +
" trc: " + to_string(m_debugstats.traction) + " lin: " + to_string(m_debugstats.lines);
if (DebugModeFlag)
m_debugtimestext += m_textures.info();
++m_framestamp;
@@ -339,6 +341,11 @@ void opengl_renderer::Render_pass(rendermode const Mode)
m_colorpass = m_renderpass;
if (Global.bWireFrame)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
{
setup_shadow_map(nullptr, m_renderpass);
@@ -417,6 +424,7 @@ void opengl_renderer::Render_pass(rendermode const Mode)
m_main_fb->clear(GL_COLOR_BUFFER_BIT);
m_msaa_fb->blit_to(*m_main_fb.get(), Global.render_width, Global.render_height, GL_COLOR_BUFFER_BIT);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_FRAMEBUFFER_SRGB);
glViewport(0, 0, Global.iWindowWidth, Global.iWindowHeight);
m_pfx->apply(*m_main_tex, nullptr);
@@ -3034,11 +3042,6 @@ void opengl_renderer::Update(double const Deltatime)
m_textures.update();
}
if (true == DebugModeFlag)
{
m_debugtimestext += m_textures.info();
}
if ((true == Global.ControlPicking) && (false == FreeFlyModeFlag))
{
Update_Pick_Control();