#include <xrb_gltexture.hpp>
Public Member Functions | |
~GLTexture () | |
Destructor. | |
GLuint | Handle () const |
Returns the OpenGL texture handle for this texture. | |
ScreenCoordVector2 const & | Size () const |
Returns the size vector of the texture. | |
ScreenCoord | Width () const |
Returns the width of the texture. | |
ScreenCoord | Height () const |
Returns the height of the texture. | |
Static Public Member Functions | |
static GLTexture * | Create (std::string const &path) |
Create a new GLTexture object from a texture loaded from the given path. | |
static GLTexture * | Create (Texture *texture) |
Create a new GLTexture object from an already-loaded Texture object. |
Creating a texture using this class will load the texture data into the texture memory using OpenGL, and provide a texture handle, with which the texture will be referred to when rendering it.
Definition at line 39 of file xrb_gltexture.hpp.
Xrb::GLTexture::~GLTexture | ( | ) |
Destructor.
Causes the texture to be unloaded from texture memory.
Definition at line 23 of file xrb_gltexture.cpp.
GLTexture * Xrb::GLTexture::Create | ( | std::string const & | path | ) | [static] |
Create a new GLTexture object from a texture loaded from the given path.
Loads the image given by the path into a Texture object, creates the OpenGL mipmaps and gets a handle to the OpenGL texture.
Definition at line 28 of file xrb_gltexture.cpp.
References GenerateTexture().
Referenced by Xrb::GL::Initialize(), Xrb::WidgetSkin::SetTexturePath(), Xrb::WidgetBackgroundStylized::WidgetBackgroundStylized(), and Xrb::WidgetBackgroundTextured::WidgetBackgroundTextured().
Create a new GLTexture object from an already-loaded Texture object.
Loads the image given by the path into a Texture object, creates the OpenGL mipmaps and gets a handle to the OpenGL texture.
Definition at line 43 of file xrb_gltexture.cpp.
References GenerateTexture().
GLuint Xrb::GLTexture::Handle | ( | ) | const [inline] |
Returns the OpenGL texture handle for this texture.
This will be used to return the handle when specifying the texture to bind to GL_TEXTURE_2D when rendering textures.
Definition at line 65 of file xrb_gltexture.hpp.
Referenced by Xrb::Render::DrawScreenRectTexture().