yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gfx::TexturePool Class Reference

#include <texture_pool.h>

Public Member Functions

SDL_Texture * GetTexture (SDL_Renderer *renderer, int width, int height, Uint32 format)
 
void ReturnTexture (SDL_Texture *texture, int width, int height, Uint32 format)
 
void Clear ()
 

Static Public Member Functions

static TexturePoolGetInstance ()
 

Private Member Functions

 TexturePool ()=default
 
std::string GenerateKey (int width, int height, Uint32 format)
 

Private Attributes

std::unordered_map< std::string, std::vector< SDL_Texture * > > available_textures_
 

Detailed Description

Definition at line 14 of file texture_pool.h.

Constructor & Destructor Documentation

◆ TexturePool()

yaze::gfx::TexturePool::TexturePool ( )
privatedefault

Referenced by GetInstance().

Member Function Documentation

◆ GetInstance()

static TexturePool & yaze::gfx::TexturePool::GetInstance ( )
inlinestatic

Definition at line 16 of file texture_pool.h.

References TexturePool().

Referenced by yaze::gfx::Bitmap::CreateTexture().

Here is the call graph for this function:

◆ GetTexture()

SDL_Texture * yaze::gfx::TexturePool::GetTexture ( SDL_Renderer * renderer,
int width,
int height,
Uint32 format )
inline

Definition at line 21 of file texture_pool.h.

References available_textures_, and GenerateKey().

Referenced by yaze::gfx::Bitmap::CreateTexture().

Here is the call graph for this function:

◆ ReturnTexture()

void yaze::gfx::TexturePool::ReturnTexture ( SDL_Texture * texture,
int width,
int height,
Uint32 format )
inline

Definition at line 36 of file texture_pool.h.

References available_textures_, and GenerateKey().

Referenced by yaze::gfx::Bitmap::CreateTexture().

Here is the call graph for this function:

◆ Clear()

void yaze::gfx::TexturePool::Clear ( )
inline

Definition at line 43 of file texture_pool.h.

References available_textures_.

◆ GenerateKey()

std::string yaze::gfx::TexturePool::GenerateKey ( int width,
int height,
Uint32 format )
inlineprivate

Definition at line 55 of file texture_pool.h.

Referenced by GetTexture(), and ReturnTexture().

Member Data Documentation

◆ available_textures_

std::unordered_map<std::string, std::vector<SDL_Texture*> > yaze::gfx::TexturePool::available_textures_
private

Definition at line 59 of file texture_pool.h.

Referenced by Clear(), GetTexture(), and ReturnTexture().


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