Modified source engine (2017) developed by valve and leaked in 2020. Not for commercial purporses
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

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#ifndef TEXTUREHEAP_H
#define TEXTUREHEAP_H
#if defined( _X360 )
#include "locald3dtypes.h"
class CTextureHeap
{
public:
IDirect3DTexture *AllocTexture( int width, int height, int levels, DWORD usage, D3DFORMAT format, bool bFallback, bool bNoD3DMemory );
IDirect3DCubeTexture *AllocCubeTexture( int width, int levels, DWORD usage, D3DFORMAT format, bool bFallback, bool bNoD3DMemory );
IDirect3DVolumeTexture *AllocVolumeTexture( int width, int height, int depth, int levels, DWORD usage, D3DFORMAT format );
IDirect3DSurface *AllocRenderTargetSurface( int width, int height, D3DFORMAT format, bool bMultiSample = false , int base = -1);
// Perform the real d3d allocation, returns true if succesful, false otherwise.
// Only valid for a texture created with no d3d bits, otherwise no-op.
bool AllocD3DMemory( IDirect3DBaseTexture *pTexture );
// Release header and d3d bits.
void FreeTexture( IDirect3DBaseTexture *pTexture );
// Returns the amount of memory needed or allocated for the texture.
int GetSize( IDirect3DBaseTexture *pTexture );
// Crunch the heap.
void Compact();
// Get current backbuffer multisample type
D3DMULTISAMPLE_TYPE GetBackBufferMultiSampleType();
};
extern CTextureHeap g_TextureHeap;
#endif
#endif // TEXTUREHEAP_H