Newer
Older
ForwardPlusRenderer / include / Model.h
#pragma once
#include <stdafx.h>
#include "Mesh.h"

namespace fpr
{
struct ModelPrimitives
{
  std::vector<Vertex>    vertices;
  std::vector<uint32_t>  indices;
  std::vector<fpr::Mesh> meshes;
};

class Model
{
  ModelPrimitives m_primitives;
  fpr::Buffer     m_index_buffer;
  fpr::Buffer     m_vertex_buffer;
  glm::mat4       m_model_matrix;
public:
  Model() = default;
  Model(const char* file_name, glm::mat4 model_matrix = glm::mat4(1.0f));
  [[nodiscard]] const std::vector<Mesh>& GetMeshes() FPR_NOEXCEPT;
  [[nodiscard]] fpr::Buffer&             GetVertexBuffer();
  [[nodiscard]] fpr::Buffer&             GetIndexBuffer();
};


} // namespace fpr