Click here to Skip to main content
15,896,348 members
Articles / Desktop Programming / MFC

DirectX Tutorial Part II: Using the CDirectXDialog class in a pinball game

Rate me:
Please Sign up or sign in to vote.
4.37/5 (7 votes)
19 May 20063 min read 47.8K   1.9K   38  
CDirectXDialog is a base class for dialog classes in which you want to use DirectX. This example gives a profound describtion about the features of this class.
/**
 * Copyright (C) 1999-2005
 * Doga Arinir
 * 
 * Author: Dipl.Ing. Doga Arinir
 * E-Mail: arinir@gmx.de
 *
 * This software is provided 'as-is', without any express or implied
 * warranty.  In no event will the author or the company be held liable 
 * for any damages arising from the use of this software. EXPECT BUGS!
 * 
 * You may use this software in compiled form in any way you desire PROVIDING it is
 * not sold for profit without the authors written permission, and providing that this
 * notice and the authors name is included. If the source code in this file is used in 
 * any commercial application then acknowledgement must be made to the author of this file.
 */
#include "stdafx.h"
#include "stdafx.h"
#include "_Polygon.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Konstruktion/Destruktion
//////////////////////////////////////////////////////////////////////

_Polygon::_Polygon(int x[], int y[], int npoints) : points_count(npoints)
{
	points = new POINT[npoints];
	for (int i = 0; i < npoints; i++)
	{
		points[i].x = x[i];
		points[i].y = y[i];
	}
}
_Polygon::~_Polygon()
{
	delete [] points;
}

_Polygon::operator POINT*() const
{
	return points;
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Chief Technology Officer W3L
Germany Germany
-Since 1th August 2007: Chief Technology Officer of W3L
-2002/08/01-2007/07/31: PhD student
-1997/10/15-2002/07/31: Studied Electrical Engineering and Computer Science

Comments and Discussions