File: Shader.cpp

package info (click to toggle)
mercator 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,008 kB
  • sloc: sh: 10,433; cpp: 4,482; makefile: 115
file content (34 lines) | stat: -rw-r--r-- 902 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// This file may be redistributed and modified only under the terms of
// the GNU General Public License (See COPYING for details).
// Copyright (C) 2003 Alistair Riddoch

#include <Mercator/Shader.h>

#include <Mercator/Segment.h>
#include <Mercator/Surface.h>

namespace Mercator {

/// \brief Protected constructor for classes which inherit from this
/// one.
///
/// Permanently sents the color and alpha flags.
Shader::Shader(bool color, bool alpha) : m_color(color), m_alpha(alpha)
{
}

/// \brief Destructor does nothing interesting.
Shader::~Shader()
{
}

/// \brief Create a new Surface which matches the requirements of this shader.
///
/// Called by terrain when creating a new Segment to add the necessary
/// Surface objects to that Segment.
Surface * Shader::newSurface(const Segment & segment) const
{
    return new Surface(segment, *this, m_color, m_alpha);
}

} // namespace Mercator