mercator 0.4.0
A terrain generation library for the Worldforge system.
Shader.cpp
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#include "Shader.h"
6
7#include "Segment.h"
8#include "Surface.h"
9
10namespace Mercator {
11
16Shader::Shader(bool color, bool alpha) : m_color(color), m_alpha(alpha)
17{
18}
19
21Shader::~Shader() = default;
22
27std::unique_ptr<Surface> Shader::newSurface(const Segment & segment) const
28{
29 return std::make_unique<Surface>(segment, *this, m_color, m_alpha);
30}
31
32} // namespace Mercator
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:37
Shader(bool color=false, bool alpha=true)
Protected constructor for classes which inherit from this one.
Definition: Shader.cpp:16
virtual ~Shader()
Destructor does nothing interesting.
std::unique_ptr< Surface > newSurface(const Segment &) const
Create a new Surface which matches the requirements of this shader.
Definition: Shader.cpp:27