From b4338ce0d2a1b0d6dde097cf5e441bd2d13e2828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 19 Jan 2018 17:07:03 -0800 Subject: [PATCH] Cleanup. --- examples/08-update/update.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index 9ebf4547c..b677153b4 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -455,12 +455,13 @@ public: } } - float at[3] = { 0.0f, 0.0f, 0.0f }; + float at[3] = { 0.0f, 0.0f, 0.0f }; float eye[3] = { 0.0f, 0.0f, -5.0f }; float view[16]; - float proj[16]; bx::mtxLookAt(view, eye, at); + + float proj[16]; bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth); // Set view and projection matrix for view 0. @@ -469,7 +470,7 @@ public: // Update texturecube using compute shader if (bgfx::isValid(m_programCompute) ) { - bgfx::setImage(0, s_texCube, m_textureCube[2], 0, bgfx::Access::Write); + bgfx::setImage(0, m_textureCube[2], 0, bgfx::Access::Write); bgfx::dispatch(0, m_programCompute, textureside/16, textureside/16); } @@ -478,23 +479,23 @@ public: if (bgfx::isValid(m_textureCube[ii])) { float mtx[16]; - bx::mtxSRT( mtx, 0.7f, 0.7f, 0.7f, time, time*0.37f, 0.0f, -2.0f +ii*2.0f, 0.0f, 0.0f ); + bx::mtxSRT(mtx, 0.7f, 0.7f, 0.7f, time, time*0.37f, 0.0f, -2.0f +ii*2.0f, 0.0f, 0.0f); // Set model matrix for rendering. - bgfx::setTransform( mtx ); + bgfx::setTransform(mtx); // Set vertex and index buffer. bgfx::setVertexBuffer(0, m_vbh ); - bgfx::setIndexBuffer( m_ibh ); + bgfx::setIndexBuffer(m_ibh); // Bind texture. - bgfx::setTexture( 0, s_texCube, m_textureCube[ii] ); + bgfx::setTexture(0, s_texCube, m_textureCube[ii]); // Set render states. - bgfx::setState( BGFX_STATE_DEFAULT ); + bgfx::setState(BGFX_STATE_DEFAULT); // Submit primitive for rendering to view 0. - bgfx::submit( 0, m_program ); + bgfx::submit(0, m_program); } }