Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Dynamic.h
Go to the documentation of this file.
1#pragma once
2#include "TVertexArray.h"
3#include "misc/gen/TClosure.h"
4
5#include <xgl/global.h>
6
7namespace sf::xgl
8{
9
13class _XGL_CLASS Dynamic final : public TVertexArray<VertexArrayBase::vmPosition | VertexArrayBase::vmNormal>
14{
15 public:
16 // Use the constructors from the base class.
17 using TVertexArray::TVertexArray;
18
25 void addVertex(const vector3f& position, const vector3f& normal, const Color& color);
26
34 void beginMode(GLenum mode, const Matrix& matrix, const Color& color, CullingState culling);
35
39 void endMode();
40
42
43 void setCallback(const Callback& closure);
44
45 protected:
49 void generate() override;
50
52};
53
54}// namespace sf::xgl
Encapsulates the std::function() template.
Definition TClosure.h:14
Color class used in vertex arrays and has layout of 4 x GLfloat.
Definition Color.h:15
Dynamic object .
Definition Dynamic.h:14
TClosure< void, VertexArrayBase * > Callback
Definition Dynamic.h:41
Callback _callback
Definition Dynamic.h:51
void setCallback(const Callback &closure)
void generate() override
Overridden from base class.
void beginMode(GLenum mode, const Matrix &matrix, const Color &color, CullingState culling)
Adds an entry the modes list.
void addVertex(const vector3f &position, const vector3f &normal, const Color &color)
Adds a vertex to the vertices array.
void endMode()
Completes the openend modes list entry setting the stop value.
A 4x4 matrix class used in arrays and has layout of 16x GLfloat.
Definition Matrix.h:15
OpenGL base class and wrapper template for vertex arrays. Automates most of the things needed for pri...
Definition TVertexArray.h:20
Definition DemoRenderer.h:6
QFlags< ECullingFlag > CullingState
Type to contain bitmapped culling settings.
Definition Types.h:61
std::array< GLfloat, 3 > vector3f
Type which correspond with a GLSL type and used to implement Vertex structures.
Definition Types.h:21
#define _XGL_CLASS
Definition xgl/global.h:35