fixes
This commit is contained in:
83
include/shader_program/attributes/mesh_attributes.hpp
Normal file
83
include/shader_program/attributes/mesh_attributes.hpp
Normal file
@@ -0,0 +1,83 @@
|
||||
#pragma once
|
||||
|
||||
#include "opengl/shader_program_variable.hpp"
|
||||
#include <array>
|
||||
|
||||
namespace shader_program::attributes::mesh
|
||||
{
|
||||
|
||||
enum class flags : int {
|
||||
none = 0,
|
||||
position = 1 << 0,
|
||||
normal = 1 << 1,
|
||||
tex_coord = 1 << 2
|
||||
};
|
||||
|
||||
constexpr inline auto position = zgl::shader_program_variable({ GL_FLOAT_VEC3, 0 }, "vertex_position");
|
||||
constexpr inline auto normal = zgl::shader_program_variable({ GL_FLOAT_VEC3, 1 }, "vertex_normal");
|
||||
constexpr inline auto tex_coord = zgl::shader_program_variable({ GL_FLOAT_VEC2, 2 }, "vertex_tex_coord");
|
||||
|
||||
constexpr inline auto all = std::array{
|
||||
position, normal, tex_coord
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::mesh::flags operator|(
|
||||
const shader_program::attributes::mesh::flags& a, const shader_program::attributes::mesh::flags& b
|
||||
) {
|
||||
return static_cast<shader_program::attributes::mesh::flags>(static_cast<int>(a) | static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::mesh::flags operator&(
|
||||
const shader_program::attributes::mesh::flags& a, const shader_program::attributes::mesh::flags& b
|
||||
) {
|
||||
return static_cast<shader_program::attributes::mesh::flags>(static_cast<int>(a) & static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::mesh::flags operator^(
|
||||
const shader_program::attributes::mesh::flags& a, const shader_program::attributes::mesh::flags& b
|
||||
) {
|
||||
return static_cast<shader_program::attributes::mesh::flags>(static_cast<int>(a) ^ static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::mesh::flags operator~(const shader_program::attributes::mesh::flags& a) {
|
||||
return static_cast<shader_program::attributes::mesh::flags>(~static_cast<int>(a));
|
||||
}
|
||||
|
||||
constexpr shader_program::attributes::mesh::flags& operator|=(shader_program::attributes::mesh::flags& a, const shader_program::attributes::mesh::flags& b) {
|
||||
return a = a | b;
|
||||
}
|
||||
|
||||
constexpr shader_program::attributes::mesh::flags& operator&=(shader_program::attributes::mesh::flags& a, const shader_program::attributes::mesh::flags& b) {
|
||||
return a = a & b;
|
||||
}
|
||||
|
||||
constexpr shader_program::attributes::mesh::flags& operator^=(shader_program::attributes::mesh::flags& a, const shader_program::attributes::mesh::flags& b) {
|
||||
return a = a ^ b;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator<(
|
||||
shader_program::attributes::mesh::flags lhs, shader_program::attributes::mesh::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) < static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator<=(
|
||||
shader_program::attributes::mesh::flags lhs, shader_program::attributes::mesh::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) <= static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator>(
|
||||
shader_program::attributes::mesh::flags lhs, shader_program::attributes::mesh::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) > static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator>=(
|
||||
shader_program::attributes::mesh::flags lhs, shader_program::attributes::mesh::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) >= static_cast<int>(rhs);
|
||||
}
|
||||
84
include/shader_program/attributes/point_cloud_attributes.hpp
Normal file
84
include/shader_program/attributes/point_cloud_attributes.hpp
Normal file
@@ -0,0 +1,84 @@
|
||||
#pragma once
|
||||
|
||||
#include "opengl/shader_program_variable.hpp"
|
||||
#include <array>
|
||||
|
||||
namespace shader_program::attributes::point_cloud
|
||||
{
|
||||
|
||||
enum class flags : int {
|
||||
none = 0,
|
||||
position = 1 << 0,
|
||||
normal = 1 << 1,
|
||||
color = 1 << 2,
|
||||
reflectance = 1 << 3
|
||||
};
|
||||
|
||||
constexpr inline auto position = zgl::shader_program_variable({ GL_FLOAT_VEC3, 0 }, "vertex_position");
|
||||
constexpr inline auto normal = zgl::shader_program_variable({ GL_FLOAT_VEC3, 1 }, "vertex_normal");
|
||||
constexpr inline auto color = zgl::shader_program_variable({ GL_FLOAT_VEC3, 2 }, "vertex_color");
|
||||
constexpr inline auto reflectance = zgl::shader_program_variable({ GL_FLOAT, 2 }, "vertex_reflectance");
|
||||
|
||||
constexpr inline auto all = std::array{
|
||||
position, normal, color, reflectance
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::point_cloud::flags operator|(
|
||||
const shader_program::attributes::point_cloud::flags& a, const shader_program::attributes::point_cloud::flags& b
|
||||
) {
|
||||
return static_cast<shader_program::attributes::point_cloud::flags>(static_cast<int>(a) | static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::point_cloud::flags operator&(
|
||||
const shader_program::attributes::point_cloud::flags& a, const shader_program::attributes::point_cloud::flags& b
|
||||
) {
|
||||
return static_cast<shader_program::attributes::point_cloud::flags>(static_cast<int>(a) & static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::point_cloud::flags operator^(
|
||||
const shader_program::attributes::point_cloud::flags& a, const shader_program::attributes::point_cloud::flags& b
|
||||
) {
|
||||
return static_cast<shader_program::attributes::point_cloud::flags>(static_cast<int>(a) ^ static_cast<int>(b));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr shader_program::attributes::point_cloud::flags operator~(const shader_program::attributes::point_cloud::flags& a) {
|
||||
return static_cast<shader_program::attributes::point_cloud::flags>(~static_cast<int>(a));
|
||||
}
|
||||
|
||||
constexpr shader_program::attributes::point_cloud::flags& operator|=(shader_program::attributes::point_cloud::flags& a, const shader_program::attributes::point_cloud::flags& b) {
|
||||
return a = a | b;
|
||||
}
|
||||
|
||||
constexpr shader_program::attributes::point_cloud::flags& operator&=(shader_program::attributes::point_cloud::flags& a, const shader_program::attributes::point_cloud::flags& b) {
|
||||
return a = a & b;
|
||||
}
|
||||
|
||||
constexpr shader_program::attributes::point_cloud::flags& operator^=(shader_program::attributes::point_cloud::flags& a, const shader_program::attributes::point_cloud::flags& b) {
|
||||
return a = a ^ b;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator<(
|
||||
shader_program::attributes::point_cloud::flags lhs, shader_program::attributes::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) < static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator<=(
|
||||
shader_program::attributes::point_cloud::flags lhs, shader_program::attributes::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) <= static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator>(
|
||||
shader_program::attributes::point_cloud::flags lhs, shader_program::attributes::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) > static_cast<int>(rhs);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool operator>=(
|
||||
shader_program::attributes::point_cloud::flags lhs, shader_program::attributes::point_cloud::flags rhs
|
||||
) {
|
||||
return static_cast<int>(lhs) >= static_cast<int>(rhs);
|
||||
}
|
||||
Reference in New Issue
Block a user