diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-01 22:59:22 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-01 22:59:22 +0200 |
commit | d9c5a439d09211ec210195709d275596c6c3c9ba (patch) | |
tree | b536721f8ac5f42649345eeb836259bbf6a887e3 /src/graphics/common/vertex.h | |
parent | 9bd4ec03b272e7925b11c3efc2bd8460894ea589 (diff) | |
download | colobot-d9c5a439d09211ec210195709d275596c6c3c9ba.tar.gz colobot-d9c5a439d09211ec210195709d275596c6c3c9ba.tar.bz2 colobot-d9c5a439d09211ec210195709d275596c6c3c9ba.zip |
CGLDevice implementation
- extended Gfx::CDevice interface
- written OpenGL implementation in Gfx::CGLDevice
- rewrote color and light module
- added Gfx::VertexCol
- added array casts to Math::Vector, Math::Matrix and Gfx::Color
Diffstat (limited to 'src/graphics/common/vertex.h')
-rw-r--r-- | src/graphics/common/vertex.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/graphics/common/vertex.h b/src/graphics/common/vertex.h index 0cc6402..430c84c 100644 --- a/src/graphics/common/vertex.h +++ b/src/graphics/common/vertex.h @@ -19,6 +19,7 @@ #pragma once +#include "graphics/common/color.h" #include "math/vector.h" #include "math/point.h" @@ -48,21 +49,51 @@ struct Vertex }; /** + * \struct VertexCol + * \brief Vertex with color information + * + * This structure was created as analog to DirectX's D3DLVERTEX. + * + * It contains: + * - vertex coordinates (x,y,z) as Math::Vector, + * - RGBA color as Gfx::Color, + * - RGBA specular color as Gfx::Color, + * - texture coordinates (u,v) as Math::Point. + */ +struct VertexCol +{ + Math::Vector coord; + Gfx::Color color; + Gfx::Color specular; + Math::Point texCoord; + + VertexCol(Math::Vector aCoord = Math::Vector(), + Gfx::Color aColor = Gfx::Color(), + Gfx::Color aSpecular = Gfx::Color(), + Math::Point aTexCoord = Math::Point()) + : coord(aCoord), color(aColor), specular(aSpecular), texCoord(aTexCoord) {} +}; + + +/** * \struct VertexTex2 * \brief Vertex with secondary texture coordinates * * In addition to fields from Gfx::Vector, it contains * secondary texture coordinates (u2, v2) as Math::Point */ -struct VertexTex2 : public Gfx::Vertex +struct VertexTex2 { + Math::Vector coord; + Math::Vector normal; + Math::Point texCoord; Math::Point texCoord2; VertexTex2(Math::Vector aCoord = Math::Vector(), Math::Vector aNormal = Math::Vector(), Math::Point aTexCoord = Math::Point(), Math::Point aTexCoord2 = Math::Point()) - : Vertex(aCoord, aNormal, aTexCoord), texCoord2(aTexCoord2) {} + : coord(aCoord), normal(aNormal), texCoord(aTexCoord), texCoord2(aTexCoord2) {} }; }; // namespace Gfx |