Set window title

This commit is contained in:
grayson committed 2025-02-02 15:10:13 -06:00
1 parent 9c78fe09c9
commit 474b096337
4 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@
namespace nf::cli {
Client::Client(ClientConfig config)
: m_config(config)
, m_window(m_config.display)
, m_window(m_config.appName, m_config.display)
{
// Setup window and renderer
}
+4 -2
View File
@@ -5,7 +5,7 @@
#include "util.h"
namespace nf::cli {
Window::Window(DisplayConfig config)
Window::Window(const char* windowTitle, DisplayConfig config)
: m_handle(nullptr)
, m_wndClassName("NothinFancyWindow")
, m_windowedStyle(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
@@ -24,11 +24,12 @@ namespace nf::cli {
wc.lpfnWndProc = wndProc;
RegisterClass(&wc);
m_handle = CreateWindow(m_wndClassName, "NF Window", NULL, 0, 0, 0, 0, nullptr, nullptr, nullptr, this);
m_handle = CreateWindow(m_wndClassName, windowTitle, NULL, 0, 0, 0, 0, nullptr, nullptr, nullptr, this);
setDisplay(config);
}
void Window::setDisplay(DisplayConfig config) {
NFLog("Setting window display");
m_config = config;
bool wasShown = IsWindowVisible(m_handle);
show(false);
@@ -99,6 +100,7 @@ namespace nf::cli {
case WM_CLOSE:
DestroyWindow(hWnd);
NFLog("Window destroyed");
return 0;
case WM_DESTROY:
+1 -1
View File
@@ -8,7 +8,7 @@
namespace nf::cli {
class Window {
public:
Window(DisplayConfig config);
Window(const char* windowTitle, DisplayConfig config);
void setDisplay(DisplayConfig config);
void runLoop();
+1
View File
@@ -5,6 +5,7 @@
namespace nf {
ClientConfig configureEngine(CommandLineArguments cmdArgs) {
ClientConfig config;
config.appName = "TestGame";
//config.display.mode = DisplayMode::Fullscreen;
return config;
}