C++ Game Framework  2013-06-04
CGF is a DirectX 11 game framework, built in C++ and DirectX 11. This is used to contain many to the DirectX functionality and wrap them into a framework to make game development easier.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DDSTextureLoader.cpp File Reference
#include <dxgiformat.h>
#include <assert.h>
#include <algorithm>
#include <memory>
#include "DDSTextureLoader.h"

Classes

struct  DDS_PIXELFORMAT
 
struct  DDS_HEADER
 
struct  DDS_HEADER_DXT10
 
struct  handle_closer
 

Macros

#define MAKEFOURCC(ch0, ch1, ch2, ch3)
 
#define DDS_MAGIC   0x20534444
 
#define DDS_FOURCC   0x00000004
 
#define DDS_RGB   0x00000040
 
#define DDS_RGBA   0x00000041
 
#define DDS_LUMINANCE   0x00020000
 
#define DDS_LUMINANCEA   0x00020001
 
#define DDS_ALPHA   0x00000002
 
#define DDS_PAL8   0x00000020
 
#define DDS_HEADER_FLAGS_TEXTURE   0x00001007
 
#define DDS_HEADER_FLAGS_MIPMAP   0x00020000
 
#define DDS_HEADER_FLAGS_VOLUME   0x00800000
 
#define DDS_HEADER_FLAGS_PITCH   0x00000008
 
#define DDS_HEADER_FLAGS_LINEARSIZE   0x00080000
 
#define DDS_HEIGHT   0x00000002
 
#define DDS_WIDTH   0x00000004
 
#define DDS_SURFACE_FLAGS_TEXTURE   0x00001000
 
#define DDS_SURFACE_FLAGS_MIPMAP   0x00400008
 
#define DDS_SURFACE_FLAGS_CUBEMAP   0x00000008
 
#define DDS_CUBEMAP_POSITIVEX   0x00000600
 
#define DDS_CUBEMAP_NEGATIVEX   0x00000a00
 
#define DDS_CUBEMAP_POSITIVEY   0x00001200
 
#define DDS_CUBEMAP_NEGATIVEY   0x00002200
 
#define DDS_CUBEMAP_POSITIVEZ   0x00004200
 
#define DDS_CUBEMAP_NEGATIVEZ   0x00008200
 
#define DDS_CUBEMAP_ALLFACES
 
#define DDS_CUBEMAP   0x00000200
 
#define DDS_FLAGS_VOLUME   0x00200000
 
#define ISBITMASK(r, g, b, a)   ( ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a )
 

Typedefs

typedef public std::unique_ptr
< void, handle_closer
ScopedHandle
 

Enumerations

enum  DDS_MISC_FLAGS2 { DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L }
 

Functions

HANDLE safe_handle (HANDLE h)
 
template<UINT TNameLength>
void SetDebugObjectName (_In_ ID3D11DeviceChild *resource, _In_ const char(&name)[TNameLength])
 

Macro Definition Documentation

#define DDS_ALPHA   0x00000002
#define DDS_CUBEMAP   0x00000200
#define DDS_CUBEMAP_ALLFACES
Value:
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
#define DDS_CUBEMAP_NEGATIVEX   0x00000a00
#define DDS_CUBEMAP_NEGATIVEY   0x00002200
#define DDS_CUBEMAP_NEGATIVEZ   0x00008200
#define DDS_CUBEMAP_POSITIVEX   0x00000600
#define DDS_CUBEMAP_POSITIVEY   0x00001200
#define DDS_CUBEMAP_POSITIVEZ   0x00004200
#define DDS_FLAGS_VOLUME   0x00200000
#define DDS_FOURCC   0x00000004
#define DDS_HEADER_FLAGS_LINEARSIZE   0x00080000
#define DDS_HEADER_FLAGS_MIPMAP   0x00020000
#define DDS_HEADER_FLAGS_PITCH   0x00000008
#define DDS_HEADER_FLAGS_TEXTURE   0x00001007
#define DDS_HEADER_FLAGS_VOLUME   0x00800000
#define DDS_HEIGHT   0x00000002
#define DDS_LUMINANCE   0x00020000
#define DDS_LUMINANCEA   0x00020001
#define DDS_MAGIC   0x20534444
#define DDS_PAL8   0x00000020
#define DDS_RGB   0x00000040
#define DDS_RGBA   0x00000041
#define DDS_SURFACE_FLAGS_CUBEMAP   0x00000008
#define DDS_SURFACE_FLAGS_MIPMAP   0x00400008
#define DDS_SURFACE_FLAGS_TEXTURE   0x00001000
#define DDS_WIDTH   0x00000004
#define ISBITMASK (   r,
  g,
  b,
 
)    ( ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a )
#define MAKEFOURCC (   ch0,
  ch1,
  ch2,
  ch3 
)
Value:
((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8) | \
((uint32_t)(uint8_t)(ch2) << 16) | ((uint32_t)(uint8_t)(ch3) << 24 ))

Typedef Documentation

typedef public std::unique_ptr<void, handle_closer> ScopedHandle

Enumeration Type Documentation

Enumerator
DDS_MISC_FLAGS2_ALPHA_MODE_MASK 

Function Documentation

HANDLE safe_handle ( HANDLE  h)
inline
template<UINT TNameLength>
void SetDebugObjectName ( _In_ ID3D11DeviceChild *  resource,
_In_ const char(&)  name[TNameLength] 
)
inline