16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 10:19:19 +02:00

debug panel particle stats

This commit is contained in:
tmj-fstate
2019-10-20 18:07:05 +02:00
parent d0ac6bf599
commit ae40f5486f
4 changed files with 12 additions and 8 deletions

View File

@@ -127,13 +127,13 @@ opengl_particles::update( opengl_camera const &Camera ) {
::glPopClientAttrib();
}
void
std::size_t
opengl_particles::render( int const Textureunit ) {
if( false == Global.Smoke ) { return; }
if( m_buffercapacity == 0 ) { return; }
if( m_particlevertices.empty() ) { return; }
if( ( m_buffer == 0 ) || ( m_buffer == (GLuint)-1 ) ) { return; }
if( false == Global.Smoke ) { return 0; }
if( m_buffercapacity == 0 ) { return 0; }
if( m_particlevertices.empty() ) { return 0; }
if( ( m_buffer == 0 ) || ( m_buffer == (GLuint)-1 ) ) { return 0; }
// setup...
::glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT );
@@ -153,6 +153,8 @@ opengl_particles::render( int const Textureunit ) {
gfx::opengl_vbogeometrybank::reset();
}
::glPopClientAttrib();
return m_particlevertices.size() / 4;
}
//---------------------------------------------------------------------------

View File

@@ -25,7 +25,7 @@ public:
// methods
void
update( opengl_camera const &Camera );
void
std::size_t
render( int const Textureunit );
private:
// types

View File

@@ -359,7 +359,8 @@ opengl_renderer::Render() {
+ " paths: " + to_string( m_debugstats.paths ) + "\n"
+ " shapes: " + to_string( m_debugstats.shapes ) + "\n"
+ " traction: " + to_string( m_debugstats.traction ) + "\n"
+ " lines: " + to_string( m_debugstats.lines );
+ " lines: " + to_string( m_debugstats.lines ) + "\n"
+ "particles: " + to_string( m_debugstats.particles );
++m_framestamp;
@@ -2953,7 +2954,7 @@ opengl_renderer::Render_particles() {
::glDepthMask( GL_FALSE );
Bind_Texture( m_smoketexture );
m_particlerenderer.render( m_diffusetextureunit );
m_debugstats.particles = m_particlerenderer.render( m_diffusetextureunit );
::glDepthMask( GL_TRUE );
::glEnable( GL_LIGHTING );

View File

@@ -129,6 +129,7 @@ private:
int traction { 0 };
int shapes { 0 };
int lines { 0 };
int particles { 0 };
int drawcalls { 0 };
};