PageRenderTime 465ms CodeModel.GetById 202ms app.highlight 5ms RepoModel.GetById 256ms app.codeStats 0ms

/opengles/src/Material.h

http://ftk.googlecode.com/
C++ Header | 107 lines | 42 code | 27 blank | 38 comment | 0 complexity | ae4c1730aca14c58e5c6d5e8c77c8fbf MD5 | raw file
  1#ifndef EGL_MATERIAL_H
  2#define EGL_MATERIAL_H 1
  3
  4// ==========================================================================
  5//
  6// Material.h		Material Class for 3D Rendering Library
  7//
  8// --------------------------------------------------------------------------
  9//
 10// 09-14-2003		Hans-Martin Will	initial version
 11//
 12// --------------------------------------------------------------------------
 13//
 14// Copyright (c) 2004, Hans-Martin Will. All rights reserved.
 15// 
 16// Redistribution and use in source and binary forms, with or without 
 17// modification, are permitted provided that the following conditions are 
 18// met:
 19// 
 20//	 *  Redistributions of source code must retain the above copyright
 21// 		notice, this list of conditions and the following disclaimer. 
 22//   *	Redistributions in binary form must reproduce the above copyright
 23// 		notice, this list of conditions and the following disclaimer in the 
 24// 		documentation and/or other materials provided with the distribution. 
 25// 
 26// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 27// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 29// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 30// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
 31// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 32// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 33// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 34// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 35// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
 36// THE POSSIBILITY OF SUCH DAMAGE.
 37//
 38// ==========================================================================
 39
 40
 41
 42#include "OGLES.h"
 43#include "FractionalColor.h"
 44
 45
 46namespace EGL {
 47
 48	class Material {
 49
 50	public:
 51		Material();
 52
 53		void SetAmbientColor(const FractionalColor & color);
 54		inline const FractionalColor& GetAmbientColor() const;
 55
 56		void SetDiffuseColor(const FractionalColor & color);
 57		inline const FractionalColor& GetDiffuseColor() const;
 58
 59		void SetSpecularColor(const FractionalColor & color);
 60		inline const FractionalColor& GetSpecularColor() const;
 61
 62		void SetEmissiveColor(const FractionalColor & color);
 63		inline const FractionalColor& GetEmissiveColor() const;
 64
 65		void SetSpecularExponent(EGL_Fixed exponent);
 66		inline EGL_Fixed GetSpecularExponent() const;
 67
 68	private:
 69		FractionalColor			m_AmbientColor;
 70		FractionalColor			m_DiffuseColor;
 71		FractionalColor			m_SpecularColor;
 72		FractionalColor			m_EmissiveColor;
 73		EGL_Fixed				m_SpecularExponent;
 74	};
 75
 76
 77	// --------------------------------------------------------------------------
 78	// Inline Functions
 79	// --------------------------------------------------------------------------
 80
 81
 82	inline const FractionalColor& Material :: GetAmbientColor() const {
 83		return m_AmbientColor;
 84	}
 85
 86
 87	inline const FractionalColor& Material :: GetDiffuseColor() const {
 88		return m_DiffuseColor;
 89	}
 90
 91
 92	inline const FractionalColor& Material :: GetSpecularColor() const {
 93		return m_SpecularColor;
 94	}
 95
 96
 97	inline const FractionalColor& Material :: GetEmissiveColor() const {
 98		return m_EmissiveColor;
 99	}
100
101
102	inline EGL_Fixed Material :: GetSpecularExponent() const {
103		return m_SpecularExponent;
104	}
105}
106
107#endif //ndef EGL_MATERIAL_H