Voxellancer
0.3
A game about voxels in space
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Pages
voxelrenderer.h
1
#pragma once
2
#include <memory>
3
4
#include <glm/glm.hpp>
5
6
#include <glow/ref_ptr.h>
7
8
#include "etc/contextdependant.h"
9
10
11
namespace
glow {
12
class
Texture;
13
class
Program;
14
class
VertexArrayObject;
15
class
Buffer;
16
template
<
typename
T>
17
class
Uniform
;
18
};
19
20
class
Camera
;
21
class
VoxelCluster
;
22
class
VoxelMesh
;
23
24
class
VoxelRenderer
:
public
ContextDependant
{
25
public
:
26
void
prepareDraw(
const
Camera
& camera,
bool
withBorder =
true
);
27
void
draw(
VoxelCluster
& cluster);
28
void
afterDraw();
29
30
bool
prepared();
31
32
static
std::shared_ptr<VoxelRenderer> instance();
33
static
glow::Program* program();
34
static
VoxelMesh
& voxelMesh();
35
36
37
protected
:
38
glow::ref_ptr<glow::Program> m_program;
39
std::unique_ptr<VoxelMesh> m_voxelMesh;
40
bool
m_prepared;
41
42
glow::Uniform<glm::mat4>
* m_modelMatrixUniform;
43
glow::Uniform<float>
* m_emissivenessUniform;
44
45
static
std::weak_ptr<VoxelRenderer> s_instance;
46
47
VoxelRenderer
();
48
void
createAndSetupShaders();
49
virtual
void
beforeContextDestroy()
override
;
50
virtual
void
afterContextRebuild()
override
;
51
};
52
ContextDependant
Definition:
contextdependant.h:7
VoxelCluster
Definition:
voxelcluster.h:21
Camera
Definition:
camera.h:10
VoxelMesh
Definition:
voxelmesh.h:21
glow::Uniform
Definition:
voxelrenderer.h:17
VoxelRenderer
Definition:
voxelrenderer.h:24
src
voxel
voxelrenderer.h
Generated on Sun Mar 30 2014 13:32:32 for Voxellancer by
1.8.6