Hymn to Beauty
C++ 3D Engine
OpenGLTexture.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../Interface/Texture.hpp"
4
5#include <glad/glad.h>
6#include <glm/glm.hpp>
7
8namespace Video {
9
11class OpenGLTexture : public Texture {
12 public:
14
21 OpenGLTexture(const glm::uvec2 size, Texture::Type type, Texture::Format format, int components = 0, unsigned char* data = nullptr);
22
24 ~OpenGLTexture() final;
25
27
30 unsigned int GetID() const;
31
33
36 bool HasMipMaps() const;
37
38 private:
39 OpenGLTexture(const OpenGLTexture& other) = delete;
40
41 // Get image GL format based on color components.
42 static GLenum Format(int components);
43
44 GLuint texture;
45 bool hasMipMaps = false;
46};
47
48}
OpenGL implementation of Texture.
Definition: OpenGLTexture.hpp:11
bool HasMipMaps() const
Get whether the texture has mip maps.
Definition: OpenGLTexture.cpp:69
~OpenGLTexture() final
Destructor.
Definition: OpenGLTexture.cpp:61
unsigned int GetID() const
Get texture ID.
Definition: OpenGLTexture.cpp:65
OpenGLTexture(const glm::uvec2 size, Texture::Type type, Texture::Format format, int components=0, unsigned char *data=nullptr)
Create new OpenGL texture.
Definition: OpenGLTexture.cpp:8
A texture.
Definition: Texture.hpp:8
Format
The format of the texture.
Definition: Texture.hpp:18
Type
The type of texture.
Definition: Texture.hpp:11
Definition: Editor.hpp:18