Set window title
This commit is contained in:
parent
9c78fe09c9
commit
474b096337
@ -6,7 +6,7 @@
|
|||||||
namespace nf::cli {
|
namespace nf::cli {
|
||||||
Client::Client(ClientConfig config)
|
Client::Client(ClientConfig config)
|
||||||
: m_config(config)
|
: m_config(config)
|
||||||
, m_window(m_config.display)
|
, m_window(m_config.appName, m_config.display)
|
||||||
{
|
{
|
||||||
// Setup window and renderer
|
// Setup window and renderer
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
namespace nf::cli {
|
namespace nf::cli {
|
||||||
Window::Window(DisplayConfig config)
|
Window::Window(const char* windowTitle, DisplayConfig config)
|
||||||
: m_handle(nullptr)
|
: m_handle(nullptr)
|
||||||
, m_wndClassName("NothinFancyWindow")
|
, m_wndClassName("NothinFancyWindow")
|
||||||
, m_windowedStyle(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
|
, m_windowedStyle(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
|
||||||
@ -24,11 +24,12 @@ namespace nf::cli {
|
|||||||
wc.lpfnWndProc = wndProc;
|
wc.lpfnWndProc = wndProc;
|
||||||
RegisterClass(&wc);
|
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);
|
setDisplay(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::setDisplay(DisplayConfig config) {
|
void Window::setDisplay(DisplayConfig config) {
|
||||||
|
NFLog("Setting window display");
|
||||||
m_config = config;
|
m_config = config;
|
||||||
bool wasShown = IsWindowVisible(m_handle);
|
bool wasShown = IsWindowVisible(m_handle);
|
||||||
show(false);
|
show(false);
|
||||||
@ -99,6 +100,7 @@ namespace nf::cli {
|
|||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
DestroyWindow(hWnd);
|
DestroyWindow(hWnd);
|
||||||
|
NFLog("Window destroyed");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
namespace nf::cli {
|
namespace nf::cli {
|
||||||
class Window {
|
class Window {
|
||||||
public:
|
public:
|
||||||
Window(DisplayConfig config);
|
Window(const char* windowTitle, DisplayConfig config);
|
||||||
|
|
||||||
void setDisplay(DisplayConfig config);
|
void setDisplay(DisplayConfig config);
|
||||||
void runLoop();
|
void runLoop();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
namespace nf {
|
namespace nf {
|
||||||
ClientConfig configureEngine(CommandLineArguments cmdArgs) {
|
ClientConfig configureEngine(CommandLineArguments cmdArgs) {
|
||||||
ClientConfig config;
|
ClientConfig config;
|
||||||
|
config.appName = "TestGame";
|
||||||
//config.display.mode = DisplayMode::Fullscreen;
|
//config.display.mode = DisplayMode::Fullscreen;
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user