hx3d
1
2D/3D Simple Game Framework
|
2D/3D texture management. More...
#include <texture.hpp>
Public Types |
Public Member Functions | |
Texture () | |
Construct an empty texture. See load to build the texture. | |
Texture (std::string pathToImage) | |
Construct a texture from an image path. More... | |
Texture (Image &image) | |
Construct a texture from an memory image. More... | |
bool | load (std::string pathToImage) |
Build the texture from an image. More... | |
void | setFilter (FilterType type, FilterValue value) |
Set the texture filters. More... | |
void | updateZone (unsigned int x, unsigned int y, unsigned int w, unsigned int h, Uint8 *data) |
Update a zone in the texture. More... | |
unsigned int | getWidth () |
Get the texture width. More... | |
unsigned int | getHeight () |
Get the texture height. More... | |
GLuint | getID () |
Get the texture ID. More... | |
Static Public Member Functions | |
static Ptr< Texture > | createColorBuffer (unsigned int width, unsigned int height) |
Create a color buffer (used in framebuffers). More... | |
static void | use (Ptr< Texture > texture) |
Use the current texture for drawing. More... | |
static void | use (Ptr< Font > font, int characterSize) |
Use the current font atlas for drawing. More... | |
static void | disable () |
Clear the current texture for drawing. | |
static void | generateBlankTexture () |
Used to create the Texture::Blank texture. | |
Static Public Attributes | |
static Ptr< Texture > | Blank |
Default blank texture. | |
2D/3D texture management.
Definition at line 39 of file texture.hpp.
|
strong |
Filtering type.
Enumerator | |
---|---|
Min |
Min. filter. |
Max |
Max. filter. |
WrapX |
S wrapping filter. |
WrapY |
T wrapping filter. |
Definition at line 45 of file texture.hpp.
|
strong |
Filtering value.
Definition at line 61 of file texture.hpp.
hx3d::graphics::Texture::Texture | ( | std::string | pathToImage | ) |
Construct a texture from an image path.
pathToImage | Path to image |
Definition at line 37 of file texture.cpp.
hx3d::graphics::Texture::Texture | ( | Image & | image | ) |
Construct a texture from an memory image.
image | Image |
Definition at line 41 of file texture.cpp.
|
static |
Create a color buffer (used in framebuffers).
Definition at line 140 of file texture.cpp.
unsigned int hx3d::graphics::Texture::getHeight | ( | ) |
GLuint hx3d::graphics::Texture::getID | ( | ) |
unsigned int hx3d::graphics::Texture::getWidth | ( | ) |
bool hx3d::graphics::Texture::load | ( | std::string | pathToImage | ) |
Build the texture from an image.
pathToImage | Path to image |
Definition at line 72 of file texture.cpp.
void hx3d::graphics::Texture::setFilter | ( | FilterType | type, |
FilterValue | value | ||
) |
Set the texture filters.
type | Filter type |
value | Filter value |
Definition at line 98 of file texture.cpp.
void hx3d::graphics::Texture::updateZone | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | w, | ||
unsigned int | h, | ||
Uint8 * | data | ||
) |
Update a zone in the texture.
x | X coordinate |
y | Y coordinate |
w | Width |
h | Height |
data | Data |
Definition at line 173 of file texture.cpp.
Use the current texture for drawing.
texture | Texture (Ptr) |
Definition at line 127 of file texture.cpp.
Use the current font atlas for drawing.
font | Font (Ptr) |
characterSize | Character size |
Definition at line 131 of file texture.cpp.