GL Studio C++ Runtime API
dds.h File Reference

This header defines constants and structures that are needed to parse DDS files. More...

#include "DXGIFormat.h"
#include <stdint.h>

Go to the source code of this file.

Classes

struct  DDS_PIXELFORMAT
 
struct  DDS_HEADER
 
struct  DDS_HEADER_DXT10
 

Macros

#define MAKEFOURCC(ch0, ch1, ch2, ch3)   ( ( DWORD )( BYTE )( ch0 ) | ( ( DWORD )( BYTE )( ch1 ) << 8 ) | ( ( DWORD )( BYTE )( ch2 ) << 16 ) | ( ( DWORD )( BYTE )( ch3 ) << 24 ) )
 
#define D3D10_REQ_MIP_LEVELS   ( 14 )
 
#define D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION   ( 512 )
 
#define DDS_MAGIC   0x20534444
 
#define DDS_FOURCC   0x00000004
 
#define DDS_RGB   0x00000040
 
#define DDS_RGBA   0x00000041
 
#define DDS_LUMINANCE   0x00020000
 
#define DDS_ALPHA   0x00000002
 
#define DDS_HEADER_FLAGS_TEXTURE   0x00001007
 DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT.
 
#define DDS_HEADER_FLAGS_MIPMAP   0x00020000
 DDSD_MIPMAPCOUNT.
 
#define DDS_HEADER_FLAGS_VOLUME   0x00800000
 DDSD_DEPTH.
 
#define DDS_HEADER_FLAGS_PITCH   0x00000008
 DDSD_PITCH.
 
#define DDS_HEADER_FLAGS_LINEARSIZE   0x00080000
 DDSD_LINEARSIZE.
 
#define DDS_SURFACE_FLAGS_TEXTURE   0x00001000
 DDSCAPS_TEXTURE.
 
#define DDS_SURFACE_FLAGS_MIPMAP   0x00400008
 DDSCAPS_COMPLEX | DDSCAPS_MIPMAP.
 
#define DDS_SURFACE_FLAGS_CUBEMAP   0x00000008
 DDSCAPS_COMPLEX.
 
#define DDS_CUBEMAP_POSITIVEX   0x00000600
 DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEX.
 
#define DDS_CUBEMAP_NEGATIVEX   0x00000a00
 DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX.
 
#define DDS_CUBEMAP_POSITIVEY   0x00001200
 DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY.
 
#define DDS_CUBEMAP_NEGATIVEY   0x00002200
 DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY.
 
#define DDS_CUBEMAP_POSITIVEZ   0x00004200
 DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ.
 
#define DDS_CUBEMAP_NEGATIVEZ   0x00008200
 DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ.
 
#define DDS_CUBEMAP_ALLFACES   ( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX | DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY | DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
 
#define DDS_FLAGS_VOLUME   0x00200000
 DDSCAPS2_VOLUME.
 

Typedefs

typedef uint32_t DWORD
 Type used in orignal DirectX dds.h file.
 
typedef unsigned char BYTE
 Type used in orignal DirectX dds.h file.
 
typedef uint32_t UINT
 Type used in orignal DirectX dds.h file.
 
typedef enum _D3DFORMAT D3DFORMAT
 
typedef enum D3D10_RESOURCE_DIMENSION D3D10_RESOURCE_DIMENSION
 

Enumerations

enum  _D3DFORMAT
 
enum  D3D10_RESOURCE_DIMENSION
 

Variables

const DDS_PIXELFORMAT DDSPF_DXT1 = { sizeof( DDS_PIXELFORMAT ), 0x00000004 , ( ( DWORD )( BYTE )( 'D' ) | ( ( DWORD )( BYTE )( 'X' ) << 8 ) | ( ( DWORD )( BYTE )( 'T' ) << 16 ) | ( ( DWORD )( BYTE )( '1' ) << 24 ) ), 0, 0, 0, 0, 0 }
 DXT1 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_DXT2 = { sizeof( DDS_PIXELFORMAT ), 0x00000004 , ( ( DWORD )( BYTE )( 'D' ) | ( ( DWORD )( BYTE )( 'X' ) << 8 ) | ( ( DWORD )( BYTE )( 'T' ) << 16 ) | ( ( DWORD )( BYTE )( '2' ) << 24 ) ), 0, 0, 0, 0, 0 }
 DXT2 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_DXT3 = { sizeof( DDS_PIXELFORMAT ), 0x00000004 , ( ( DWORD )( BYTE )( 'D' ) | ( ( DWORD )( BYTE )( 'X' ) << 8 ) | ( ( DWORD )( BYTE )( 'T' ) << 16 ) | ( ( DWORD )( BYTE )( '3' ) << 24 ) ), 0, 0, 0, 0, 0 }
 DXT3 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_DXT4 = { sizeof( DDS_PIXELFORMAT ), 0x00000004 , ( ( DWORD )( BYTE )( 'D' ) | ( ( DWORD )( BYTE )( 'X' ) << 8 ) | ( ( DWORD )( BYTE )( 'T' ) << 16 ) | ( ( DWORD )( BYTE )( '4' ) << 24 ) ), 0, 0, 0, 0, 0 }
 DXT4 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_DXT5 = { sizeof( DDS_PIXELFORMAT ), 0x00000004 , ( ( DWORD )( BYTE )( 'D' ) | ( ( DWORD )( BYTE )( 'X' ) << 8 ) | ( ( DWORD )( BYTE )( 'T' ) << 16 ) | ( ( DWORD )( BYTE )( '5' ) << 24 ) ), 0, 0, 0, 0, 0 }
 DXT5 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_A8R8G8B8 = { sizeof( DDS_PIXELFORMAT ), 0x00000041 , 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }
 A8R8G8B8 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_A1R5G5B5 = { sizeof( DDS_PIXELFORMAT ), 0x00000041 , 0, 16, 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }
 A1R5G5B5 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_A4R4G4B4 = { sizeof( DDS_PIXELFORMAT ), 0x00000041 , 0, 16, 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 }
 A4R4G4B4 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_R8G8B8 = { sizeof( DDS_PIXELFORMAT ), 0x00000040 , 0, 24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }
 R8G8B8 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_R5G6B5 = { sizeof( DDS_PIXELFORMAT ), 0x00000040 , 0, 16, 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }
 R5G6B5 Pixel format.
 
