OpenGLRenderer: Choose between OpenGL/OpenGL ES at loading
This commit is contained in:
@@ -28,6 +28,7 @@ namespace Nz::GL
|
||||
std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, WindowHandle handle, Context* shareContext) const override;
|
||||
|
||||
inline EGLDisplay GetDefaultDisplay() const;
|
||||
ContextType GetPreferredContextType() const override;
|
||||
|
||||
GLFunction LoadFunction(const char* name) const override;
|
||||
|
||||
@@ -41,6 +42,7 @@ namespace Nz::GL
|
||||
private:
|
||||
bool ImplementFallback(const std::string_view& function);
|
||||
|
||||
ContextType m_preferredContextType;
|
||||
EGLDisplay m_defaultDisplay;
|
||||
DynLib m_eglLib;
|
||||
};
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Nz::GL
|
||||
using GLFunction = void(*)(void);
|
||||
|
||||
class Context;
|
||||
enum class ContextType;
|
||||
struct ContextParams;
|
||||
|
||||
class NAZARA_OPENGLRENDERER_API Loader
|
||||
@@ -33,6 +34,8 @@ namespace Nz::GL
|
||||
virtual std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, Context* shareContext = nullptr) const = 0;
|
||||
virtual std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, WindowHandle handle, Context* shareContext = nullptr) const = 0;
|
||||
|
||||
virtual ContextType GetPreferredContextType() const = 0;
|
||||
|
||||
virtual GLFunction LoadFunction(const char* name) const = 0;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace Nz::GL
|
||||
std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, Context* shareContext) const override;
|
||||
std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, WindowHandle handle, Context* shareContext) const override;
|
||||
|
||||
ContextType GetPreferredContextType() const override;
|
||||
|
||||
GLFunction LoadFunction(const char* name) const override;
|
||||
|
||||
#define NAZARA_OPENGLRENDERER_FUNC(name, sig) sig name = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user