Raylib C++  1.0.0
Encapsulates the raylib library
Public Member Functions | List of all members
raylib::texture::RlTexture Class Reference

Encapsulation of the raylib texture NOTE: These functions require GPU access. More...

#include <RlTexture.hpp>

Collaboration diagram for raylib::texture::RlTexture:
Collaboration graph

Public Member Functions

 RlTexture (const std::string &fileName)
 Create a RlTexture from file. More...
 
 RlTexture (const image::RlImage &image)
 Create a RlTexture from image. More...
 
 RlTexture (const image::RlImage &image, const CubemapLayout &layout)
 Craete a RlTexture, cubemap from image, multiple image cubemap layouts supported. More...
 
 ~RlTexture ()
 RlTexture destructor. More...
 
void update (const void *pixels)
 Update GPU texture with new data. More...
 
void updateRect (const Rectangle &rec, const void *pixels)
 Update GPU texture rectangle with new data. More...
 
void genTextureMipmaps ()
 Generate mipmaps for GPU texture. More...
 
void setFilter (const TextureFilter &filter)
 Set GPU texture filter mode. More...
 
void setWrap (const TextureWrap &wrap)
 Set texture wrapping mode. More...
 
Texture2D & getTexture ()
 Get the texture. More...
 
const Texture2D & get () const
 Get the texture. More...
 
const std::string & getPath () const
 Get the texture path. More...
 
const Rectangle & getTextureRec () const
 Get the texture rectangle. More...
 
const unsigned int & getID () const
 Get OpenGL texture ID. More...
 
const int & getWidth () const
 Get texture width. More...
 
const int & getHeight () const
 Get texture height. More...
 
const int & getMipmaps () const
 Get Mipmap levels, 1 by default. More...
 
const int & getFormat () const
 Get texture format. More...
 

Detailed Description

Encapsulation of the raylib texture NOTE: These functions require GPU access.

Constructor & Destructor Documentation

◆ RlTexture() [1/3]

raylib::texture::RlTexture::RlTexture ( const std::string &  fileName)
explicit

Create a RlTexture from file.

Parameters
fileNamethe file name of the texture

◆ RlTexture() [2/3]

raylib::texture::RlTexture::RlTexture ( const image::RlImage image)
explicit

Create a RlTexture from image.

Parameters
imagethe image of the texture
Here is the call graph for this function:

◆ RlTexture() [3/3]

raylib::texture::RlTexture::RlTexture ( const image::RlImage image,
const CubemapLayout &  layout 
)
explicit

Craete a RlTexture, cubemap from image, multiple image cubemap layouts supported.

Parameters
imagethe image
layoutthe layout
Here is the call graph for this function:

◆ ~RlTexture()

raylib::texture::RlTexture::~RlTexture ( )

RlTexture destructor.

Member Function Documentation

◆ genTextureMipmaps()

void raylib::texture::RlTexture::genTextureMipmaps ( )

Generate mipmaps for GPU texture.

◆ get()

const Texture2D & raylib::texture::RlTexture::get ( ) const

Get the texture.

Returns
the immutable raylib texture
Here is the caller graph for this function:

◆ getFormat()

const int & raylib::texture::RlTexture::getFormat ( ) const

Get texture format.

Returns
Data format (PixelFormat type)

◆ getHeight()

const int & raylib::texture::RlTexture::getHeight ( ) const

Get texture height.

Returns
the texture height
Here is the caller graph for this function:

◆ getID()

const unsigned int & raylib::texture::RlTexture::getID ( ) const

Get OpenGL texture ID.

Returns
the OpenGL texture ID

◆ getMipmaps()

const int & raylib::texture::RlTexture::getMipmaps ( ) const

Get Mipmap levels, 1 by default.

Returns
the Mipmap levels

◆ getPath()

const std::string & raylib::texture::RlTexture::getPath ( ) const

Get the texture path.

Returns
the texture path

◆ getTexture()

Texture2D & raylib::texture::RlTexture::getTexture ( )

Get the texture.

Returns
the mutable raylib texture

◆ getTextureRec()

const Rectangle & raylib::texture::RlTexture::getTextureRec ( ) const

Get the texture rectangle.

Returns
the texture rectangle

◆ getWidth()

const int & raylib::texture::RlTexture::getWidth ( ) const

Get texture width.

Returns
the texture width
Here is the caller graph for this function:

◆ setFilter()

void raylib::texture::RlTexture::setFilter ( const TextureFilter &  filter)

Set GPU texture filter mode.

Parameters
filterthe filter mode

◆ setWrap()

void raylib::texture::RlTexture::setWrap ( const TextureWrap &  wrap)

Set texture wrapping mode.

Parameters
wrapthe wrapping mode

◆ update()

void raylib::texture::RlTexture::update ( const void *  pixels)

Update GPU texture with new data.

Parameters
pixelsthe pixels

◆ updateRect()

void raylib::texture::RlTexture::updateRect ( const Rectangle &  rec,
const void *  pixels 
)

Update GPU texture rectangle with new data.

Parameters
recthe rectangle
pixelsthe pixels

The documentation for this class was generated from the following files: