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

78 lines
2.1 KiB
C++

#ifndef XNA_GRAPHICS_VERTEXPOSITION_HPP
#define XNA_GRAPHICS_VERTEXPOSITION_HPP
#include "../common/numerics.hpp"
#include "../common/color.hpp"
#include "../default.hpp"
namespace xna {
struct VertexPositionColor {
Vector3 position{};
Color color{};
constexpr VertexPositionColor() = default;
constexpr VertexPositionColor(Vector3 const& position, Color const& color):
position(position), color(color){}
constexpr bool operator==(const VertexPositionColor& other) const {
return position == other.position && color == other.color;
}
};
struct VertexPositionTexture {
Vector3 position{};
Vector2 textureCoordinate{};
constexpr VertexPositionTexture() = default;
constexpr bool operator==(const VertexPositionTexture& other) const {
return position == other.position
&& textureCoordinate == other.textureCoordinate;
}
constexpr VertexPositionTexture(const Vector3& position, const Vector2& textureCoordinate)
: position(position), textureCoordinate(textureCoordinate)
{
}
};
struct VertexPositionColorTexture {
Vector3 position{};
Vector2 textureCoodinate{};
Color color{};
constexpr VertexPositionColorTexture() = default;
constexpr bool operator==(const VertexPositionColorTexture& other) const {
return position == other.position
&& textureCoodinate == other.textureCoodinate
&& color == other.color;
}
constexpr VertexPositionColorTexture(const Vector3& position, const Vector2& textureCoodinate, const Color& color)
: position(position), textureCoodinate(textureCoodinate), color(color)
{
}
};
struct VertexPositionNormalTexture {
Vector3 position{};
Vector3 normal{};
Vector2 textureCoodinate{};
constexpr VertexPositionNormalTexture() = default;
bool operator==(const VertexPositionNormalTexture& other) const {
return position == other.position
&& normal == other.normal
&& textureCoodinate == other.textureCoodinate;
}
constexpr VertexPositionNormalTexture(const Vector3& position, const Vector3& normal, const Vector2& textureCoodinate)
: position(position), normal(normal), textureCoodinate(textureCoodinate)
{
}
};
}
#endif