1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/includes/xna/graphics/vertexposition.hpp

81 lines
2.5 KiB
C++
Raw Permalink Normal View History

2024-04-11 10:38:56 -03:00
#ifndef XNA_GRAPHICS_VERTEXPOSITION_HPP
#define XNA_GRAPHICS_VERTEXPOSITION_HPP
2024-05-18 16:22:00 -03:00
#include "../common/numerics.hpp"
2024-04-11 10:38:56 -03:00
#include "../common/color.hpp"
namespace xna {
2024-08-05 17:52:51 -03:00
//Describes a custom vertex format structure that contains position and color information.
2024-04-11 10:38:56 -03:00
struct VertexPositionColor {
2024-08-05 17:52:51 -03:00
Vector3 Position{};
xna::Color Color{};
2024-04-11 10:38:56 -03:00
constexpr VertexPositionColor() = default;
2024-08-05 17:52:51 -03:00
constexpr VertexPositionColor(Vector3 const& position, xna::Color const& color):
Position(position), Color(color){}
2024-04-11 10:38:56 -03:00
constexpr bool operator==(const VertexPositionColor& other) const {
2024-08-05 17:52:51 -03:00
return Position == other.Position && Color == other.Color;
2024-04-11 10:38:56 -03:00
}
};
2024-08-05 17:52:51 -03:00
//Describes a custom vertex format structure that contains position and one set of texture coordinates.
2024-04-11 10:38:56 -03:00
struct VertexPositionTexture {
2024-08-05 17:52:51 -03:00
Vector3 Position{};
Vector2 TextureCoordinate{};
2024-04-11 10:38:56 -03:00
constexpr VertexPositionTexture() = default;
constexpr bool operator==(const VertexPositionTexture& other) const {
2024-08-05 17:52:51 -03:00
return Position == other.Position
&& TextureCoordinate == other.TextureCoordinate;
2024-04-11 10:38:56 -03:00
}
2024-05-23 16:50:41 -03:00
constexpr VertexPositionTexture(const Vector3& position, const Vector2& textureCoordinate)
2024-08-05 17:52:51 -03:00
: Position(position), TextureCoordinate(textureCoordinate)
{
}
2024-04-11 10:38:56 -03:00
};
2024-08-05 17:52:51 -03:00
//Describes a custom vertex format structure that contains position, color, and one set of texture coordinates.
2024-04-11 10:38:56 -03:00
struct VertexPositionColorTexture {
2024-08-05 17:52:51 -03:00
Vector3 Position{};
Vector2 TextureCoodinate{};
xna::Color Color{};
2024-04-11 10:38:56 -03:00
constexpr VertexPositionColorTexture() = default;
constexpr bool operator==(const VertexPositionColorTexture& other) const {
2024-08-05 17:52:51 -03:00
return Position == other.Position
&& TextureCoodinate == other.TextureCoodinate
&& Color == other.Color;
2024-04-11 10:38:56 -03:00
}
2024-08-05 17:52:51 -03:00
constexpr VertexPositionColorTexture(const Vector3& position, const Vector2& textureCoodinate, const xna::Color& color)
: Position(position), TextureCoodinate(textureCoodinate), Color(color)
{
}
2024-04-11 10:38:56 -03:00
};
2024-08-05 17:52:51 -03:00
//Describes a custom vertex format structure that contains position, normal data, and one set of texture coordinates.
2024-04-11 10:38:56 -03:00
struct VertexPositionNormalTexture {
2024-08-05 17:52:51 -03:00
Vector3 Position{};
Vector3 Normal{};
Vector2 TextureCoodinate{};
2024-04-11 10:38:56 -03:00
constexpr VertexPositionNormalTexture() = default;
bool operator==(const VertexPositionNormalTexture& other) const {
2024-08-05 17:52:51 -03:00
return Position == other.Position
&& Normal == other.Normal
&& TextureCoodinate == other.TextureCoodinate;
2024-04-11 10:38:56 -03:00
}
2024-05-23 16:50:41 -03:00
constexpr VertexPositionNormalTexture(const Vector3& position, const Vector3& normal, const Vector2& textureCoodinate)
2024-08-05 17:52:51 -03:00
: Position(position), Normal(normal), TextureCoodinate(textureCoodinate)
{
}
2024-04-11 10:38:56 -03:00
};
}
#endif