Minor changes
This commit is contained in:
parent
e17d2e283a
commit
1f6bb4630c
@ -66,7 +66,7 @@ namespace nf {
|
|||||||
showWindow(true);
|
showWindow(true);
|
||||||
m_running = true;
|
m_running = true;
|
||||||
MSG msg = { };
|
MSG msg = { };
|
||||||
std::thread mainThread(&Application::startMainThread, this);
|
std::thread mainThread(&Application::runMainGameThread, this);
|
||||||
while (m_running) {
|
while (m_running) {
|
||||||
while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) {
|
while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
@ -140,7 +140,7 @@ namespace nf {
|
|||||||
m_currentState = m_sIntro;
|
m_currentState = m_sIntro;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::startMainThread() {
|
void Application::runMainGameThread() {
|
||||||
m_renderer = new Renderer(this);
|
m_renderer = new Renderer(this);
|
||||||
startIntroState();
|
startIntroState();
|
||||||
std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now();
|
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!");
|
Error("Cannot run two NF applications at once!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//TODO: Test fullscreen graphcis
|
||||||
void Application::toggleFullscreen() {
|
void Application::toggleFullscreen() {
|
||||||
DWORD wndStyle = GetWindowLong(m_window, GWL_STYLE);
|
DWORD wndStyle = GetWindowLong(m_window, GWL_STYLE);
|
||||||
if (wndStyle & WS_OVERLAPPEDWINDOW) {
|
if (wndStyle & WS_OVERLAPPEDWINDOW) {
|
||||||
@ -231,8 +231,10 @@ namespace nf {
|
|||||||
}
|
}
|
||||||
case WM_SYSKEYDOWN: {
|
case WM_SYSKEYDOWN: {
|
||||||
if (GetKeyState(VK_RETURN) & 0x8000) {
|
if (GetKeyState(VK_RETURN) & 0x8000) {
|
||||||
|
if (!(lParam & (1 << 30))) {
|
||||||
app->m_currentConfig.fullscreen = !app->m_currentConfig.fullscreen;
|
app->m_currentConfig.fullscreen = !app->m_currentConfig.fullscreen;
|
||||||
app->toggleFullscreen();
|
app->toggleFullscreen();
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <Windows.h>
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ namespace nf {
|
|||||||
~Application();
|
~Application();
|
||||||
private:
|
private:
|
||||||
void startIntroState();
|
void startIntroState();
|
||||||
void startMainThread();
|
void runMainGameThread();
|
||||||
void registerWindowClass();
|
void registerWindowClass();
|
||||||
void toggleFullscreen();
|
void toggleFullscreen();
|
||||||
RECT getWindowRect() const;
|
RECT getWindowRect() const;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
namespace nf {
|
namespace nf {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
#include "VertexBuffer.h"
|
#include "VertexBuffer.h"
|
||||||
|
|
||||||
namespace nf {
|
namespace nf {
|
||||||
|
|
||||||
|
class VertexArray {
|
||||||
struct VertexBufferElement {
|
struct VertexBufferElement {
|
||||||
unsigned int type;
|
unsigned int type;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
unsigned char normalized;
|
unsigned char normalized;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VertexArray {
|
|
||||||
public:
|
public:
|
||||||
VertexArray();
|
VertexArray();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user