diff --git a/NothinFancy/src/IntroGamestate.cpp b/NothinFancy/src/IntroGamestate.cpp index e033aea..dfbd436 100644 --- a/NothinFancy/src/IntroGamestate.cpp +++ b/NothinFancy/src/IntroGamestate.cpp @@ -7,20 +7,15 @@ namespace nf { void IntroGamestate::onEnter() { Log("Intro onEnter!"); - m_frame = 0; m_scale = 2.0; m_logoTex.create(BaseAssets::logo, Vec2(0.0, 0.0)); m_logoTex.centered(true, true); m_text.create("(c) Grayson Riffe 2021", Vec2(0.01f, 0.025f), Vec3(0.8f)); m_text.setScale(0.6f); + m_start = std::chrono::steady_clock::now(); } void IntroGamestate::update(float deltaTime) { - m_frame++; - if (m_frame < 5) return; - if (m_frame == 5) - m_start = std::chrono::steady_clock::now(); - std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); std::chrono::duration> dur = now - m_start; diff --git a/NothinFancy/src/Renderer/Renderer.cpp b/NothinFancy/src/Renderer/Renderer.cpp index d1b0697..5f6854f 100644 --- a/NothinFancy/src/Renderer/Renderer.cpp +++ b/NothinFancy/src/Renderer/Renderer.cpp @@ -77,6 +77,9 @@ namespace nf { glEnable(GL_CULL_FACE); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + //Nvidia drivers take two buffer swaps to do the first flush for some reason + SwapBuffers(m_hdc); + SwapBuffers(m_hdc); loadBaseAssets(); diff --git a/NothinFancy/src/include/IntroGamestate.h b/NothinFancy/src/include/IntroGamestate.h index cefc160..f9045bd 100644 --- a/NothinFancy/src/include/IntroGamestate.h +++ b/NothinFancy/src/include/IntroGamestate.h @@ -15,7 +15,6 @@ namespace nf { void onExit() override; private: std::chrono::steady_clock::time_point m_start; - unsigned int m_frame; float m_scale; UITexture m_logoTex; Text m_text;