16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 18:39:18 +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(); ::glPopClientAttrib();
} }
void std::size_t
opengl_particles::render( int const Textureunit ) { opengl_particles::render( int const Textureunit ) {
if( false == Global.Smoke ) { return; } if( false == Global.Smoke ) { return 0; }
if( m_buffercapacity == 0 ) { return; } if( m_buffercapacity == 0 ) { return 0; }
if( m_particlevertices.empty() ) { return; } if( m_particlevertices.empty() ) { return 0; }
if( ( m_buffer == 0 ) || ( m_buffer == (GLuint)-1 ) ) { return; } if( ( m_buffer == 0 ) || ( m_buffer == (GLuint)-1 ) ) { return 0; }
// setup... // setup...
::glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT ); ::glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT );
@@ -153,6 +153,8 @@ opengl_particles::render( int const Textureunit ) {
gfx::opengl_vbogeometrybank::reset(); gfx::opengl_vbogeometrybank::reset();
} }
::glPopClientAttrib(); ::glPopClientAttrib();
return m_particlevertices.size() / 4;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

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

View File

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

View File

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