mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-30 00:24:59 +00:00
- 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.
30 lines
938 B
C++
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
|