Files
Z3D/include/assets/data_loaders/obj_loader.hpp
2024-12-22 16:58:40 +01:00

43 lines
956 B
C++
Executable File

#pragma once
#include <filesystem>
#include <system_error>
#include <string_view>
#include "assets/dynamic_data_loaders/dynamic_material_loader.hpp"
#include "assets/dynamic_data_stores/dynamic_mesh_store.hpp"
#include "assets/prefetch_lookup.hpp"
namespace obj_loader_error {
enum class codes {
ok = 0,
obj_cannot_open_file,
obj_malformed_vertex,
obj_malformed_texture_coordinate,
obj_malformed_normal,
obj_malformed_face,
obj_face_index_out_of_range,
obj_unknown_line_begin
};
} // namespace obj_loader_error
struct obj_loader {
static constexpr auto name = std::string_view("obj");
[[nodiscard]] static std::error_code prefetch(
const file_dir_list& paths,
prefetch_queue& queue
);
[[nodiscard]] static std::error_code load(
components::mesh_vertex::flags enabled_components,
dynamic_mesh_buffer& buffer,
const file_dir_list& paths,
prefetch_lookup& id_lookup,
dynamic_data_store& store,
bool pedantic = false
);
};