VAPOR3 3.9.4
LegacyGL.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include <glm/fwd.hpp>
5#include <vapor/Texture.h>
6
7#ifdef GL_QUADS
8 #define LGL_QUADS GL_QUADS
9#else
10 #define LGL_QUADS 105999
11#endif
12
13namespace VAPoR {
14
15struct GLManager;
16
26
28#pragma pack(push, 4)
29 struct VertexData {
30 float x, y, z;
31 float nx, ny, nz;
32 float r, g, b, a;
33 float s, t;
34 };
35#pragma pack(pop)
36
37 GLManager * _glManager;
38 std::vector<VertexData> _vertices;
39 unsigned int _mode;
40 bool _emulateQuads;
41 bool _firstQuadTriangle;
42 unsigned int _VAO, _VBO;
43 float _nx, _ny, _nz;
44 float _r, _g, _b, _a;
45 float _s, _t;
46 bool _initialized, _insideBeginEndBlock;
47 bool _lightingEnabled, _textureEnabled;
48 float _lightDir[3];
49 Texture2D _emptyTexture;
50
51public:
52 LegacyGL(GLManager *glManager);
54 void Initialize();
55 void Begin(unsigned int mode);
56 void End();
57 void Vertex(glm::vec2);
58 void Vertex(glm::vec3);
59 void Vertex2f(float x, float y);
60 void Vertex3f(float x, float y, float z);
61 void Vertex3fv(const float *v);
62 void Vertex3dv(const double *v);
63 void Normal3f(float x, float y, float z);
64 void Normal3fv(const float *n);
65 void Color(glm::vec3);
66 void Color(glm::vec4);
67 void Color3f(float r, float g, float b);
68 void Color3fv(const float *f);
69 void Color4f(float r, float g, float b, float a);
70 void Color4fv(const float *f);
71 void TexCoord(glm::vec2);
72 void TexCoord2f(float s, float t);
73
76 void LightDirectionfv(const float *f);
79
80 // void PushAttrib(int flag);
81};
82
83} // namespace VAPoR
Replements Legacy OpenGL API using OpenGL Core.
Definition: LegacyGL.h:27
void Vertex(glm::vec2)
void TexCoord2f(float s, float t)
void Begin(unsigned int mode)
void Normal3f(float x, float y, float z)
void Vertex2f(float x, float y)
void Normal3fv(const float *n)
void Vertex(glm::vec3)
void Color4fv(const float *f)
void EnableLighting()
void Vertex3fv(const float *v)
void Vertex3dv(const double *v)
void DisableLighting()
void Color(glm::vec3)
void Color3fv(const float *f)
void EnableTexture()
void Vertex3f(float x, float y, float z)
void Color(glm::vec4)
void Color4f(float r, float g, float b, float a)
void DisableTexture()
void TexCoord(glm::vec2)
void Color3f(float r, float g, float b)
LegacyGL(GLManager *glManager)
void LightDirectionfv(const float *f)
#define RENDER_API
Definition: common.h:78
Contains references to context scope OpenGL data.
Definition: GLManager.h:18