mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 03:29:19 +02:00
fix wireframe
This commit is contained in:
@@ -356,15 +356,8 @@ void TWorld::OnKeyDown(int cKey) {
|
|||||||
// shift + f7 is currently unused
|
// shift + f7 is currently unused
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// f7: wireframe toggle
|
// TODO: pass this to renderer instead of poking in globals
|
||||||
// TODO: pass this to renderer instead of making direct calls
|
|
||||||
Global.bWireFrame = !Global.bWireFrame;
|
Global.bWireFrame = !Global.bWireFrame;
|
||||||
if( true == Global.bWireFrame ) {
|
|
||||||
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
13
renderer.cpp
13
renderer.cpp
@@ -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) +
|
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) +
|
" 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);
|
" trc: " + to_string(m_debugstats.traction) + " lin: " + to_string(m_debugstats.lines);
|
||||||
|
if (DebugModeFlag)
|
||||||
|
m_debugtimestext += m_textures.info();
|
||||||
|
|
||||||
++m_framestamp;
|
++m_framestamp;
|
||||||
|
|
||||||
@@ -339,6 +341,11 @@ void opengl_renderer::Render_pass(rendermode const Mode)
|
|||||||
|
|
||||||
m_colorpass = m_renderpass;
|
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);
|
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_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);
|
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);
|
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||||
glViewport(0, 0, Global.iWindowWidth, Global.iWindowHeight);
|
glViewport(0, 0, Global.iWindowWidth, Global.iWindowHeight);
|
||||||
m_pfx->apply(*m_main_tex, nullptr);
|
m_pfx->apply(*m_main_tex, nullptr);
|
||||||
@@ -3034,11 +3042,6 @@ void opengl_renderer::Update(double const Deltatime)
|
|||||||
m_textures.update();
|
m_textures.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true == DebugModeFlag)
|
|
||||||
{
|
|
||||||
m_debugtimestext += m_textures.info();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((true == Global.ControlPicking) && (false == FreeFlyModeFlag))
|
if ((true == Global.ControlPicking) && (false == FreeFlyModeFlag))
|
||||||
{
|
{
|
||||||
Update_Pick_Control();
|
Update_Pick_Control();
|
||||||
|
|||||||
Reference in New Issue
Block a user