Click here to Skip to main content
15,885,366 members
Articles / Programming Languages / C++

MFC D3D Application: Direct3D Tutorial: Part I

Rate me:
Please Sign up or sign in to vote.
4.99/5 (31 votes)
9 Dec 2012CPOL31 min read 149.7K   3.8K   117  
Yet another Direct3D framework, this time for MFC apps, with a step by step tutorial
//-----------------------------------------------------------------------------
// XD3DUtil.h: XD3D framework utility constants, macros and globals
//-----------------------------------------------------------------------------

#ifndef _XD3DUTIL_H_
#define _XD3DUTIL_H_

#include <tchar.h>
#include <d3d9.h>

// Vertex Proccessing types enum, including the (hardware) pure device variant

enum VPTYPE
{
	SOFT_VP,
	MIXD_VP,
	HARD_VP,
	PURE_VP,
    FORCE_DWORD_VP = 0x7fffffff
};

// bits in a D3D format inspectors

UINT RGBBITS(D3DFORMAT fmt);
UINT ALPHABITS(D3DFORMAT fmt);
UINT DEPTHBITS(D3DFORMAT fmt);
UINT STENCILBITS(D3DFORMAT fmt);


// D3D type to string converters, with optional prefix skipping

TCHAR* VPTYPESTRING(VPTYPE vpt);
TCHAR* DEVICETYPESTRING(D3DDEVTYPE dt, bool bPrefix = true);
TCHAR* MULTISAMPLESTRING(D3DMULTISAMPLE_TYPE mst, bool bPrefix = true);
TCHAR* PRESENTINTERVALSTRING(UINT pi, bool bPrefix = true);

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Texas Capital Bank
United States United States
Professional software engineer with 30+ years of experience delivering systems across diverse industries, looking for the next opportunity to deliver cutting edge end-to-end technology solutions.

Avid reader, disciplined writer and enthusiastic tinkerer with a background in electronics, looking inside and thinking outside the box, genuinely passionate about robust, extensible, reusable and performant code.

Framework developer leading, coaching and learning about best practices, code quality, DevOps and software and data lifecycle management with an agile mindset to create the most elegant and sustainable solutions.

Comments and Discussions