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.
29 # error This library requires C++
40 #include <Include/compiler.h>
45 #include STL_STRING // Standard C++ string library
50 // MSVC++ 6.0 kuldge - Need forward declaration of friends.
52 istream& operator >> ( istream& in, fgMATERIAL& m );
54 // Material property class
61 // OpenGL texture name
64 // file name of texture
73 // material properties
74 GLfloat ambient[4], diffuse[4], specular[4], emissive[4];
85 void load_texture( const string& root );
87 friend istream& operator >> ( istream& in, FGMaterial& m );
89 inline bool is_loaded() const { return loaded; }
90 inline GLuint get_texture_id() const { return texture_id; }
91 inline string get_texture_name() const { return texture_name; }
92 inline double get_xsize() const { return xsize; }
93 inline double get_ysize() const { return ysize; }
94 inline GLfloat *get_ambient() { return ambient; }
95 inline GLfloat *get_diffuse() { return diffuse; }
96 inline GLfloat *get_specular() { return specular; }
97 inline GLfloat *get_emissive() { return emissive; }
101 #endif // _MATERIAL_HXX