Keep startup reporting independent of renderer headers (by Codex)

This commit is contained in:
Codex committed 2026-10-23 08:52:10 +02:00
1 parent 856d38cc0c
commit 500354cc39
9 files changed
+24 -12

No files matched your search

+1 -1
View File
@@ -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-<version>-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.
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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.
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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 <SDL.h>
#include <atomic>
#include <chrono>
+5 -2
View File
@@ -162,13 +162,14 @@ void Video::present() {
#endif
}
std::vector<uint8_t> Video::capture(int &width, int &height) {
drawable_size(width, height);
std::vector<uint8_t> pixels(size_t(width) * size_t(height) * 4);
#ifdef _WIN32
Microsoft::WRL::ComPtr<ID3D11Texture2D> buffer, staging;
check(swapchain_->GetBuffer(0, IID_PPV_ARGS(&buffer)), "Screenshot buffer");
D3D11_TEXTURE2D_DESC desc{};
buffer->GetDesc(&desc);
width = static_cast<int>(desc.Width);
height = static_cast<int>(desc.Height);
std::vector<uint8_t> 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<uint8_t> Video::capture(int &width, int &height) {
size_t(width) * 4);
context_->Unmap(staging.Get(), 0);
#else
drawable_size(width, height);
std::vector<uint8_t> pixels(size_t(width) * size_t(height) * 4);
using ReadPixels = void (*)(int, int, int, int, unsigned, unsigned, void *);
auto read = reinterpret_cast<ReadPixels>(SDL_GL_GetProcAddress("glReadPixels"));
if (!read)
+1 -4
View File
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include "launch/startup_error.hpp"
#include <SDL.h>
#include <cstdint>
#include <string>
@@ -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
+2 -1
View File
@@ -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()
+10
View File
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <string>
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