DI-Guy SDK Documentation  13.7
diguyDx11GraphicsTexture.cpp File Reference
#include "diguyDx11GraphicsTexture.h"
#include "diguyDx11UniformBuffer.h"
#include "dx11_headers.h"
#include <libbdilog.h>
#include <stdlib.h>
#include <assert.h>
#include <memory>
#include <new>
#include <algorithm>
#include <ddraw.h>
#include <DXUT/Core/DDSTextureLoader.h>

Functions

static HRESULT CreateD3DResources (_In_ ID3D11Device *d3dDevice, _In_ uint32_t resDim, _In_ size_t width, _In_ size_t height, _In_ size_t depth, _In_ size_t mipCount, _In_ size_t arraySize, _In_ DXGI_FORMAT format, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool isCubeMap, _In_reads_opt_(mipCount *arraySize) D3D11_SUBRESOURCE_DATA *initData, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView)
 
static size_t BitsPerPixel (_In_ DXGI_FORMAT fmt)
 
static void GetSurfaceInfo (_In_ size_t width, _In_ size_t height, _In_ DXGI_FORMAT fmt, _Out_opt_ size_t *outNumBytes, _Out_opt_ size_t *outRowBytes, _Out_opt_ size_t *outNumRows)
 
static HRESULT FillInitData (_In_ size_t width, _In_ size_t height, _In_ size_t depth, _In_ size_t mipCount, _In_ size_t arraySize, _In_ DXGI_FORMAT format, _In_ size_t maxsize, _In_ size_t bitSize, _In_reads_bytes_(bitSize) const uint8_t *bitData, _Out_ size_t &twidth, _Out_ size_t &theight, _Out_ size_t &tdepth, _Out_ size_t &skipMip, _Out_writes_(mipCount *arraySize) D3D11_SUBRESOURCE_DATA *initData)
 
static HRESULT CreateTextureFromDDS (_In_ ID3D11Device *d3dDevice, _In_opt_ ID3D11DeviceContext *d3dContext, _In_ DXGI_FORMAT format, _In_ size_t width, _In_ size_t height, _In_ size_t depth, _In_ size_t mipCount, _In_reads_bytes_(bitSize) const uint8_t *bitData, _In_ size_t bitSize, _In_ size_t maxsize, _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, _Outptr_opt_ ID3D11Resource **texture, _Outptr_opt_ ID3D11ShaderResourceView **textureView)
 
diguyGraphicsTexturediguyDx11GraphicsTexture_create_func (void *internal_data)
 Create function declaration. More...
 

Function Documentation

static HRESULT CreateD3DResources ( _In_ ID3D11Device *  d3dDevice,
_In_ uint32_t  resDim,
_In_ size_t  width,
_In_ size_t  height,
_In_ size_t  depth,
_In_ size_t  mipCount,
_In_ size_t  arraySize,
_In_ DXGI_FORMAT  format,
_In_ D3D11_USAGE  usage,
_In_ unsigned int  bindFlags,
_In_ unsigned int  cpuAccessFlags,
_In_ unsigned int  miscFlags,
_In_ bool  isCubeMap,
_In_reads_opt_(mipCount *arraySize) D3D11_SUBRESOURCE_DATA *  initData,
_Outptr_opt_ ID3D11Resource **  texture,
_Outptr_opt_ ID3D11ShaderResourceView **  textureView 
)
static
static size_t BitsPerPixel ( _In_ DXGI_FORMAT  fmt)
static
static void GetSurfaceInfo ( _In_ size_t  width,
_In_ size_t  height,
_In_ DXGI_FORMAT  fmt,
_Out_opt_ size_t *  outNumBytes,
_Out_opt_ size_t *  outRowBytes,
_Out_opt_ size_t *  outNumRows 
)
static
static HRESULT FillInitData ( _In_ size_t  width,
_In_ size_t  height,
_In_ size_t  depth,
_In_ size_t  mipCount,
_In_ size_t  arraySize,
_In_ DXGI_FORMAT  format,
_In_ size_t  maxsize,
_In_ size_t  bitSize,
_In_reads_bytes_(bitSize) const uint8_t *  bitData,
_Out_ size_t &  twidth,
_Out_ size_t &  theight,
_Out_ size_t &  tdepth,
_Out_ size_t &  skipMip,
_Out_writes_(mipCount *arraySize) D3D11_SUBRESOURCE_DATA *  initData 
)
static
static HRESULT CreateTextureFromDDS ( _In_ ID3D11Device *  d3dDevice,
_In_opt_ ID3D11DeviceContext *  d3dContext,
_In_ DXGI_FORMAT  format,
_In_ size_t  width,
_In_ size_t  height,
_In_ size_t  depth,
_In_ size_t  mipCount,
_In_reads_bytes_(bitSize) const uint8_t *  bitData,
_In_ size_t  bitSize,
_In_ size_t  maxsize,
_In_ D3D11_USAGE  usage,
_In_ unsigned int  bindFlags,
_In_ unsigned int  cpuAccessFlags,
_In_ unsigned int  miscFlags,
_In_ bool  forceSRGB,
_Outptr_opt_ ID3D11Resource **  texture,
_Outptr_opt_ ID3D11ShaderResourceView **  textureView 
)
static
diguyGraphicsTexture* diguyDx11GraphicsTexture_create_func ( void *  internal_data)

Create function declaration.

Declare a subclass creation function that will be registered with the DI-Guy Graphics API.