Plasma Engine  2.0
Loading...
Searching...
No Matches
Resource.h
1
2#pragma once
3
4#include <Foundation/Containers/HashTable.h>
5#include <Foundation/Strings/HashedString.h>
6#include <RendererFoundation/RendererFoundationDLL.h>
7
8class PL_RENDERERFOUNDATION_DLL plGALResourceBase : public plRefCounted
9{
10public:
11 void SetDebugName(const char* szName) const
12 {
13#if PL_ENABLED(PL_COMPILE_FOR_DEVELOPMENT)
14 m_sDebugName.Assign(szName);
15#endif
16
17 SetDebugNamePlatform(szName);
18 }
19
20 virtual const plGALResourceBase* GetParentResource() const { return this; }
21
22protected:
23 friend class plGALDevice;
24
25 inline ~plGALResourceBase() = default;
26
27 virtual void SetDebugNamePlatform(const char* szName) const = 0;
28
29#if PL_ENABLED(PL_COMPILE_FOR_DEVELOPMENT)
30 mutable plHashedString m_sDebugName;
31#endif
32};
33
35template <typename CreationDescription>
37{
38public:
39 PL_ALWAYS_INLINE plGALResource(const CreationDescription& description)
40 : m_Description(description)
41 {
42 }
43
44 PL_ALWAYS_INLINE const CreationDescription& GetDescription() const { return m_Description; }
45
46protected:
47 const CreationDescription m_Description;
48};
The plRenderDevice class is the primary interface for interactions with rendering APIs It contains a ...
Definition Device.h:19
Definition Resource.h:9
Base class for GAL resources, stores a creation description of the object and also allows for referen...
Definition Resource.h:37
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
Base class for reference counted objects.
Definition RefCounted.h:52