initial commit
This commit is contained in:
8
include/opengl/handles/alpha_handle.hpp
Normal file
8
include/opengl/handles/alpha_handle.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
|
||||
using alpha_handle = float;
|
||||
|
||||
} // namespace zgl
|
||||
16
include/opengl/handles/material_handle.hpp
Normal file
16
include/opengl/handles/material_handle.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include "opengl/handles/texture_handle.hpp"
|
||||
#include "opengl/handles/surface_properties_handle.hpp"
|
||||
#include "opengl/handles/alpha_handle.hpp"
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
struct material_handle
|
||||
{
|
||||
std::optional<texture_handle> texture{ std::nullopt };
|
||||
std::optional<surface_properties_handle> surface_properties{ std::nullopt };
|
||||
std::optional<alpha_handle> alpha{ std::nullopt };
|
||||
};
|
||||
}
|
||||
12
include/opengl/handles/matrix_handles.hpp
Normal file
12
include/opengl/handles/matrix_handles.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
using model_matrix_handle = glm::mat4x4;
|
||||
|
||||
using view_matrix_handle = glm::mat4x4;
|
||||
|
||||
using projection_matrix_handle = glm::mat4x4;
|
||||
}
|
||||
20
include/opengl/handles/mesh_handle.hpp
Executable file
20
include/opengl/handles/mesh_handle.hpp
Executable file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "GL/glew.h"
|
||||
#include "util/uix.hpp"
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
struct mesh_handle
|
||||
{
|
||||
inline void bind() const;
|
||||
inline static void unbind();
|
||||
|
||||
GLuint vao_id{ 0 };
|
||||
GLsizei index_count{ 0 };
|
||||
};
|
||||
}
|
||||
|
||||
#define INCLUDE_MESH_INSTANCE_IMPLEMENTATION
|
||||
#include "opengl/handles/mesh_handle.ipp"
|
||||
#undef INCLUDE_MESH_INSTANCE_IMPLEMENTATION
|
||||
20
include/opengl/handles/point_cloud_handle.hpp
Executable file
20
include/opengl/handles/point_cloud_handle.hpp
Executable file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "GL/glew.h"
|
||||
#include "util/uix.hpp"
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
struct point_cloud_handle
|
||||
{
|
||||
inline void bind() const;
|
||||
inline static void unbind();
|
||||
|
||||
GLuint vao_id{ 0 };
|
||||
GLsizei point_count{ 0 };
|
||||
};
|
||||
}
|
||||
|
||||
#define INCLUDE_POINT_CLOUD_INSTANCE_IMPLEMENTATION
|
||||
#include "opengl/handles/point_cloud_handle.ipp"
|
||||
#undef INCLUDE_POINT_CLOUD_INSTANCE_IMPLEMENTATION
|
||||
33
include/opengl/handles/shader_program_handle.hpp
Normal file
33
include/opengl/handles/shader_program_handle.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "GL/glew.h"
|
||||
#include "opengl/shader_program_variable.hpp"
|
||||
|
||||
#include "opengl/shader_program_variable.hpp"
|
||||
#include "util/uix.hpp"
|
||||
#include <span>
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
struct shader_program_handle
|
||||
{
|
||||
using attribute_support_type = ztu::u32;
|
||||
using uniform_support_type = ztu::u32;
|
||||
|
||||
inline void bind() const;
|
||||
static void unbind();
|
||||
|
||||
template<shader_program_variable::info_type VariableInfo, typename T>
|
||||
void set_uniform(const T& value) const;
|
||||
|
||||
[[nodiscard]] attribute_support_type check_attribute_support(std::span<const shader_program_variable> attributes) const;
|
||||
|
||||
[[nodiscard]] uniform_support_type check_uniform_support(std::span<const shader_program_variable> uniforms) const;
|
||||
|
||||
GLuint program_id{ 0 };
|
||||
};
|
||||
}
|
||||
|
||||
#define INCLUDE_GL_SHADER_PROGRAM_INSTANCE_IMPLEMENTATION
|
||||
#include "opengl/handles/shader_program_handle.ipp"
|
||||
#undef INCLUDE_GL_SHADER_PROGRAM_INSTANCE_IMPLEMENTATION
|
||||
16
include/opengl/handles/surface_properties_handle.hpp
Normal file
16
include/opengl/handles/surface_properties_handle.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
struct surface_properties_handle
|
||||
{
|
||||
glm::mat3 filters{
|
||||
0.1986f, 0.0000f, 0.0000f,
|
||||
0.5922f, 0.0166f, 0.0000f,
|
||||
0.5974f, 0.2084f, 0.2084f
|
||||
};
|
||||
float shininess{ 100.2237f };
|
||||
};
|
||||
}
|
||||
17
include/opengl/handles/texture_handle.hpp
Normal file
17
include/opengl/handles/texture_handle.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "GL/glew.h"
|
||||
|
||||
namespace zgl {
|
||||
struct texture_handle
|
||||
{
|
||||
inline void bind() const;
|
||||
inline static void unbind();
|
||||
|
||||
GLuint texture_id{ 0 };
|
||||
};
|
||||
}
|
||||
|
||||
#define INCLUDE_TEXTURE_INSTANCE_IMPLEMENTATION
|
||||
#include "opengl/handles/texture_handle.ipp"
|
||||
#undef INCLUDE_TEXTURE_INSTANCE_IMPLEMENTATION
|
||||
Reference in New Issue
Block a user