Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
texture.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <iostream>
5 // GLEW
6 #include <GL/glew.h>
7 
8 namespace fireworks { namespace graphics {
9 
11  class Texture
12  {
13  public:
14  private:
15  std::string m_FileName; // Path to the texture source image
16  std::string m_TypeName;
17  GLuint m_TID; // OpenGL Texture ID
18  GLsizei m_Width;
19  GLsizei m_Height;
20  GLsizei m_BPP;
21  bool m_FlipTexture;
22  public:
27  Texture(const std::string& path, bool flip = true, const std::string& typeName = "texture_diffuse");
28  ~Texture();
29 
31  void bind() const;
33  void unbind() const;
34 
36  inline const unsigned int getWidth() const { return m_Width; }
38  inline const unsigned int getHeight() const { return m_Height; }
40  inline const unsigned int getID() const { return m_TID; }
42  inline const std::string getPath() const { return m_FileName; }
44  inline const std::string getTypeName() const { return m_TypeName; }
45  private:
46  GLuint load();
47  };
48 
49 } }
const unsigned int getHeight() const
Gets the Height of the texture.
Definition: texture.h:38
The class responsible for loading Textures.
Definition: texture.h:11
Definition: audioclip.cpp:3
const unsigned int getID() const
Gets the ID of the texture.
Definition: texture.h:40
const std::string getTypeName() const
Return the name of the texture&#39;s type.
Definition: texture.h:44
void unbind() const
Unbinds the texture.
Definition: texture.cpp:55
const std::string getPath() const
Gets the path of the texture.
Definition: texture.h:42
const unsigned int getWidth() const
Gets the Width of the texture.
Definition: texture.h:36
void bind() const
Binds the texture.
Definition: texture.cpp:49
Texture(const std::string &path, bool flip=true, const std::string &typeName="texture_diffuse")
Creates Textures from images.
Definition: texture.cpp:8
~Texture()
Definition: texture.cpp:14