OpenMiner/include/gl/Texture.hpp

49 lines
927 B
C++
Raw Normal View History

2014-12-20 01:46:31 +01:00
/*
* =====================================================================================
*
* Filename: Texture.hpp
*
2018-06-05 01:24:54 +02:00
* Description:
2014-12-20 01:46:31 +01:00
*
* Version: 1.0
* Created: 20/12/2014 01:15:27
* Revision: none
* Compiler: gcc
*
* Author: Quentin BAZIN, <quent42340@gmail.com>
2018-06-05 01:24:54 +02:00
* Company:
2014-12-20 01:46:31 +01:00
*
* =====================================================================================
*/
#ifndef TEXTURE_HPP_
#define TEXTURE_HPP_
#include <string>
#include "OpenGL.hpp"
#include "Types.hpp"
class Texture {
public:
Texture();
2014-12-20 12:59:59 +01:00
Texture(const std::string &filename);
2014-12-20 01:46:31 +01:00
~Texture();
2018-06-05 01:24:54 +02:00
2014-12-20 12:59:59 +01:00
void load(const std::string &filename);
2018-06-05 01:24:54 +02:00
2014-12-20 01:46:31 +01:00
static void bind(const Texture *texture);
2018-06-05 01:24:54 +02:00
2014-12-20 01:46:31 +01:00
u16 width() const { return m_width; }
u16 height() const { return m_height; }
2018-06-05 01:24:54 +02:00
2014-12-20 01:46:31 +01:00
private:
std::string m_filename;
2018-06-05 01:24:54 +02:00
2014-12-20 01:46:31 +01:00
u16 m_width;
u16 m_height;
2018-06-05 01:24:54 +02:00
2014-12-20 01:46:31 +01:00
GLuint m_texture;
};
#endif // TEXTURE_HPP_