colobot/colobot-base/graphics/core/vertex.h

76 lines
1.9 KiB
C
Raw Normal View History

/*
* This file is part of the Colobot: Gold Edition source code
2023-08-06 21:15:48 +00:00
* Copyright (C) 2001-2023, Daniel Roux, EPSITEC SA & TerranovaTeam
2015-08-22 14:40:02 +00:00
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://gnu.org/licenses
*/
/**
* \file graphics/core/vertex.h
* \brief Vertex structs
*/
2012-06-20 17:34:54 +00:00
#pragma once
#include "graphics/core/color.h"
#include "graphics/core/type.h"
2012-09-19 21:50:28 +00:00
#include <sstream>
#include <cstdint>
2021-06-06 15:03:59 +00:00
#include <glm/glm.hpp>
2012-09-19 21:50:28 +00:00
// Graphics module namespace
2015-08-02 09:40:47 +00:00
namespace Gfx
{
2012-06-20 17:34:54 +00:00
2021-06-06 15:03:59 +00:00
/**
* \struct Vertex2D
* \brief 2D vertex for interface rendering, contains UV and color
*/
struct Vertex2D
{
2021-08-08 11:54:58 +00:00
glm::vec2 position = { 0.0f, 0.0f };
2021-06-06 15:03:59 +00:00
glm::vec2 uv = { 0.0f, 0.0f };
glm::u8vec4 color = { 255, 255, 255, 255 };
};
2012-09-19 21:50:28 +00:00
2021-08-08 11:54:58 +00:00
/**
* \struct Vertex3D
* \brief 3D vertex for 3D rendering, contains UV, color and normal
*/
struct Vertex3D
{
glm::vec3 position = { 0.0f, 0.0f, 0.0f };
glm::u8vec4 color = { 255, 255, 255, 255 };
glm::vec2 uv = { 0.0f, 0.0f };
glm::vec2 uv2 = { 0.0f, 0.0f };
glm::vec3 normal = { 0.0f, 0.0f, 1.0f };
};
/**
* \struct VertexParticle
* \brief 3D vertex for particle rendering, contains color and UV coordinates
*/
struct VertexParticle
{
glm::vec3 position = { 0.0f, 0.0f, 0.0f };
glm::u8vec4 color = { 255, 255, 255, 255 };
glm::vec2 uv = { 0.0f, 0.0f };
};
2021-08-08 11:54:58 +00:00
} // namespace Gfx