1 // material.hxx -- class to handle material properties
3 // Written by Curtis Olson, started May 1998.
5 // Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 // (Log is kept at end of this file)
30 # error This library requires C++
44 #include <map.h> // STL associative "array"
46 #if defined(__CYGWIN32__)
47 # include <string> // Standard C++ string library
49 # include <string.h> // Standard C++ string library
51 # include <std/string.h> // Standard C++ string library
57 #define FG_MAX_MATERIAL_FRAGS 100
60 // Material property class
65 // material properties
66 GLfloat ambient[4], diffuse[4], specular[4];
69 // transient list of objects with this material type (used for sorting
70 // by material to reduce GL state changes when rendering the scene
71 fgFRAGMENT * list[FG_MAX_MATERIAL_FRAGS];
78 void init_sort_list( void );
79 int append_sort_list( fgFRAGMENT *object );
86 // Material management class
87 class fgMATERIAL_MGR {
91 // associative array of materials
92 map < string, fgMATERIAL, less<string> > materials;
95 fgMATERIAL_MGR ( void );
97 // Load a library of material properties
98 int load_lib ( void );
101 ~fgMATERIAL_MGR ( void );
105 #endif // _MATERIAL_HXX
109 // Revision 1.2 1998/06/01 17:56:20 curt
110 // Incremental additions to material.cxx (not fully functional)
111 // Tweaked vfc_ratio math to avoid divide by zero.
113 // Revision 1.1 1998/05/30 01:56:45 curt
114 // Added material.cxx material.hxx