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

Public Member Functions

 Texture2D ()
 
 Texture2D (::Image &image)
 
 Texture2D (const std::string &fileName)
 
 ~Texture2D ()
 
Texture2DDraw (::NPatchInfo nPatchInfo, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
 
Texture2DDraw (::Rectangle sourceRec, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
 
Texture2DDraw (::Rectangle sourceRec, ::Vector2 position, ::Color tint=WHITE)
 
Texture2DDraw (::Vector2 position, ::Color tint=WHITE)
 
Texture2DDraw (::Vector2 position, float rotation, float scale=1.0f, ::Color tint=WHITE)
 
Texture2DDraw (::Vector2 tiling, ::Vector2 offset, ::Rectangle quad, ::Color tint=WHITE)
 
Texture2DDraw (::Vector3 position, float width, float height, float length, ::Color color=WHITE)
 
Texture2DDraw (int posX, int posY, ::Color tint=WHITE)
 
Texture2DDrawTiled (Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, float scale, Color tint=WHITE)
 
Texture2DGenMipmaps ()
 
int GetFormat ()
 
int GetHeight ()
 
unsigned int GetId ()
 
int GetMipmaps ()
 
Image GetTextureData ()
 
int GetWidth ()
 
void Load (const std::string &fileName)
 
void LoadFromImage (::Image &image)
 
void LoadTextureCubemap (::Image &image, int layoutType)
 
 operator raylib::Image ()
 
Texture2Doperator= (const ::Texture2D &texture)
 
Texture2Doperator= (const Texture2D &texture)
 
void set (::Texture2D texture)
 
Texture2DSetFilter (int filterMode)
 
void SetFormat (int value)
 
void SetHeight (int value)
 
void SetId (unsigned int value)
 
Texture2DSetMaterialTexture (Material *material, int mapType)
 
void SetMipmaps (int value)
 
void SetWidth (int value)
 
Texture2DSetWrap (int wrapMode)
 
void Unload ()
 
Texture2DUpdate (const void *pixels)
 
Texture2DUpdateRec (Rectangle rec, const void *pixels)
 

Static Public Member Functions

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

Detailed Description

Definition at line 19 of file Texture2D.hpp.

Constructor & Destructor Documentation

◆ Texture2D() [1/3]

raylib::Texture2D::Texture2D ( )
inline

Definition at line 21 of file Texture2D.hpp.

References set().

◆ Texture2D() [2/3]

raylib::Texture2D::Texture2D ( ::Image image)
inline

Definition at line 25 of file Texture2D.hpp.

References LoadFromImage().

◆ Texture2D() [3/3]

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

Definition at line 29 of file Texture2D.hpp.

References Load().

◆ ~Texture2D()

raylib::Texture2D::~Texture2D ( )
inline

Definition at line 33 of file Texture2D.hpp.

References Unload().

Member Function Documentation

◆ Draw() [1/8]

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

Definition at line 135 of file Texture2D.hpp.

◆ Draw() [2/8]

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

Definition at line 131 of file Texture2D.hpp.

◆ Draw() [3/8]

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

Definition at line 123 of file Texture2D.hpp.

◆ Draw() [4/8]

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

Definition at line 114 of file Texture2D.hpp.

◆ Draw() [5/8]

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

Definition at line 118 of file Texture2D.hpp.

◆ Draw() [6/8]

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

Definition at line 127 of file Texture2D.hpp.

◆ Draw() [7/8]

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

Definition at line 140 of file Texture2D.hpp.

◆ Draw() [8/8]

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

Definition at line 109 of file Texture2D.hpp.

◆ DrawTiled()

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

Definition at line 145 of file Texture2D.hpp.

◆ GenMipmaps()

Texture2D& raylib::Texture2D::GenMipmaps ( )
inline

Definition at line 94 of file Texture2D.hpp.

◆ GetFormat()

int raylib::Texture2D::GetFormat ( )
inline

Definition at line 49 of file Texture2D.hpp.

◆ GetHeight()

int raylib::Texture2D::GetHeight ( )
inline

Definition at line 47 of file Texture2D.hpp.

◆ GetId()

unsigned int raylib::Texture2D::GetId ( )
inline

Definition at line 45 of file Texture2D.hpp.

◆ GetMipmaps()

int raylib::Texture2D::GetMipmaps ( )
inline

Definition at line 48 of file Texture2D.hpp.

◆ GetPixelDataSize()

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

Definition at line 155 of file Texture2D.hpp.

◆ GetTextureData()

Image raylib::Texture2D::GetTextureData ( )
inline

Definition at line 87 of file Texture2D.hpp.

Referenced by operator raylib::Image().

◆ GetWidth()

int raylib::Texture2D::GetWidth ( )
inline

Definition at line 46 of file Texture2D.hpp.

◆ Load()

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

Definition at line 69 of file Texture2D.hpp.

References set().

Referenced by Texture2D().

◆ LoadFromImage()

void raylib::Texture2D::LoadFromImage ( ::Image image)
inline

Definition at line 61 of file Texture2D.hpp.

References set().

Referenced by Texture2D().

◆ LoadTextureCubemap()

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

Definition at line 65 of file Texture2D.hpp.

References set().

◆ operator raylib::Image()

raylib::Texture2D::operator raylib::Image ( )
inline

Definition at line 90 of file Texture2D.hpp.

References GetTextureData().

◆ operator=() [1/2]

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

Definition at line 51 of file Texture2D.hpp.

References set().

◆ operator=() [2/2]

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

Definition at line 56 of file Texture2D.hpp.

References set().

◆ set()

void raylib::Texture2D::set ( ::Texture2D  texture)
inline

Definition at line 37 of file Texture2D.hpp.

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

◆ SetFilter()

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

Definition at line 99 of file Texture2D.hpp.

◆ SetFormat()

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

Definition at line 49 of file Texture2D.hpp.

◆ SetHeight()

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

Definition at line 47 of file Texture2D.hpp.

◆ SetId()

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

Definition at line 45 of file Texture2D.hpp.

◆ SetMaterialTexture()

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

Definition at line 150 of file Texture2D.hpp.

◆ SetMipmaps()

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

Definition at line 48 of file Texture2D.hpp.

◆ SetWidth()

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

Definition at line 46 of file Texture2D.hpp.

◆ SetWrap()

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

Definition at line 104 of file Texture2D.hpp.

◆ Unload()

void raylib::Texture2D::Unload ( )
inline

Definition at line 73 of file Texture2D.hpp.

Referenced by ~Texture2D().

◆ Update()

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

Definition at line 77 of file Texture2D.hpp.

◆ UpdateRec()

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

Definition at line 82 of file Texture2D.hpp.