Mercator
Shader.h
00001 // This file may be redistributed and modified only under the terms of
00002 // the GNU General Public License (See COPYING for details).
00003 // Copyright (C) 2003 Alistair Riddoch
00004 
00005 #ifndef MERCATOR_SHADER_H
00006 #define MERCATOR_SHADER_H
00007 
00008 #include <string>
00009 #include <map>
00010 
00011 namespace Mercator {
00012 
00013 class Surface;
00014 class Segment;
00015 
00016 // FIXME - PLACEHOLDER
00017 // This class itereates over the buffer in a segment using the data it contains
00018 // to populate a RGBA colour buffer based on the terrain height data. ie it is
00019 // used to define the texture blending for a given surface
00020 
00029 class Shader {
00030   private:
00032     const bool m_color;
00034     const bool m_alpha;
00035   protected:
00036     explicit Shader(bool color = false, bool alpha = true);
00037   public:
00038     virtual ~Shader();
00039 
00041     bool getColor() const {
00042         return m_color;
00043     }
00044 
00046     bool getAlpha() const {
00047         return m_alpha;
00048     }
00049 
00050     Surface * newSurface(const Segment &) const;
00051 
00057     virtual bool checkIntersect(const Segment &) const = 0;
00058 
00060     virtual void shade(Surface &) const = 0;
00061 
00063     typedef std::map<std::string, float> Parameters;
00064 };
00065 
00066 } // namespace Mercator
00067 
00068 #endif // MERCATOR_SHADER_H