forked from megayuchi/D3D12Lecture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextureManager.h
26 lines (23 loc) · 866 Bytes
/
TextureManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
class CHashTable;
class CD3D12Renderer;
class CD3D12ResourceManager;
class CTextureManager
{
CD3D12Renderer* m_pRenderer = nullptr;
CD3D12ResourceManager* m_pResourceManager = nullptr;
CHashTable* m_pHashTable = nullptr;
SORT_LINK* m_pTexLinkHead = nullptr;
SORT_LINK* m_pTexLinkTail = nullptr;
TEXTURE_HANDLE* AllocTextureHandle();
DWORD FreeTextureHandle(TEXTURE_HANDLE* pTexHandle);
void Cleanup();
public:
BOOL Initialize(CD3D12Renderer* pRenderer, DWORD dwMaxBucketNum, DWORD dwMaxFileNum);
TEXTURE_HANDLE* CreateTextureFromFile(const WCHAR* wchFileName);
TEXTURE_HANDLE* CreateDynamicTexture(UINT TexWidth, UINT TexHeight);
TEXTURE_HANDLE* CreateImmutableTexture(UINT TexWidth, UINT TexHeight, DXGI_FORMAT format, const BYTE* pInitImage);
void DeleteTexture(TEXTURE_HANDLE* pTexHandle);
CTextureManager();
~CTextureManager();
};