Fixed intro fading for now
This commit is contained in:
parent
a67fb47b46
commit
fadf0af8b6
@ -7,20 +7,15 @@
|
|||||||
namespace nf {
|
namespace nf {
|
||||||
void IntroGamestate::onEnter() {
|
void IntroGamestate::onEnter() {
|
||||||
Log("Intro onEnter!");
|
Log("Intro onEnter!");
|
||||||
m_frame = 0;
|
|
||||||
m_scale = 2.0;
|
m_scale = 2.0;
|
||||||
m_logoTex.create(BaseAssets::logo, Vec2(0.0, 0.0));
|
m_logoTex.create(BaseAssets::logo, Vec2(0.0, 0.0));
|
||||||
m_logoTex.centered(true, true);
|
m_logoTex.centered(true, true);
|
||||||
m_text.create("(c) Grayson Riffe 2021", Vec2(0.01f, 0.025f), Vec3(0.8f));
|
m_text.create("(c) Grayson Riffe 2021", Vec2(0.01f, 0.025f), Vec3(0.8f));
|
||||||
m_text.setScale(0.6f);
|
m_text.setScale(0.6f);
|
||||||
|
m_start = std::chrono::steady_clock::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntroGamestate::update(float deltaTime) {
|
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::steady_clock::time_point now = std::chrono::steady_clock::now();
|
||||||
std::chrono::duration<float, std::ratio<1i64>> dur = now - m_start;
|
std::chrono::duration<float, std::ratio<1i64>> dur = now - m_start;
|
||||||
|
|
||||||
|
@ -77,6 +77,9 @@ namespace nf {
|
|||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
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();
|
loadBaseAssets();
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ namespace nf {
|
|||||||
void onExit() override;
|
void onExit() override;
|
||||||
private:
|
private:
|
||||||
std::chrono::steady_clock::time_point m_start;
|
std::chrono::steady_clock::time_point m_start;
|
||||||
unsigned int m_frame;
|
|
||||||
float m_scale;
|
float m_scale;
|
||||||
UITexture m_logoTex;
|
UITexture m_logoTex;
|
||||||
Text m_text;
|
Text m_text;
|
||||||
|
Reference in New Issue
Block a user