Mercator
Surface.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU General Public License (See COPYING for details).
3 // Copyright (C) 2003 Alistair Riddoch
4 
5 #ifndef MERCATOR_SURFACE_H
6 #define MERCATOR_SURFACE_H
7 
8 #include <Mercator/Buffer.h>
9 
10 #include <climits>
11 
12 namespace Mercator {
13 
14 class Shader;
15 
16 typedef unsigned char ColorT;
17 
18 static const ColorT colorMax = UCHAR_MAX;
19 static const ColorT colorMin = 0;
20 
22 class Surface : public Buffer<ColorT> {
23  public:
25  const Shader & m_shader;
26 
27  explicit Surface(const Segment & segment, const Shader & shader,
28  bool colors = true, bool alpha = true);
29  virtual ~Surface();
30 
31  void populate();
32  // Do we need an accessor presenting the array in colour form?
33 };
34 
35 } // namespace Mercator
36 
37 #endif // MERCATOR_SURFACE_H
Template for managing buffers of data for a segment.
Definition: Buffer.h:14
Definition: Area.cpp:20
Data store for terrain surface data.
Definition: Surface.h:22
void populate()
Populate the data buffer using the correct shader.
Definition: Surface.cpp:30
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:36
Base class for Shader objects which create surface data for use when rendering terrain.
Definition: Shader.h:29
const Shader & m_shader
The shader that populates this surface.
Definition: Surface.h:25
Surface(const Segment &segment, const Shader &shader, bool colors=true, bool alpha=true)
Constructor.
Definition: Surface.cpp:18