Click here to Skip to main content
12,898,335 members (54,167 online)
Click here to Skip to main content


114 bookmarked
Posted 4 Oct 2006

MFC D3D Application: Direct3D Tutorial: Part I

, 9 Dec 2012 CPOL
Yet another Direct3D framework, this time for MFC apps, with a step by step tutorial
// XD3DSettings.h: Current D3D settings, including adapter, device, mode, etc.

#ifndef _XD3DSETTINGS_H_
#define _XD3DSETTINGS_H_

#include "XD3DUtil.h"
#include "XD3DEnum.h"

typedef CTArray<AdapterInfo*> AdapterInfoPtrArray;

// CXD3DSettings: Current D3D settings: adapter, device, mode, formats, etc.
class CXD3DSettings
	AdapterInfoPtrArray	AdapterInfos;	// fullscreen [0] and windowed [1]

    UINT Windowed;						// index to the previous

	UINT ndm[2];	// indices to the best display mode within each AdapterInfo
	UINT ndi[2];	// indices to the best DeviceInfo within each AdapterInfo
    UINT ndc[2];	// indices to the best DeviceCombo within each DeviceInfo

	// indices into DeviceCombo properties that can be changed
	UINT nDSFormat;

	// constructor

	// 'Get' wrappers
	AdapterInfo*		GetAdapterInfo();
    DeviceInfo*			GetDeviceInfo();
    D3DDISPLAYMODE		GetDisplayMode();
	VPTYPE				GetVPType();
    D3DFORMAT			GetBackBufferFormat();
    D3DFORMAT			GetDSFormat();
    DWORD				GetMSQuality();
    DWORD				GetPresentInterval();

    // 'Set' wrappers
	void SetDSFormat(UINT nFmt);


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.


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


About the Author

hector [.j.] rivas
Software Developer (Senior) Code Authority, Inc.
United States United States
Pride in craftsmanship is my new thing.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 9 Dec 2012
Article Copyright 2006 by hector [.j.] rivas
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid