work in progress

This commit is contained in:
2026-01-16 12:43:06 +01:00
parent 77a9579025
commit c8ee7defe8
236 changed files with 11405 additions and 28 deletions

View File

@@ -0,0 +1,89 @@
// Desktop platform implementation (simplified - uses RmlUi backend for graphics)
#include "desktop_platform.h"
#include <iostream>
#include <chrono>
// Note: Graphics context and rendering is handled by RmlUi's backend.
// This platform implementation provides additional utilities and state management.
namespace mosis::desktop {
DesktopPlatform::DesktopPlatform()
: m_file_interface(std::make_unique<DesktopFileInterface>())
{
auto now = std::chrono::steady_clock::now();
m_start_time = std::chrono::duration<double>(now.time_since_epoch()).count();
}
DesktopPlatform::~DesktopPlatform() = default;
bool DesktopPlatform::Initialize(uint32_t width, uint32_t height, const char* title) {
m_width = width;
m_height = height;
// Graphics initialization is done by RmlUi Backend
return true;
}
void DesktopPlatform::Shutdown() {
// Graphics shutdown is done by RmlUi Backend
}
std::unique_ptr<IGraphicsContext> DesktopPlatform::CreateGraphicsContext() {
// Graphics context is managed by RmlUi Backend
return nullptr;
}
std::unique_ptr<IRenderTarget> DesktopPlatform::CreateRenderTarget(uint32_t width, uint32_t height) {
// Render targets are managed by RmlUi Backend
return nullptr;
}
IFileInterface& DesktopPlatform::GetFileInterface() {
return *m_file_interface;
}
void DesktopPlatform::Log(const std::string& message) {
std::cout << "[INFO] " << message << std::endl;
}
void DesktopPlatform::LogError(const std::string& message) {
std::cerr << "[ERROR] " << message << std::endl;
}
bool DesktopPlatform::PollEvents() {
// Events are handled by RmlUi Backend
return true;
}
void DesktopPlatform::SwapBuffers() {
// Swap is handled by RmlUi Backend
}
bool DesktopPlatform::ShouldClose() const {
return false; // Determined by RmlUi Backend
}
void DesktopPlatform::SetResolution(uint32_t width, uint32_t height) {
m_width = width;
m_height = height;
}
float DesktopPlatform::GetDpiScale() const {
return 1.0f;
}
double DesktopPlatform::GetElapsedTime() const {
auto now = std::chrono::steady_clock::now();
double current = std::chrono::duration<double>(now.time_since_epoch()).count();
return current - m_start_time;
}
bool DesktopPlatform::IsMouseButtonDown() const {
return false; // Input is handled through RmlUi
}
void DesktopPlatform::GetMousePosition(double& x, double& y) const {
x = y = 0; // Input is handled through RmlUi
}
} // namespace mosis::desktop