From 500354cc3973139b177e2c85de4d42af5a30cc7b Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 23 Oct 2026 08:51:27 +0200 Subject: [PATCH] Keep startup reporting independent of renderer headers (by Codex) --- README.md | 2 +- docs/EDITOR.md | 2 +- docs/release/0.2/RELEASE_NOTES.md | 3 ++- src/app/main.cpp | 2 +- src/editor/main.cpp | 2 +- src/launch/rml_video.cpp | 7 +++++-- src/launch/rml_video.hpp | 5 +---- src/launch/rmlui.cmake | 3 ++- src/launch/startup_error.hpp | 10 ++++++++++ 9 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 src/launch/startup_error.hpp diff --git a/README.md b/README.md index 2b97712..4793ca9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This is an independent community project, with no affiliation with or endorsemen Check the [releases page](https://github.com/Weyoune/openbmh/releases) for available packages and their platform notes. A Windows package uses the name `OpenBMH--windows-x64.zip`. Availability and native validation are stated for each release; source build instructions do not establish platform support on their own. -These instructions describe **0.2.0**, released separately from the editor. See the [0.2 release notes](docs/release/0.2/RELEASE_NOTES.md). +These instructions describe **0.2.1**, released separately from the editor. See the [0.2 release notes](docs/release/0.2/RELEASE_NOTES.md). 1. Extract OpenBMH into a writable directory. 2. Start `OpenBMH.exe` on Windows, or `OpenBMH` on Linux/macOS. Its RmlUI launcher initially has an empty **Name | Art** list. The night-stadium design uses a small version label in the lower-right corner. diff --git a/docs/EDITOR.md b/docs/EDITOR.md index b483098..d7edae8 100644 --- a/docs/EDITOR.md +++ b/docs/EDITOR.md @@ -1,6 +1,6 @@ # OpenBMH Editor 0.5.3 -Der eigenständige, native Editor verwendet **RmlUI, SDL2 und OpenGL**. Er bearbeitet Startdatenbanken, keine laufenden Spielstände. Das Spiel und seine Classic-Prüfung bleiben unverändert. Editor 0.5.3 hat eine eigene Versionsreihe und den Release-Tag `editor-v0.5.3`; die Spielversion ist 0.2.1. +Der eigenständige, native Editor verwendet **RmlUI und SDL2**, unter Windows mit Direct3D 11, unter Linux/macOS mit OpenGL. Er bearbeitet Startdatenbanken, keine laufenden Spielstände. Das Spiel und seine Classic-Prüfung bleiben unverändert. Editor 0.5.3 hat eine eigene Versionsreihe und den Release-Tag `editor-v0.5.3`; die Spielversion ist 0.2.1. ## Windows-Start und Diagnose diff --git a/docs/release/0.2/RELEASE_NOTES.md b/docs/release/0.2/RELEASE_NOTES.md index c487b80..c44cf76 100644 --- a/docs/release/0.2/RELEASE_NOTES.md +++ b/docs/release/0.2/RELEASE_NOTES.md @@ -61,7 +61,8 @@ See the [runtime and migration contract](../../formats/obw/runtime-0.2.md). The build pipeline produces Windows x64, Linux x64 and macOS ARM64 ZIPs and a matching source ZIP with pinned dependency sources and build information. Builds and automated tests do not replace native interactive acceptance. -The launcher requires OpenGL 3.3 (macOS: 4.1). Linux requires the platform libraries +The launcher uses Direct3D 11 with WARP fallback on Windows, OpenGL 3.3 on Linux, +and OpenGL 4.1 on macOS. Linux requires the platform libraries described in [BUILDING](../../BUILDING.md), including GTK3 for its folder picker. The macOS executable is unsigned and is not a notarised application bundle. diff --git a/src/app/main.cpp b/src/app/main.cpp index 1c13443..3d9ed9b 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -31,7 +31,7 @@ #include "launch/file_dialog.hpp" #include "launch/game_data.hpp" #include "launch/launcher.hpp" -#include "launch/rml_video.hpp" +#include "launch/startup_error.hpp" #include "content/package.hpp" #include "version.hpp" #include "app/live_matchday_events.hpp" diff --git a/src/editor/main.cpp b/src/editor/main.cpp index 5113e7e..36c31e2 100644 --- a/src/editor/main.cpp +++ b/src/editor/main.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only #include "editor/ui.hpp" #include "editor/version.hpp" -#include "launch/rml_video.hpp" +#include "launch/startup_error.hpp" #include #include #include diff --git a/src/launch/rml_video.cpp b/src/launch/rml_video.cpp index a73d6e2..e480595 100644 --- a/src/launch/rml_video.cpp +++ b/src/launch/rml_video.cpp @@ -162,13 +162,14 @@ void Video::present() { #endif } std::vector Video::capture(int &width, int &height) { - drawable_size(width, height); - std::vector pixels(size_t(width) * size_t(height) * 4); #ifdef _WIN32 Microsoft::WRL::ComPtr buffer, staging; check(swapchain_->GetBuffer(0, IID_PPV_ARGS(&buffer)), "Screenshot buffer"); D3D11_TEXTURE2D_DESC desc{}; buffer->GetDesc(&desc); + width = static_cast(desc.Width); + height = static_cast(desc.Height); + std::vector pixels(size_t(width) * size_t(height) * 4); desc.Usage = D3D11_USAGE_STAGING; desc.BindFlags = 0; desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; @@ -183,6 +184,8 @@ std::vector Video::capture(int &width, int &height) { size_t(width) * 4); context_->Unmap(staging.Get(), 0); #else + drawable_size(width, height); + std::vector pixels(size_t(width) * size_t(height) * 4); using ReadPixels = void (*)(int, int, int, int, unsigned, unsigned, void *); auto read = reinterpret_cast(SDL_GL_GetProcAddress("glReadPixels")); if (!read) diff --git a/src/launch/rml_video.hpp b/src/launch/rml_video.hpp index a45f7e6..109bb7d 100644 --- a/src/launch/rml_video.hpp +++ b/src/launch/rml_video.hpp @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only #pragma once +#include "launch/startup_error.hpp" #include #include #include @@ -67,8 +68,4 @@ class Renderer : public RenderInterface_GL3 { explicit Renderer(Video &) {} }; #endif -// Also used before SDL initialization, so an unavailable graphics driver cannot -// prevent reporting the actual startup error. No preferences or tokens are logged. -void report_start_error(const char *product, const std::string &message, bool dialog = true) noexcept; -void attach_parent_console() noexcept; } // namespace bmh::rml diff --git a/src/launch/rmlui.cmake b/src/launch/rmlui.cmake index ea73323..a847871 100644 --- a/src/launch/rmlui.cmake +++ b/src/launch/rmlui.cmake @@ -26,7 +26,8 @@ add_library(bmh_rmlui STATIC if(WIN32) target_sources(bmh_rmlui PRIVATE ${rmlui_SOURCE_DIR}/Backends/RmlUi_Renderer_DX11.cpp) target_link_libraries(bmh_rmlui PUBLIC d3d11 dxgi d3dcompiler) - target_compile_definitions(bmh_rmlui PUBLIC NUM_MSAA_SAMPLES=1 NOMINMAX) + # Upstream resolves its multisampled UI layer into the swapchain every frame. + target_compile_definitions(bmh_rmlui PUBLIC NUM_MSAA_SAMPLES=2 NOMINMAX) else() target_sources(bmh_rmlui PRIVATE ${rmlui_SOURCE_DIR}/Backends/RmlUi_Renderer_GL3.cpp) endif() diff --git a/src/launch/startup_error.hpp b/src/launch/startup_error.hpp new file mode 100644 index 0000000..de9aa1d --- /dev/null +++ b/src/launch/startup_error.hpp @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-3.0-only +#pragma once +#include + +namespace bmh::rml { +// Safe before video initialization, including when no graphics driver is available. +// No preferences or authentication tokens are logged. +void report_start_error(const char *product, const std::string &message, bool dialog = true) noexcept; +void attach_parent_console() noexcept; +} // namespace bmh::rml