From 1f6bb4630cc1da0bc9ad36b435b3fa48bcc4712c Mon Sep 17 00:00:00 2001 From: "Grayson Riffe (Laptop)" Date: Tue, 24 Aug 2021 11:09:07 -0500 Subject: [PATCH] Minor changes --- NothinFancy/src/Application.cpp | 14 ++++++++------ NothinFancy/src/Utility.cpp | 1 - NothinFancy/src/include/Application.h | 2 +- NothinFancy/src/include/Utility.h | 1 + NothinFancy/src/include/VertexArray.h | 10 +++++----- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/NothinFancy/src/Application.cpp b/NothinFancy/src/Application.cpp index 07a461e..2fcbf5b 100644 --- a/NothinFancy/src/Application.cpp +++ b/NothinFancy/src/Application.cpp @@ -66,7 +66,7 @@ namespace nf { showWindow(true); m_running = true; MSG msg = { }; - std::thread mainThread(&Application::startMainThread, this); + std::thread mainThread(&Application::runMainGameThread, this); while (m_running) { while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) { TranslateMessage(&msg); @@ -140,7 +140,7 @@ namespace nf { m_currentState = m_sIntro; } - void Application::startMainThread() { + void Application::runMainGameThread() { m_renderer = new Renderer(this); startIntroState(); std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now(); @@ -184,7 +184,7 @@ namespace nf { Error("Cannot run two NF applications at once!"); } } - + //TODO: Test fullscreen graphcis void Application::toggleFullscreen() { DWORD wndStyle = GetWindowLong(m_window, GWL_STYLE); if (wndStyle & WS_OVERLAPPEDWINDOW) { @@ -231,8 +231,10 @@ namespace nf { } case WM_SYSKEYDOWN: { if (GetKeyState(VK_RETURN) & 0x8000) { - app->m_currentConfig.fullscreen = !app->m_currentConfig.fullscreen; - app->toggleFullscreen(); + if (!(lParam & (1 << 30))) { + app->m_currentConfig.fullscreen = !app->m_currentConfig.fullscreen; + app->toggleFullscreen(); + } return 0; } break; @@ -297,4 +299,4 @@ namespace nf { delete curr; } } -} +} \ No newline at end of file diff --git a/NothinFancy/src/Utility.cpp b/NothinFancy/src/Utility.cpp index 2a42ef1..4df4592 100644 --- a/NothinFancy/src/Utility.cpp +++ b/NothinFancy/src/Utility.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include "Config.h" diff --git a/NothinFancy/src/include/Application.h b/NothinFancy/src/include/Application.h index 939a262..732f529 100644 --- a/NothinFancy/src/include/Application.h +++ b/NothinFancy/src/include/Application.h @@ -31,7 +31,7 @@ namespace nf { ~Application(); private: void startIntroState(); - void startMainThread(); + void runMainGameThread(); void registerWindowClass(); void toggleFullscreen(); RECT getWindowRect() const; diff --git a/NothinFancy/src/include/Utility.h b/NothinFancy/src/include/Utility.h index f60715b..6dfc601 100644 --- a/NothinFancy/src/include/Utility.h +++ b/NothinFancy/src/include/Utility.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include namespace nf { #ifdef _DEBUG diff --git a/NothinFancy/src/include/VertexArray.h b/NothinFancy/src/include/VertexArray.h index c4b1f21..1a4f10c 100644 --- a/NothinFancy/src/include/VertexArray.h +++ b/NothinFancy/src/include/VertexArray.h @@ -4,13 +4,13 @@ #include "VertexBuffer.h" namespace nf { - struct VertexBufferElement { - unsigned int type; - unsigned int count; - unsigned char normalized; - }; class VertexArray { + struct VertexBufferElement { + unsigned int type; + unsigned int count; + unsigned char normalized; + }; public: VertexArray();