tried making naming more uniform and implemented most of the opengl managers
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
namespace viewer
|
||||
{
|
||||
std::error_code asset_loader::init(
|
||||
components::mesh_vertex::flags enabled_mesh_components,
|
||||
mesh_vertex_components::flags enabled_mesh_components,
|
||||
material_component::flags enabled_material_components,
|
||||
components::point_cloud_vertex::flags enabled_point_cloud_components,
|
||||
point_cloud_vertex_components::flags enabled_point_cloud_components,
|
||||
const dynamic_material_data& default_material
|
||||
) {
|
||||
|
||||
@@ -393,8 +393,8 @@ std::error_code asset_loader::create_gl_materials()
|
||||
|
||||
void asset_loader::create_gl_meshes(std::span<const material_reference_entry_type> material_references)
|
||||
{
|
||||
auto component_type_buffer = std::array<GLenum, static_cast<std::size_t>(components::mesh_vertex::count)>{};
|
||||
auto component_length_buffer = std::array<GLint, static_cast<std::size_t>(components::mesh_vertex::count)>{};
|
||||
auto component_type_buffer = std::array<GLenum, static_cast<std::size_t>(mesh_vertex_components::count)>{};
|
||||
auto component_length_buffer = std::array<GLint, static_cast<std::size_t>(mesh_vertex_components::count)>{};
|
||||
|
||||
auto component_stride = GLsizei{};
|
||||
auto component_count = ztu::u32{};
|
||||
@@ -430,7 +430,7 @@ void asset_loader::create_gl_meshes(std::span<const material_reference_entry_typ
|
||||
}
|
||||
|
||||
// Add normals if missing
|
||||
if ((mesh_data.components() & components::mesh_vertex::flags::normal) == components::mesh_vertex::flags::none)
|
||||
if ((mesh_data.components() & mesh_vertex_components::flags::normal) == mesh_vertex_components::flags::none)
|
||||
{
|
||||
ztu::logger::warn("Model is missing normal vectors, so they are estimated!");
|
||||
estimate_normals(
|
||||
@@ -438,11 +438,11 @@ void asset_loader::create_gl_meshes(std::span<const material_reference_entry_typ
|
||||
mesh_data.triangles(),
|
||||
mesh_data.normals()
|
||||
);
|
||||
mesh_data.components() |= components::mesh_vertex::flags::normal;
|
||||
mesh_data.components() |= mesh_vertex_components::flags::normal;
|
||||
}
|
||||
|
||||
auto mesh_box = aabb{};
|
||||
mesh_box.add_points<components::mesh_vertex::normal::value_type>(mesh_data.positions());
|
||||
mesh_box.add_points<mesh_vertex_components::normal::value_type>(mesh_data.positions());
|
||||
|
||||
mesh_data.build_vertex_buffer(
|
||||
m_vertex_buffer,
|
||||
@@ -488,8 +488,8 @@ void asset_loader::create_gl_meshes(std::span<const material_reference_entry_typ
|
||||
|
||||
void asset_loader::create_gl_point_clouds()
|
||||
{
|
||||
auto component_type_buffer = std::array<GLenum, static_cast<std::size_t>(components::point_cloud_vertex::count)>{};
|
||||
auto component_length_buffer = std::array<GLint, static_cast<std::size_t>(components::point_cloud_vertex::count)>{};
|
||||
auto component_type_buffer = std::array<GLenum, static_cast<std::size_t>(point_cloud_vertex_components::count)>{};
|
||||
auto component_length_buffer = std::array<GLint, static_cast<std::size_t>(point_cloud_vertex_components::count)>{};
|
||||
auto component_stride = GLsizei{};
|
||||
auto component_count = ztu::u32{};
|
||||
|
||||
@@ -502,7 +502,7 @@ void asset_loader::create_gl_point_clouds()
|
||||
}
|
||||
|
||||
auto point_cloud_box = aabb{};
|
||||
point_cloud_box.add_points<components::mesh_vertex::normal::value_type>(point_cloud_data.positions());
|
||||
point_cloud_box.add_points<mesh_vertex_components::normal::value_type>(point_cloud_data.positions());
|
||||
|
||||
point_cloud_data.build_vertex_buffer(
|
||||
m_vertex_buffer,
|
||||
|
||||
Reference in New Issue
Block a user