mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Improvement] (MG_Backend): Separate Initialize and InitCapabilities.
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <Includes.h>
|
||||
|
||||
namespace MobileGL {
|
||||
|
||||
enum class BackendType {
|
||||
DirectGLES,
|
||||
BackendTypeCount,
|
||||
@@ -91,6 +90,7 @@ namespace MobileGL {
|
||||
virtual ~BackendObject() = default;
|
||||
|
||||
virtual void Initialize() = 0;
|
||||
virtual void InitCapabilities() = 0;
|
||||
virtual void InitWindowSurface() = 0;
|
||||
|
||||
void SetWindowHandle(const WindowHandle& handle);
|
||||
|
||||
@@ -38,8 +38,15 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
|
||||
DirectGLES::SetEGLFuncsTable(m_EGLFunctions);
|
||||
DirectGLES::SetGLESFuncsTable(m_GLESFunctions);
|
||||
}
|
||||
|
||||
if (!MG_Util::BackendLoader::FillInGLESCapabilities(m_GLESCapabilities, m_GLESFunctions, m_EGLFunctions)) {
|
||||
void BackendObject_DirectGLES::InitCapabilities() {
|
||||
if (!m_initialized) {
|
||||
MGLOG_E("DirectGLES backend not initialized");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MG_Util::BackendLoader::FillInGLESCapabilities(m_GLESCapabilities, m_GLESFunctions)) {
|
||||
MGLOG_E("Failed to fill in GLES capabilities for DirectGLES backend");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
class BackendObject_DirectGLES : public BackendObject {
|
||||
public:
|
||||
~BackendObject_DirectGLES() override;
|
||||
|
||||
void Initialize() override;
|
||||
void InitCapabilities() override;
|
||||
void InitWindowSurface() override;
|
||||
|
||||
const RendererInfo& GetRendererInfo() const override;
|
||||
|
||||
Reference in New Issue
Block a user