Untitled Game engine no.5  1.0
GLTexture.hpp
1 #ifndef GLTEXTUR_HPP
2 #define GLTEXTUR_HPP
3 
4 #include "Texture.hpp"
5 #include "GLUtil.hpp"
6 
7 namespace Engine {
11  class GLTexture2D : public Texture2D {
12  public:
15  GLTexture2D(const std::string& path);
16  GLTexture2D(stbi_uc* data, const int& w, const int& h);
17 
18  GLTexture2D();
19 
20  ~GLTexture2D() override;
21  uint32_t getID() const override;
22  float getWidth() const override;
23  float getHeight() const override;
24  void setWidth(float width) override;
25  void setHeight(float height) override;
26  void setSize(float width, float height) override;
27  void setID(uint32_t id) override;
28  void Bind(uint32_t slot = 0) const override;
29  Ref<TextureMap> getDefaultMapping() const override;
30 
31  void loadTextureData(stbi_uc *data, int w, int h, uint type = GL_RGBA) override;
32 
33 
34  private:
35  Ref<TextureMap> map;
36  float m_Width, m_Height;
37  uint32_t m_ID;
38 
39  void generateTextureData();
40  };
41 }
42 #endif
Engine::Texture2D
Representation of a 2D texture.
Definition: Texture.hpp:79
Engine::GLTexture2D
Definition: GLTexture.hpp:11
Engine::Ref
std::shared_ptr< T > Ref
Has stuff for making references a lot more easily shared smart pointer.
Definition: Base.hpp:21
Engine::GLTexture2D::setHeight
void setHeight(float height) override
visual height of the texture in game dimensions
Definition: GLTexture.cpp:86
Engine::GLTexture2D::getID
uint32_t getID() const override
Texture id - an id link to the texture.
Definition: GLTexture.cpp:65
Engine::GLTexture2D::getDefaultMapping
Ref< TextureMap > getDefaultMapping() const override
Get the texture mapping.
Definition: GLTexture.cpp:77
Engine::GLTexture2D::getWidth
float getWidth() const override
visual width of the texture in game dimensions
Definition: GLTexture.cpp:69
Engine::GLTexture2D::getHeight
float getHeight() const override
visual height of the texture in game dimensions
Definition: GLTexture.cpp:73
Engine::GLTexture2D::setID
void setID(uint32_t id) override
set texture id
Definition: GLTexture.cpp:94
Engine
Definition: Animation.hpp:14
Engine::GLTexture2D::setSize
void setSize(float width, float height) override
visual size of the texture in game dimensions
Definition: GLTexture.cpp:81
Engine::GLTexture2D::setWidth
void setWidth(float width) override
visual width of the texture in game dimensions
Definition: GLTexture.cpp:90
Engine::GLTexture2D::Bind
void Bind(uint32_t slot=0) const override
Definition: GLTexture.cpp:61