const DDS_PIXELFORMAT DDSPF_DX10 = { sizeof( DDS_PIXELFORMAT ), 0x00000004 , ( ( DWORD )( BYTE )( 'D' ) | ( ( DWORD )( BYTE )( 'X' ) << 8 ) | ( ( DWORD )( BYTE )( '1' ) << 16 ) | ( ( DWORD )( BYTE )( '0' ) << 24 ) ), 0, 0, 0, 0, 0 }
 DX10 Pixel format.
 

Detailed Description

This header defines constants and structures that are needed to parse DDS files.

Copyright Information

Copyright (c) 2017 by The DiSTI Corporation.
11301 Corporate Blvd; Suite 100
Orlando, Florida 32817
USA

All rights reserved.

This Software contains proprietary trade secrets of DiSTI and may not be reproduced, in whole or part, in any form, or by any means of electronic, mechanical, or otherwise, without the written permission of DiSTI. Said permission may be derived through the purchase of applicable DiSTI product licenses which detail the distribution rights of this content and any Derivative Works based on this or other copyrighted DiSTI Software.

NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND, AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.

LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT EXCEED FIVE DOLLARS (US$5.00).

The aforementioned terms and restrictions are governed by the laws of the State of Florida and the United States of America. Use, distribution, duplication, or disclosure by the U. S. Government is subject to "Restricted Rights" as set forth in DFARS 252.227-7014(c)(1)(ii).

Macro Definition Documentation

#define D3D10_REQ_MIP_LEVELS   ( 14 )

Maximum number of mipmap levels a texture resource may have. http://msdn.microsoft.com/en-us/library/bb509540.aspx

#define D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION   ( 512 )

Maximum array size of a 2D texture array. http://msdn.microsoft.com/en-us/library/bb509540.aspx

#define DDS_ALPHA   0x00000002

DDPF_ALPHA - Used in some older DDS files for alpha channel only uncompressed data (dwRGBBitCount contains the alpha channel bitcount; dwABitMask contains valid data)

DDS structure contains all faces

#define DDS_FOURCC   0x00000004

DDPF_FOURCC Texture contains compressed RGB data; dwFourCC contains valid data.

#define DDS_LUMINANCE   0x00020000

DDPF_LUMINANCE - Used in some older DDS files for single channel color uncompressed data (dwRGBBitCount contains the luminance channel bit count; dwRBitMask contains the channel mask). Can be combined with DDPF_ALPHAPIXELS for a two channel DDS file.

#define DDS_MAGIC   0x20534444

A DWORD (magic number) containing the four character code value 'DDS ' It is the first value in a DDS file

#define DDS_RGB   0x00000040

DDPF_RGB - Texture contains uncompressed RGB data; dwRGBBitCount and the RGB masks (dwRBitMask, dwGBitMask, dwBBitMask) contain valid data.

#define DDS_RGBA   0x00000041

DDPF_RGB | DDPF_ALPHAPIXELS - Texture contains uncompressed RGBA data; dwRGBBitCount and the RGB masks (dwRBitMask, dwGBitMask, dwBBitMask, dwABitMask) contain valid data.

#define MAKEFOURCC (   ch0,
  ch1,
  ch2,
  ch3 
)    ( ( DWORD )( BYTE )( ch0 ) | ( ( DWORD )( BYTE )( ch1 ) << 8 ) | ( ( DWORD )( BYTE )( ch2 ) << 16 ) | ( ( DWORD )( BYTE )( ch3 ) << 24 ) )

Combines four charaters into a DWORD. Used for specified compressed texture formats. See http://msdn.microsoft.com/en-us/library/bb172558.aspx#DXTn_Compressed_Texture_Formats

Typedef Documentation

typedef enum _D3DFORMAT D3DFORMAT

Defines the various types of surface formats. http://msdn.microsoft.com/en-us/library/bb172558.aspx

Enumeration Type Documentation

enum _D3DFORMAT

Defines the various types of surface formats. http://msdn.microsoft.com/en-us/library/bb172558.aspx

Identifies the type of resource being used. http://msdn.microsoft.com/en-us/library/bb172411.aspx