OpenGLRenderer: Improve OpenGL wrapper

This commit is contained in:
Jérôme Leclercq
2021-09-21 16:34:34 +02:00
parent 250044b47a
commit 78358337f3
12 changed files with 57 additions and 18 deletions

View File

@@ -19,6 +19,7 @@ namespace Nz::GL
{
public:
ContextObject() = default;
ContextObject(const Context& context, CreateArgs... args);
ContextObject(const ContextObject&) = delete;
ContextObject(ContextObject&& object) noexcept = default;
~ContextObject();
@@ -26,6 +27,8 @@ namespace Nz::GL
bool Create(const Context& context, CreateArgs... args);
void Destroy();
const Context& EnsureContext() const;
bool IsValid() const;
const Context* GetContext() const;
@@ -39,8 +42,6 @@ namespace Nz::GL
static constexpr GLuint InvalidObject = 0;
protected:
void EnsureContext();
MovablePtr<const Context> m_context;
MovableValue<GLuint> m_objectId;
};