Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TEXTUREHEAP_H
  7. #define TEXTUREHEAP_H
  8. #if defined( _X360 )
  9. #include "locald3dtypes.h"
  10. class CTextureHeap
  11. {
  12. public:
  13. IDirect3DTexture *AllocTexture( int width, int height, int levels, DWORD usage, D3DFORMAT format, bool bFallback, bool bNoD3DMemory );
  14. IDirect3DCubeTexture *AllocCubeTexture( int width, int levels, DWORD usage, D3DFORMAT format, bool bFallback, bool bNoD3DMemory );
  15. IDirect3DVolumeTexture *AllocVolumeTexture( int width, int height, int depth, int levels, DWORD usage, D3DFORMAT format );
  16. IDirect3DSurface *AllocRenderTargetSurface( int width, int height, D3DFORMAT format, bool bMultiSample = false , int base = -1);
  17. // Perform the real d3d allocation, returns true if succesful, false otherwise.
  18. // Only valid for a texture created with no d3d bits, otherwise no-op.
  19. bool AllocD3DMemory( IDirect3DBaseTexture *pTexture );
  20. // Release header and d3d bits.
  21. void FreeTexture( IDirect3DBaseTexture *pTexture );
  22. // Returns the amount of memory needed or allocated for the texture.
  23. int GetSize( IDirect3DBaseTexture *pTexture );
  24. // Crunch the heap.
  25. void Compact();
  26. // Get current backbuffer multisample type
  27. D3DMULTISAMPLE_TYPE GetBackBufferMultiSampleType();
  28. };
  29. extern CTextureHeap g_TextureHeap;
  30. #endif
  31. #endif // TEXTUREHEAP_H