|
Mercator
|
Data store for terrain surface data. More...
#include <Surface.h>
Public Member Functions | |
| Surface (const Segment &segment, const Shader &shader, bool colors=true, bool alpha=true) | |
| Constructor. More... | |
| void | populate () |
| Populate the data buffer using the correct shader. More... | |
Public Member Functions inherited from Mercator::Buffer< ColorT > | |
| Buffer (const Segment &segment, unsigned int channels=4) | |
| Constructor. More... | |
| ColorT & | operator() (unsigned int x, unsigned int y, unsigned int channel) |
| Retrieve the data value at a given point. More... | |
| const ColorT & | operator() (unsigned int x, unsigned int y, unsigned int channel) const |
| Retrieve the data value at a given point. More... | |
| const Segment & | getSegment () const |
| Accessor for the terrain height segment this buffer is associated with. | |
| unsigned int | getSize () const |
| Accessor for the size of segment, m_res + 1. | |
| unsigned int | getChannels () const |
| Accessor for the number of data values per height point. | |
| ColorT * | getData () |
| Accessor for a pointer to buffer containing data values. | |
| void | allocate () |
| Allocate the storage required by the buffer. More... | |
| bool | isValid () const |
| Determine if this buffer has valid allocated storage. More... | |
| void | invalidate () |
| De-allocate the storage for this buffer. More... | |
Public Attributes | |
| const Shader & | m_shader |
| The shader that populates this surface. | |
Public Attributes inherited from Mercator::Buffer< ColorT > | |
| const Segment & | m_segment |
| The terrain height segment this buffer is associated with. | |
Data store for terrain surface data.
|
explicit |
Constructor.
| seg | the terrain height segment this surface maps on to. |
| sh | the shader used to generate the surface data. |
| color | true if this shader contains color data. |
| alpha | true if this shader contains alpha data. |
| void Mercator::Surface::populate | ( | ) |
Populate the data buffer using the correct shader.
Call the shader to full this surface buffer with surface data.
References Mercator::Buffer< ColorT >::allocate(), Mercator::Buffer< ColorT >::isValid(), m_shader, and Mercator::Shader::shade().
Referenced by Mercator::TileShader::shade().
1.8.15