Clr.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /* GG is a GUI for SDL and OpenGL.
00003    Copyright (C) 2003 T. Zachary Laine
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public License
00007    as published by the Free Software Foundation; either version 2.1
00008    of the License, or (at your option) any later version.
00009    
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014     
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA
00019 
00020    If you do not wish to comply with the terms of the LGPL please
00021    contact the author as other terms are available for a fee.
00022     
00023    Zach Laine
00024    whatwasthataddress@hotmail.com */
00025 
00029 #ifndef _GG_Clr_h_
00030 #define _GG_Clr_h_
00031 
00032 #include <GG/Base.h>
00033 
00034 #include <boost/serialization/access.hpp>
00035 #include <boost/serialization/nvp.hpp>
00036 
00037 
00038 namespace GG {
00039 
00044 struct GG_API Clr
00045 { 
00047     Clr();                                                       
00048     Clr(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_);         
00049 
00050 
00051     GLubyte r;   
00052     GLubyte g;   
00053     GLubyte b;   
00054     GLubyte a;   
00055 
00056 private:
00057     friend class boost::serialization::access;
00058     template <class Archive>
00059     void serialize(Archive& ar, const unsigned int version);
00060 };
00061 
00062 GG_API Clr FloatClr(float r_, float g_, float b_, float a_); 
00063 
00064 GG_API bool operator==(const Clr& rhs, const Clr& lhs); 
00065 GG_API bool operator!=(const Clr& rhs, const Clr& lhs); 
00066 
00067 // some useful color constants
00068 extern GG_API const Clr CLR_ZERO;
00069 extern GG_API const Clr CLR_BLACK;
00070 extern GG_API const Clr CLR_WHITE;
00071 extern GG_API const Clr CLR_GRAY;
00072 extern GG_API const Clr CLR_SHADOW;
00073 extern GG_API const Clr CLR_RED;
00074 extern GG_API const Clr CLR_GREEN;
00075 extern GG_API const Clr CLR_BLUE;
00076 extern GG_API const Clr CLR_CYAN;
00077 extern GG_API const Clr CLR_YELLOW;
00078 extern GG_API const Clr CLR_MAGENTA;
00079 
00080 } // namespace GG
00081 
00082 // template implementations
00083 template <class Archive>
00084 void GG::Clr::serialize(Archive& ar, const unsigned int version)
00085 {
00086     ar  & BOOST_SERIALIZATION_NVP(r)
00087         & BOOST_SERIALIZATION_NVP(g)
00088         & BOOST_SERIALIZATION_NVP(b)
00089         & BOOST_SERIALIZATION_NVP(a);
00090 }
00091 
00092 #endif // _GG_Clr_h_
00093 

Generated on Wed Mar 26 14:35:41 2008 for GG by  doxygen 1.5.2