44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "opengl/shader_program_variable.hpp"
|
|
#include <array>
|
|
#include "util/enum_bitfield_operators.hpp"
|
|
#include <string_view>
|
|
|
|
namespace shader_program::attributes::mesh
|
|
{
|
|
|
|
enum class flags : unsigned {
|
|
none = 0,
|
|
position = 1 << 0,
|
|
normal = 1 << 1,
|
|
luminance = 1 << 2,
|
|
color = 1 << 3,
|
|
alpha = 1 << 4,
|
|
tex_coord = 1 << 5
|
|
};
|
|
|
|
constexpr inline auto position = zgl::shader_program_variable({ GL_FLOAT_VEC3, 0 }, "model_vertex_position");
|
|
constexpr inline auto normal = zgl::shader_program_variable({ GL_FLOAT_VEC3, 1 }, "model_vertex_normal");
|
|
constexpr inline auto luminance = zgl::shader_program_variable({ GL_FLOAT, 2 }, "model_vertex_l");
|
|
constexpr inline auto color = zgl::shader_program_variable({ GL_FLOAT_VEC3, 2 }, "model_vertex_rgb");
|
|
constexpr inline auto alpha = zgl::shader_program_variable({ GL_FLOAT, 3 }, "model_vertex_a");
|
|
constexpr inline auto tex_coord = zgl::shader_program_variable({ GL_FLOAT_VEC2, 2 }, "model_vertex_tex_coord");
|
|
|
|
constexpr inline auto all = std::array{
|
|
position, normal, luminance, color, alpha, tex_coord
|
|
};
|
|
|
|
constexpr inline auto names = std::array<std::string_view, 6>{
|
|
"position",
|
|
"normal",
|
|
"luminance",
|
|
"color",
|
|
"alpha",
|
|
"tex_coord"
|
|
};
|
|
|
|
}
|
|
|
|
DEFINE_ENUM_BITFIELD_OPERATORS(shader_program::attributes::mesh::flags)
|