libRocket
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
Rocket::Core::Texture Struct Reference

#include <Texture.h>

Public Member Functions

 Texture ()
 Constructs an unloaded texture with no resource. More...
 
 Texture (const Texture &)
 Constructs a texture sharing the resource of another. More...
 
 ~Texture ()
 
bool Load (const String &source, const String &source_path="")
 
String GetSource () const
 
TextureHandle GetHandle (RenderInterface *render_interface) const
 
Vector2i GetDimensions (RenderInterface *render_interface) const
 
const Texture & operator= (const Texture &)
 Releases this texture's resource (if any), and sets it to another texture's resource. More...
 

Detailed Description

Abstraction of a two-dimensional texture image, with an application-specific texture handle.

Author
Peter Curry

Constructor & Destructor Documentation

Rocket::Core::Texture::Texture ( )

Constructs an unloaded texture with no resource.

Rocket::Core::Texture::Texture ( const Texture &  )

Constructs a texture sharing the resource of another.

Rocket::Core::Texture::~Texture ( )

Member Function Documentation

Vector2i Rocket::Core::Texture::GetDimensions ( RenderInterface *  render_interface) const

Returns the texture's dimensions.

Parameters
[in]Therender interface that is requesting the dimensions.
Returns
The texture's dimensions. This will be (0, 0) if the texture isn't loaded.
TextureHandle Rocket::Core::Texture::GetHandle ( RenderInterface *  render_interface) const

Returns the texture's handle.

Parameters
[in]Therender interface that is requesting the handle.
Returns
The texture's handle. This will be NULL if the texture isn't loaded.
String Rocket::Core::Texture::GetSource ( ) const

Returns the texture's source name. This is usually the name of the file the texture was loaded from.

Returns
The name of the this texture's source. This will be the empty string if this texture is not loaded.
bool Rocket::Core::Texture::Load ( const String &  source,
const String &  source_path = "" 
)

Attempts to load a texture.

Parameters
[in]sourceThe name of the texture.
[in]source_pathThe path of the resource that is requesting the texture (ie, the RCSS file in which it was specified, etc).
Returns
True if the texture loaded successfully, false if not.
const Texture& Rocket::Core::Texture::operator= ( const Texture &  )

Releases this texture's resource (if any), and sets it to another texture's resource.


The documentation for this struct was generated from the following file: