raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
raylib::Texture Class Reference

Public Member Functions

 Texture ()
 
 Texture (::Image &image)
 
 Texture (const std::string &fileName)
 
 ~Texture ()
 
Texture & Draw (::NPatchInfo nPatchInfo, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
 
Texture & Draw (::Rectangle sourceRec, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
 
Texture & Draw (::Rectangle sourceRec, ::Vector2 position, ::Color tint=WHITE)
 
Texture & Draw (::Vector2 position, ::Color tint=WHITE)
 
Texture & Draw (::Vector2 position, float rotation, float scale=1.0f, ::Color tint=WHITE)
 
Texture & Draw (::Vector2 tiling, ::Vector2 offset, ::Rectangle quad, ::Color tint=WHITE)
 
Texture & Draw (::Vector3 position, float width, float height, float length, ::Color color=WHITE)
 
Texture & Draw (int posX, int posY, ::Color tint=WHITE)
 
Texture & DrawTiled (Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, float scale, Color tint=WHITE)
 
Texture & GenMipmaps ()
 
int GetFormat () const
 
int GetHeight () const
 
unsigned int GetId () const
 
int GetMipmaps () const
 
Image GetTextureData () const
 
int GetWidth () const
 
void Load (const std::string &fileName)
 
void LoadFromImage (::Image &image)
 
void LoadTextureCubemap (::Image &image, int layoutType)
 
 operator raylib::Image ()
 
Texture & operator= (const ::Texture &texture)
 
Texture & operator= (const Texture &texture)
 
Texture & SetFilter (int filterMode)
 
void SetFormat (int value)
 
void SetHeight (int value)
 
void SetId (unsigned int value)
 
Texture & SetMaterialTexture (Material *material, int mapType)
 
void SetMipmaps (int value)
 
void SetWidth (int value)
 
Texture & SetWrap (int wrapMode)
 
void Unload ()
 
Texture & Update (const void *pixels)
 
Texture & UpdateRec (Rectangle rec, const void *pixels)
 

Static Public Member Functions

static int GetPixelDataSize (int width, int height, int format)
 

Protected Member Functions

void set (::Texture texture)
 

Detailed Description

Definition at line 19 of file Texture.hpp.

Constructor & Destructor Documentation

◆ Texture() [1/3]

raylib::Texture::Texture ( )
inline

Definition at line 21 of file Texture.hpp.

References set().

◆ Texture() [2/3]

raylib::Texture::Texture ( ::Image &  image)
inline

Definition at line 25 of file Texture.hpp.

References LoadFromImage().

◆ Texture() [3/3]

raylib::Texture::Texture ( const std::string &  fileName)
inline

Definition at line 29 of file Texture.hpp.

References Load().

◆ ~Texture()

raylib::Texture::~Texture ( )
inline

Definition at line 33 of file Texture.hpp.

References Unload().

Member Function Documentation

◆ Draw() [1/8]

Texture& raylib::Texture::Draw ( ::NPatchInfo  nPatchInfo,
::Rectangle  destRec,
::Vector2  origin,
float  rotation = 0,
::Color  tint = WHITE 
)
inline

Definition at line 127 of file Texture.hpp.

◆ Draw() [2/8]

Texture& raylib::Texture::Draw ( ::Rectangle  sourceRec,
::Rectangle  destRec,
::Vector2  origin,
float  rotation = 0,
::Color  tint = WHITE 
)
inline

Definition at line 123 of file Texture.hpp.

◆ Draw() [3/8]

Texture& raylib::Texture::Draw ( ::Rectangle  sourceRec,
::Vector2  position,
::Color  tint = WHITE 
)
inline

Definition at line 115 of file Texture.hpp.

◆ Draw() [4/8]

Texture& raylib::Texture::Draw ( ::Vector2  position,
::Color  tint = WHITE 
)
inline

Definition at line 106 of file Texture.hpp.

◆ Draw() [5/8]

Texture& raylib::Texture::Draw ( ::Vector2  position,
float  rotation,
float  scale = 1.0f,
::Color  tint = WHITE 
)
inline

Definition at line 110 of file Texture.hpp.

◆ Draw() [6/8]

Texture& raylib::Texture::Draw ( ::Vector2  tiling,
::Vector2  offset,
::Rectangle  quad,
::Color  tint = WHITE 
)
inline

Definition at line 119 of file Texture.hpp.

◆ Draw() [7/8]

Texture& raylib::Texture::Draw ( ::Vector3  position,
float  width,
float  height,
float  length,
::Color  color = WHITE 
)
inline

Definition at line 132 of file Texture.hpp.

◆ Draw() [8/8]

Texture& raylib::Texture::Draw ( int  posX,
int  posY,
::Color  tint = WHITE 
)
inline

Definition at line 101 of file Texture.hpp.

◆ DrawTiled()

Texture& raylib::Texture::DrawTiled ( Rectangle  sourceRec,
Rectangle  destRec,
Vector2  origin,
float  rotation,
float  scale,
Color  tint = WHITE 
)
inline

Definition at line 137 of file Texture.hpp.

◆ GenMipmaps()

Texture& raylib::Texture::GenMipmaps ( )
inline

Definition at line 86 of file Texture.hpp.

◆ GetFormat()

int raylib::Texture::GetFormat ( ) const
inline

Definition at line 41 of file Texture.hpp.

◆ GetHeight()

int raylib::Texture::GetHeight ( ) const
inline

Definition at line 39 of file Texture.hpp.

◆ GetId()

unsigned int raylib::Texture::GetId ( ) const
inline

Definition at line 37 of file Texture.hpp.

◆ GetMipmaps()

int raylib::Texture::GetMipmaps ( ) const
inline

Definition at line 40 of file Texture.hpp.

◆ GetPixelDataSize()

static int raylib::Texture::GetPixelDataSize ( int  width,
int  height,
int  format 
)
inlinestatic

Definition at line 147 of file Texture.hpp.

◆ GetTextureData()

Image raylib::Texture::GetTextureData ( ) const
inline

Definition at line 79 of file Texture.hpp.

Referenced by operator raylib::Image().

◆ GetWidth()

int raylib::Texture::GetWidth ( ) const
inline

Definition at line 38 of file Texture.hpp.

◆ Load()

void raylib::Texture::Load ( const std::string &  fileName)
inline

Definition at line 61 of file Texture.hpp.

References set().

Referenced by Texture().

◆ LoadFromImage()

void raylib::Texture::LoadFromImage ( ::Image &  image)
inline

Definition at line 53 of file Texture.hpp.

References set().

Referenced by Texture().

◆ LoadTextureCubemap()

void raylib::Texture::LoadTextureCubemap ( ::Image &  image,
int  layoutType 
)
inline

Definition at line 57 of file Texture.hpp.

References set().

◆ operator raylib::Image()

raylib::Texture::operator raylib::Image ( )
inline

Definition at line 82 of file Texture.hpp.

References GetTextureData().

◆ operator=() [1/2]

Texture& raylib::Texture::operator= ( const ::Texture &  texture)
inline

Definition at line 43 of file Texture.hpp.

References set().

◆ operator=() [2/2]

Texture& raylib::Texture::operator= ( const Texture &  texture)
inline

Definition at line 48 of file Texture.hpp.

References set().

◆ set()

void raylib::Texture::set ( ::Texture  texture)
inlineprotected

Definition at line 152 of file Texture.hpp.

Referenced by Load(), LoadFromImage(), LoadTextureCubemap(), operator=(), and Texture().

◆ SetFilter()

Texture& raylib::Texture::SetFilter ( int  filterMode)
inline

Definition at line 91 of file Texture.hpp.

◆ SetFormat()

void raylib::Texture::SetFormat ( int  value)
inline

Definition at line 41 of file Texture.hpp.

◆ SetHeight()

void raylib::Texture::SetHeight ( int  value)
inline

Definition at line 39 of file Texture.hpp.

◆ SetId()

void raylib::Texture::SetId ( unsigned int  value)
inline

Definition at line 37 of file Texture.hpp.

◆ SetMaterialTexture()

Texture& raylib::Texture::SetMaterialTexture ( Material *  material,
int  mapType 
)
inline

Definition at line 142 of file Texture.hpp.

◆ SetMipmaps()

void raylib::Texture::SetMipmaps ( int  value)
inline

Definition at line 40 of file Texture.hpp.

◆ SetWidth()

void raylib::Texture::SetWidth ( int  value)
inline

Definition at line 38 of file Texture.hpp.

◆ SetWrap()

Texture& raylib::Texture::SetWrap ( int  wrapMode)
inline

Definition at line 96 of file Texture.hpp.

◆ Unload()

void raylib::Texture::Unload ( )
inline

Definition at line 65 of file Texture.hpp.

Referenced by ~Texture().

◆ Update()

Texture& raylib::Texture::Update ( const void *  pixels)
inline

Definition at line 69 of file Texture.hpp.

◆ UpdateRec()

Texture& raylib::Texture::UpdateRec ( Rectangle  rec,
const void *  pixels 
)
inline

Definition at line 74 of file Texture.hpp.