![]() |
Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
|
#include <SceneFBO.hpp>
Public Member Functions | |
SceneFBO (Application *app, uvec2 const &size) | |
~SceneFBO () | |
void | draw (double time, double timeDelta) |
void | resize (vec2 const &size) |
void | readAllIds (OUT id_t *target) |
void | readIds (OUT id_t *target, uvec2 const center, uint const distance) |
void | bindSceneTexture (GLuint target=0) |
void | bindIdTexture (GLuint target=0) |
Private Attributes | |
Application * | m_app |
GLuint | m_fbo |
GLuint | m_rb |
GLuint | m_texId |
GLuint | m_texScene |
uvec2 | m_size |
SceneFBO is a frame-buffer that holds the scene-buffer (color) and the id-buffer (id_t)
Definition at line 35 of file SceneFBO.hpp.
SceneFBO | ( | Application * | app, |
uvec2 const & | size | ||
) |
Constructs a SceneFBO-object. Creates all OpenGL-resoruces.
app | The global application |
size | The size of the FBO |
Definition at line 4 of file SceneFBO.cpp.
~SceneFBO | ( | ) |
Descruts the SceneFBO-object
Definition at line 48 of file SceneFBO.cpp.
void bindIdTexture | ( | GLuint | target = 0 | ) |
Binds the texture of the id-buffer to the given target.
target | The target to which the texutre will be bound |
Definition at line 148 of file SceneFBO.cpp.
void bindSceneTexture | ( | GLuint | target = 0 | ) |
Binds the texture of the scene-buffer to the given target.
target | The target to which the texutre will be bound |
Definition at line 153 of file SceneFBO.cpp.
void draw | ( | double | time, |
double | timeDelta | ||
) |
Fills the FBO by drawing the scene-graph into it.
time | The absolute frame-time |
timeDelta | The time since the last frame |
Definition at line 56 of file SceneFBO.cpp.
void readAllIds | ( | OUT id_t * | target | ) |
Read the id-buffer to some memory
target | The target memory |
Definition at line 140 of file SceneFBO.cpp.
void readIds | ( | OUT id_t * | target, |
uvec2 const | center, | ||
uint const | distance | ||
) |
Read parts of the id-buffer to some memory. Areas outside the FBO will be set to 0.
target | The target memory |
center | The center around which will be read |
distance | The city-block-distance to the center in which will be read |
Definition at line 107 of file SceneFBO.cpp.
void resize | ( | vec2 const & | size | ) |
Resizes The FBO to the given size.
size | The new size of the FBO |
Definition at line 73 of file SceneFBO.cpp.
|
private |
The global application
Definition at line 37 of file SceneFBO.hpp.
|
private |
The OpenGL-FBO
Definition at line 38 of file SceneFBO.hpp.
|
private |
The OpenGL-Renderbuffer
Definition at line 39 of file SceneFBO.hpp.
|
private |
The FBO-size
Definition at line 42 of file SceneFBO.hpp.
|
private |
The OpenGL-Texture for the id-buffer
Definition at line 40 of file SceneFBO.hpp.
|
private |
The OpenGL-Texture for the scene-buffer
Definition at line 41 of file SceneFBO.hpp.