Click here to Skip to main content
15,886,562 members
Articles / Multimedia / OpenGL

A small VRML viewer using OpenGL and MFC

Rate me:
Please Sign up or sign in to vote.
4.96/5 (57 votes)
30 Nov 19992 min read 428K   16.8K   159  
//********************************************
// Color.cpp
//********************************************
// class CColor
//********************************************
// pierre.alliez@cnet.francetelecom.fr
// Created : 10/12/97
// Modified : 09/02/98
//********************************************

#include "stdafx.h"
#include "Color.h"

//////////////////////////////////////////////
// DATAS
//////////////////////////////////////////////

//********************************************
// Set
//********************************************
void CColor::Set(unsigned char red,
								 unsigned char green,
								 unsigned char blue,
								 unsigned char alpha)
{
	m_Red = red;
	m_Green = green;
	m_Blue = blue;
	m_Alpha = alpha;
}

//********************************************
// Set
//********************************************
void CColor::Set(unsigned char red,
								 unsigned char green,
								 unsigned char blue)
{
	m_Red = red;
	m_Green = green;
	m_Blue = blue;
	m_Alpha = 255;
}

//********************************************
// Set
//********************************************
void CColor::Set(unsigned char grey)
{
	m_Red = grey;
	m_Green = grey;
	m_Blue = grey;
	m_Alpha = 255;
}


//********************************************
// Set
//********************************************
void CColor::Set(CColor &c)
{
	m_Red = c.r();
	m_Green = c.g();
	m_Blue = c.b();
	m_Alpha = c.a();
}






// ** EOF **

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
France France
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions