mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15:59 -04:00
Start documenting Texture class
This commit is contained in:
parent
7ac683873a
commit
7f059d8a1a
@ -37,9 +37,16 @@ class Renderer;
|
|||||||
class Rect;
|
class Rect;
|
||||||
class RWops;
|
class RWops;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Image stored in the graphics card memory that
|
||||||
|
/// can be used for fast drawing
|
||||||
|
///
|
||||||
|
/// \headerfile SDL2pp/Texture.hh
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
class Texture {
|
class Texture {
|
||||||
private:
|
private:
|
||||||
SDL_Texture* texture_;
|
SDL_Texture* texture_; ///< SDL2 texture pointer
|
||||||
|
|
||||||
public:
|
public:
|
||||||
class LockHandle {
|
class LockHandle {
|
||||||
@ -86,11 +93,51 @@ public:
|
|||||||
void SetAlphaMod(Uint8 alpha = 255);
|
void SetAlphaMod(Uint8 alpha = 255);
|
||||||
void SetColorMod(Uint8 r = 255, Uint8 g = 255, Uint8 b = 255);
|
void SetColorMod(Uint8 r = 255, Uint8 g = 255, Uint8 b = 255);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Lock texture for write-only pixel access
|
||||||
|
///
|
||||||
|
/// \param rect Rect representing area to lock for access
|
||||||
|
/// (Rect::Null() to lock entire texture)
|
||||||
|
///
|
||||||
|
/// \return Lock handle used to access pixel data and to control lifetime of the lock
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
LockHandle Lock(const Rect& rect);
|
LockHandle Lock(const Rect& rect);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get texture format
|
||||||
|
///
|
||||||
|
/// \return Texture raw format
|
||||||
|
///
|
||||||
|
/// \see http://wiki.libsdl.org/SDL_QueryTexture#format
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
Uint32 GetFormat() const;
|
Uint32 GetFormat() const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get texture access mode
|
||||||
|
///
|
||||||
|
/// \return Texture access pattern
|
||||||
|
///
|
||||||
|
/// \see http://wiki.libsdl.org/SDL_TextureAccess
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
int GetAccess() const;
|
int GetAccess() const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get texture image width
|
||||||
|
///
|
||||||
|
/// \return Texture width in pixels
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
int GetWidth() const;
|
int GetWidth() const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get texture image height
|
||||||
|
///
|
||||||
|
/// \return Texture height in pixels
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user