Files
SDL3CPlusPlus/src/services/impl/platform_service.hpp
johndoe6345789 2ef604c32e Add platform service enhancements and logging capabilities
- Introduced IPlatformService interface with methods for retrieving platform information, current video driver, and available video/render drivers.
- Implemented PlatformService to gather and log detailed system information, including CPU capabilities, environment variables, and SDL video driver support.
- Updated BgfxGraphicsBackend to utilize IPlatformService for platform-specific data.
- Enhanced SdlWindowService to log system information upon window creation.
- Added utility functions for string formatting and feature value retrieval.
2026-01-06 21:53:52 +00:00

30 lines
938 B
C++

#pragma once
#include "../interfaces/i_platform_service.hpp"
#include "../interfaces/i_logger.hpp"
#include <memory>
namespace sdl3cpp::services::impl {
class PlatformService : public IPlatformService {
public:
explicit PlatformService(std::shared_ptr<ILogger> logger = nullptr);
~PlatformService() override = default;
std::optional<std::filesystem::path> GetUserConfigDirectory() const override;
std::string GetPlatformError() const override;
std::string GetPlatformName() const override;
std::string GetCurrentVideoDriverName() const override;
std::vector<std::string> GetAvailableVideoDrivers() const override;
std::vector<std::string> GetAvailableRenderDrivers() const override;
void LogSystemInfo() const override;
private:
std::shared_ptr<ILogger> logger_;
#ifdef _WIN32
std::string FormatWin32Error(unsigned long errorCode) const;
#endif
};
} // namespace sdl3cpp::services::impl