VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
venom::common::GraphicsPluginObject Class Reference

Base class for graphics plugin objects. More...

#include <GraphicsPluginObject.h>

+ Inheritance diagram for venom::common::GraphicsPluginObject:

Public Member Functions

virtual void Destroy () override
 /!\ THIS FUNCTION MUST BE CALLED FOR DESTRUCTION, DO NOT USE delete
 
- Public Member Functions inherited from venom::common::PluginObject
 PluginObject (const PluginType type)
 
PluginType GetType () const override
 
template<class T >
T * DAs ()
 
template<class T >
const T * DAs () const
 
- Public Member Functions inherited from venom::common::IPluginObject

Static Public Member Functions

static bool HasCachedObject (const std::string &path)
 Checks if an object is in the cache.
 
static SPtr< GraphicsCachedResourceGetCachedObject (const std::string &path)
 Gets a cached object from the graphics cache.
 
static const std::unordered_map< std::string, std::shared_ptr< GraphicsCachedResource > > & GetCachedObjects ()
 Gets all cached objects.
 

Static Protected Member Functions

static void _SetInCache (const std::string &path, const SPtr< GraphicsCachedResource > &object)
 Sets an object in the cache.
 
static void _SetCacheSize (size_t size)
 Adds cache size to avoid unnecessary additional allocations.
 
static void _AddCacheSize (size_t size)
 Adds cache size to avoid unnecessary additional allocations.
 

Detailed Description

Base class for graphics plugin objects.

Warning
DO NOT INHERIT with GraphicsCachedResource

Member Function Documentation

◆ _AddCacheSize()

void venom::common::GraphicsPluginObject::_AddCacheSize ( size_t size)
staticprotected

Adds cache size to avoid unnecessary additional allocations.

Parameters
size

◆ _SetCacheSize()

void venom::common::GraphicsPluginObject::_SetCacheSize ( size_t size)
staticprotected

Adds cache size to avoid unnecessary additional allocations.

Parameters
size

◆ _SetInCache()

void venom::common::GraphicsPluginObject::_SetInCache ( const std::string & path,
const SPtr< GraphicsCachedResource > & object )
staticprotected

Sets an object in the cache.

Parameters
path
Warning
path must be the original asset path relative to the resources folder
Parameters
object

◆ Destroy()

void venom::common::GraphicsPluginObject::Destroy ( )
overridevirtual

/!\ THIS FUNCTION MUST BE CALLED FOR DESTRUCTION, DO NOT USE delete

Reimplemented from venom::common::PluginObject.

◆ GetCachedObject()

std::shared_ptr< GraphicsCachedResource > venom::common::GraphicsPluginObject::GetCachedObject ( const std::string & path)
static

Gets a cached object from the graphics cache.

Parameters
path(to the original asset)
Warning
path must be the original asset path relative to the resources folder
Returns
nullptr if the object is not in cache, the object otherwise

◆ GetCachedObjects()

const std::unordered_map< std::string, std::shared_ptr< GraphicsCachedResource > > & venom::common::GraphicsPluginObject::GetCachedObjects ( )
static

Gets all cached objects.

Returns
cached objects

◆ HasCachedObject()

bool venom::common::GraphicsPluginObject::HasCachedObject ( const std::string & path)
static

Checks if an object is in the cache.

Parameters
pathrelative path to the asset
Returns
true if found in the cache

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