OpenGLRenderer: Use generic DeviceObject
This commit is contained in:
@@ -10,19 +10,19 @@
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Core/MovableValue.hpp>
|
||||
#include <Nazara/OpenGLRenderer/OpenGLDevice.hpp>
|
||||
#include <Nazara/OpenGLRenderer/Wrapper/DeviceObject.hpp>
|
||||
|
||||
namespace Nz::GL
|
||||
{
|
||||
class Texture
|
||||
class Texture : public DeviceObject<Texture, GL_TEXTURE>
|
||||
{
|
||||
friend DeviceObject;
|
||||
|
||||
public:
|
||||
Texture() = default;
|
||||
Texture(const Texture&) = delete;
|
||||
Texture(Texture&&) noexcept = default;
|
||||
inline ~Texture();
|
||||
|
||||
inline bool Create(OpenGLDevice& device);
|
||||
inline void Destroy();
|
||||
~Texture() = default;
|
||||
|
||||
inline void TexImage2D(GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border);
|
||||
inline void TexImage2D(GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* data);
|
||||
@@ -32,10 +32,8 @@ namespace Nz::GL
|
||||
Texture& operator=(Texture&&) noexcept = default;
|
||||
|
||||
private:
|
||||
const Context& EnsureDeviceContext();
|
||||
|
||||
MovablePtr<OpenGLDevice> m_device;
|
||||
MovableValue<GLuint> m_texture;
|
||||
static inline GLuint CreateHelper(OpenGLDevice& device, const Context& context);
|
||||
static inline void DestroyHelper(OpenGLDevice& device, const Context& context, GLuint objectId);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user