diff --git a/JoltViewer/JoltViewer.cpp b/JoltViewer/JoltViewer.cpp index e99eb19a2..0dd8f5d71 100644 --- a/JoltViewer/JoltViewer.cpp +++ b/JoltViewer/JoltViewer.cpp @@ -27,7 +27,7 @@ JPH_GCC_SUPPRESS_WARNING("-Wswitch") #endif JoltViewer::JoltViewer(const String &inCommandLine) : - Application(inCommandLine) + Application("Jolt Viewer", inCommandLine) { // Get file name from command line Array args; diff --git a/Samples/SamplesApp.cpp b/Samples/SamplesApp.cpp index ba15da597..740d2a226 100644 --- a/Samples/SamplesApp.cpp +++ b/Samples/SamplesApp.cpp @@ -443,7 +443,7 @@ static constexpr uint cMaxBodyPairs = 65536; static constexpr uint cMaxContactConstraints = 20480; SamplesApp::SamplesApp(const String &inCommandLine) : - Application(inCommandLine) + Application("Jolt Physics Samples", inCommandLine) { // Limit the render frequency to our simulation frequency so we don't play back the simulation too fast // Note that if the simulation frequency > vsync frequency the simulation will slow down as we want diff --git a/TestFramework/Application/Application.cpp b/TestFramework/Application/Application.cpp index 45b99023f..7658f9f95 100644 --- a/TestFramework/Application/Application.cpp +++ b/TestFramework/Application/Application.cpp @@ -31,7 +31,7 @@ JPH_GCC_SUPPRESS_WARNING("-Wswitch") // Constructor -Application::Application([[maybe_unused]] const String &inCommandLine) : +Application::Application(const char *inApplicationName, [[maybe_unused]] const String &inCommandLine) : mDebugRenderer(nullptr), mRenderer(nullptr), mKeyboard(nullptr), @@ -76,7 +76,7 @@ Application::Application([[maybe_unused]] const String &inCommandLine) : #else #error No window defined #endif - mWindow->Initialize(); + mWindow->Initialize(inApplicationName); // Create renderer mRenderer = Renderer::sCreate(); diff --git a/TestFramework/Application/Application.h b/TestFramework/Application/Application.h index 94c62ee93..48ca24850 100644 --- a/TestFramework/Application/Application.h +++ b/TestFramework/Application/Application.h @@ -52,7 +52,7 @@ class Application public: /// Constructor - Application(const String &inCommandLine); + Application(const char *inApplicationName, const String &inCommandLine); virtual ~Application(); /// Create a single string command line diff --git a/TestFramework/Window/ApplicationWindow.h b/TestFramework/Window/ApplicationWindow.h index 68bc29f74..59e7097d9 100644 --- a/TestFramework/Window/ApplicationWindow.h +++ b/TestFramework/Window/ApplicationWindow.h @@ -14,7 +14,7 @@ class ApplicationWindow virtual ~ApplicationWindow() = default; /// Initialize the window - virtual void Initialize() = 0; + virtual void Initialize(const char *inTitle) = 0; /// Get window size int GetWindowWidth() { return mWindowWidth; } diff --git a/TestFramework/Window/ApplicationWindowLinux.cpp b/TestFramework/Window/ApplicationWindowLinux.cpp index 48609fb6d..b7d7c7b40 100644 --- a/TestFramework/Window/ApplicationWindowLinux.cpp +++ b/TestFramework/Window/ApplicationWindowLinux.cpp @@ -7,7 +7,7 @@ #include #include -void ApplicationWindowLinux::Initialize() +void ApplicationWindowLinux::Initialize(const char *inTitle) { // Open connection to X server mDisplay = XOpenDisplay(nullptr); @@ -22,7 +22,7 @@ void ApplicationWindowLinux::Initialize() XSelectInput(mDisplay, mWindow, ExposureMask | StructureNotifyMask | KeyPressMask); // Set window title - XStoreName(mDisplay, mWindow, "TestFramework"); + XStoreName(mDisplay, mWindow, inTitle); // Register WM_DELETE_WINDOW to handle the close button mWmDeleteWindow = XInternAtom(mDisplay, "WM_DELETE_WINDOW", false); diff --git a/TestFramework/Window/ApplicationWindowLinux.h b/TestFramework/Window/ApplicationWindowLinux.h index c748f7521..8cbba34b2 100644 --- a/TestFramework/Window/ApplicationWindowLinux.h +++ b/TestFramework/Window/ApplicationWindowLinux.h @@ -11,7 +11,7 @@ class ApplicationWindowLinux : public ApplicationWindow { public: /// Initialize the window - virtual void Initialize() override; + virtual void Initialize(const char *inTitle) override; /// Access to the window handle Display * GetDisplay() const { return mDisplay; } diff --git a/TestFramework/Window/ApplicationWindowMacOS.h b/TestFramework/Window/ApplicationWindowMacOS.h index 6f7e02e7e..c11d456c7 100644 --- a/TestFramework/Window/ApplicationWindowMacOS.h +++ b/TestFramework/Window/ApplicationWindowMacOS.h @@ -22,7 +22,7 @@ class ApplicationWindowMacOS : public ApplicationWindow virtual ~ApplicationWindowMacOS() override; /// Initialize the window - virtual void Initialize() override; + virtual void Initialize(const char *inTitle) override; /// Access to the metal objects MTKView * GetMetalView() const { return mMetalView; } diff --git a/TestFramework/Window/ApplicationWindowMacOS.mm b/TestFramework/Window/ApplicationWindowMacOS.mm index 175ab117a..a20026823 100644 --- a/TestFramework/Window/ApplicationWindowMacOS.mm +++ b/TestFramework/Window/ApplicationWindowMacOS.mm @@ -94,7 +94,7 @@ -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender [mMetalView release]; } -void ApplicationWindowMacOS::Initialize() +void ApplicationWindowMacOS::Initialize(const char *inTitle) { // Create metal view MetalView *view = [[MetalView alloc] init: this]; @@ -110,7 +110,7 @@ -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender defer: NO]; window.contentView = view; [window setAcceptsMouseMovedEvents: YES]; - [window setTitle: @"TestFramework"]; + [window setTitle: [NSString stringWithCString: inTitle encoding: NSUTF8StringEncoding]]; [window makeKeyAndOrderFront: nil]; } diff --git a/TestFramework/Window/ApplicationWindowWin.cpp b/TestFramework/Window/ApplicationWindowWin.cpp index ba7210843..56e38f54a 100644 --- a/TestFramework/Window/ApplicationWindowWin.cpp +++ b/TestFramework/Window/ApplicationWindowWin.cpp @@ -45,7 +45,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l return 0; } -void ApplicationWindowWin::Initialize() +void ApplicationWindowWin::Initialize(const char *inTitle) { // Prevent this window from auto scaling SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); @@ -70,7 +70,7 @@ void ApplicationWindowWin::Initialize() // Create window RECT rc = { 0, 0, mWindowWidth, mWindowHeight }; AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE); - mhWnd = CreateWindow(TEXT("TestFrameworkClass"), TEXT("TestFramework"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, + mhWnd = CreateWindow(TEXT("TestFrameworkClass"), inTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, wcex.hInstance, nullptr); if (!mhWnd) FatalError("Failed to create window"); diff --git a/TestFramework/Window/ApplicationWindowWin.h b/TestFramework/Window/ApplicationWindowWin.h index f73561c33..c03096feb 100644 --- a/TestFramework/Window/ApplicationWindowWin.h +++ b/TestFramework/Window/ApplicationWindowWin.h @@ -11,7 +11,7 @@ class ApplicationWindowWin : public ApplicationWindow { public: /// Initialize the window - virtual void Initialize() override; + virtual void Initialize(const char *inTitle) override; /// Access to the window handle HWND GetWindowHandle() const { return mhWnd; }