Image living on the graphics card that can be used for drawing.
More...
#include <Texture.hpp>
Image living on the graphics card that can be used for drawing.
gk::Texture is an overlay to OpenGL texture system.
- See also
- gk::Image, gk::Sprite
Definition at line 30 of file Texture.hpp.
§ Texture() [1/4]
Default constructor.
Creates an empty texture.
§ Texture() [2/4]
gk::Texture::Texture |
( |
const std::string & |
filename | ) |
|
Load the texture from a file on the disk.
- Parameters
-
filename | Relative or absolute path to the file |
Definition at line 20 of file Texture.cpp.
§ Texture() [3/4]
gk::Texture::Texture |
( |
SDL_Surface * |
surface | ) |
|
Load the texture from a SDL_Surface.
- Parameters
-
surface | Pointer to the surface where the data is stored |
Definition at line 24 of file Texture.cpp.
§ Texture() [4/4]
gk::Texture::Texture |
( |
Texture && |
texture | ) |
|
Move constructor.
- Parameters
-
Definition at line 28 of file Texture.cpp.
§ ~Texture()
gk::Texture::~Texture |
( |
| ) |
|
|
noexcept |
§ bind()
void gk::Texture::bind |
( |
const Texture * |
texture | ) |
|
|
static |
Bind a texture for rendering.
- Parameters
-
texture | Pointer to the texture to bind, can be null to use no texture |
Definition at line 94 of file Texture.cpp.
§ filename()
const std::string& gk::Texture::filename |
( |
| ) |
const |
|
inline |
§ height()
u16 gk::Texture::height |
( |
| ) |
const |
|
inline |
Return the height of the texture.
- Returns
- Height in pixels
Definition at line 124 of file Texture.hpp.
§ loadFromFile()
void gk::Texture::loadFromFile |
( |
const std::string & |
filename | ) |
|
Load the texture from a file on the disk.
- Parameters
-
filename | Relative or absolute path to the file |
Definition at line 54 of file Texture.cpp.
§ loadFromSurface()
void gk::Texture::loadFromSurface |
( |
SDL_Surface * |
surface | ) |
|
Load the texture from a SDL_Surface.
- Parameters
-
surface | Pointer to the surface where the data is stored |
Definition at line 67 of file Texture.cpp.
§ operator=()
Move assignement operator.
- Parameters
-
Definition at line 42 of file Texture.cpp.
§ width()
u16 gk::Texture::width |
( |
| ) |
const |
|
inline |
Return the width of the texture.
- Returns
- Width in pixels
Definition at line 116 of file Texture.hpp.
§ m_filename
std::string gk::Texture::m_filename |
|
private |
§ m_height
u16 gk::Texture::m_height |
|
private |
§ m_texture
GLuint gk::Texture::m_texture = 0 |
|
private |
Internal OpenGL texture ID.
Definition at line 135 of file Texture.hpp.
§ m_width
The documentation for this class was generated from the following files: