Shafted by Billy G again.
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 2m58s

This commit is contained in:
2025-01-29 02:53:51 -05:00
parent 83d23eb3f4
commit d6c4c0b0f5
4 changed files with 13 additions and 5 deletions

View File

@@ -201,9 +201,14 @@ public:
void ForceClose();
void ForceCloseAndTerminateProgram();
/// Displays a small window with some text and an "OK" button.
/** Display a small window with some text and an "OK" button.
* I tried un-defining the macro, Calling it in a lambda,
* Calling MessageBoxA, Putting the call to the MessageBox
* function in its own namespace and then calling that.
* It just wouldn't let me name it MessageBox - Redacted. */
/// @note Execution of the parent window is stopped while the message box is up.
void MessageBox(const std::string& title, const std::string& message);
void UniqueFunctionNameForMessageBoxBecauseMicrosoftUsesMacros(const std::string& title, const std::string& message);
/// Sets whether or not to make the window fullscreen.
/// @note This is implemented per-OS, and as such, it simply requests the OS to do what we want. No guarantee about follow-through can be given.

View File

@@ -75,7 +75,7 @@ int main() {
window->SetVsyncEnabled(true);
window->SetResizable(true);
window->SetCursorVisible(false);
window->MessageBox("MessageBox", "Generic message from a ReWindow MessageBox.");
window->UniqueFunctionNameForMessageBoxBecauseMicrosoftUsesMacros("MessageBox", "Generic message from a ReWindow MessageBox.");
Logger::Debug(std::format("Window '{}' flags: IN_FOCUS={} FULLSCREEN={} RESIZEABLE={} VSYNC={} QUIT={}",

View File

@@ -58,7 +58,7 @@ void RWindow::Raise() {
XRaiseWindow(platform->display, platform->window);
}
void RWindow::MessageBox(const std::string& window_title, const std::string& message) {
void RWindow::UniqueFunctionNameForMessageBoxBecauseMicrosoftUsesMacros(const std::string& window_title, const std::string& message) {
int padding = 10;
XFontStruct* font = XLoadQueryFont(platform->display, "6x13");

View File

@@ -1,6 +1,7 @@
#include <Windows.h>
#include <gl/GL.h>
#include <rewindow/types/window.h>
class ReWindow::RWindow::Platform {
public:
HINSTANCE hInstance;
@@ -9,7 +10,6 @@ public:
};
using namespace ReWindow;
bool fullscreenmode = false;
bool open = false;
@@ -122,3 +122,6 @@ vsync(wVsync), flags{false,wFullscreen,wResizable,wVsync} {
platform = new Platform();
}
void RWindow::UniqueFunctionNameForMessageBoxBecauseMicrosoftUsesMacros(const std::string& title, const std::string& message_box_text) {
MessageBox(nullptr, message_box_text.c_str(), title.c_str(), MB_OK);
}