mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Added FrameTime. (#3521)
This commit is contained in:
committed by
GitHub
parent
9d63c39a44
commit
3ddf1ed032
@@ -209,7 +209,7 @@ public:
|
||||
// Create program from shaders.
|
||||
m_program = loadProgram("vs_cubes", "fs_cubes");
|
||||
|
||||
m_timeOffset = bx::getHPCounter();
|
||||
m_frameTime.reset();
|
||||
|
||||
imguiCreate();
|
||||
}
|
||||
@@ -237,6 +237,9 @@ public:
|
||||
{
|
||||
if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
|
||||
{
|
||||
m_frameTime.frame();
|
||||
const float time = bx::toSeconds<float>(m_frameTime.getDurationTime() );
|
||||
|
||||
imguiBeginFrame(m_mouseState.m_mx
|
||||
, m_mouseState.m_my
|
||||
, (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
@@ -274,8 +277,6 @@ public:
|
||||
|
||||
imguiEndFrame();
|
||||
|
||||
float time = (float)( (bx::getHPCounter()-m_timeOffset)/double(bx::getHPFrequency() ) );
|
||||
|
||||
const bx::Vec3 at = { 0.0f, 0.0f, 0.0f };
|
||||
const bx::Vec3 eye = { 0.0f, 0.0f, -35.0f };
|
||||
|
||||
@@ -354,7 +355,9 @@ public:
|
||||
bgfx::VertexBufferHandle m_vbh;
|
||||
bgfx::IndexBufferHandle m_ibh[BX_COUNTOF(s_ptState)];
|
||||
bgfx::ProgramHandle m_program;
|
||||
int64_t m_timeOffset;
|
||||
|
||||
FrameTime m_frameTime;
|
||||
|
||||
int32_t m_pt;
|
||||
|
||||
bool m_r;
|
||||
|
||||
Reference in New Issue
Block a user