| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <string> |
| 4 |
#include <memory> |
| 5 |
#include <GL/glew.h> |
| 6 |
|
| 7 |
/** |
| 8 |
* \brief |
| 9 |
* Basic interface for all GL textures. |
| 10 |
* |
| 11 |
* This interface represents a texture which is bound to OpenGL, with an OpenGL |
| 12 |
* texture number (as returned from glGenTextures()). This may be a 2D, 3D, cube |
| 13 |
* map or any other kind of texture object supported by OpenGL. |
| 14 |
*/ |
| 15 |
class Texture |
| 16 |
{ |
| 17 |
public: |
| 18 |
/** |
| 19 |
* \brief |
| 20 |
* Destructor |
| 21 |
*/ |
| 22 |
virtual ~Texture() {} |
| 23 |
|
| 24 |
/** |
| 25 |
* \brief |
| 26 |
* Constant indicating an invalid texture size. |
| 27 |
*/ |
| 28 |
const static std::size_t INVALID_SIZE = 0; |
| 29 |
|
| 30 |
/** |
| 31 |
* \brief |
| 32 |
* Return the string name of this texture. |
| 33 |
*/ |
| 34 |
virtual std::string getName() const = 0; |
| 35 |
|
| 36 |
/** |
| 37 |
* \brief |
| 38 |
* Return the GL texture identifier for this texture. |
| 39 |
*/ |
| 40 |
virtual GLuint getGLTexNum() const = 0; |
| 41 |
|
| 42 |
/** |
| 43 |
* \brief |
| 44 |
* Return the width of this texture in pixels. May return INVALID_SIZE if |
| 45 |
* this texture does not have a valid size. |
| 46 |
*/ |
| 47 |
virtual std::size_t getWidth() const = 0; |
| 48 |
|
| 49 |
/** |
| 50 |
* \brief |
| 51 |
* Return the height of this texture in pixels. May return INVALID_SIZE if |
| 52 |
* this texture does not have a valid size. |
| 53 |
*/ |
| 54 |
virtual std::size_t getHeight() const = 0; |
| 55 |
}; |
| 56 |
typedef std::shared_ptr<Texture> TexturePtr; |
| 57 |
|