Newer
Older
ForwardPlusRenderer / include / Mesh.h
#pragma once
#include <stdafx.h>
#include "Texture.h"
#include "Vertex.h"
#include "VulkanRenderer.h"
#include "Buffer/Buffer.h"
namespace fpr
{
class Mesh
{
  vk::DeviceSize m_index_offset;
  uint32_t       m_index_count;
  vk::DeviceSize m_vertex_offset;
  uint32_t       m_vertex_count;
  fpr::Texture*  m_albedo;
  glm::mat4      m_model_matrix;
  uint32_t       m_mesh_index;

  // fpr::Texture*        m_normal;
public:
  Mesh() = delete;
  Mesh(
      uint32_t           mesh_index,
      vk::DeviceSize     index_offset,
      uint32_t           index_count,
      vk::DeviceSize     vertex_offset,
      uint32_t           vertex_count,
      const std::string& diffuse_name);


  [[nodiscard]] uint32_t            GetVertexCount() const FPR_NOEXCEPT;
  [[nodiscard]] uint32_t            GetIndexCount() const FPR_NOEXCEPT;
  [[nodiscard]] vk::DeviceSize      GetIndexOffset() const FPR_NOEXCEPT;
  [[nodiscard]] vk::DeviceSize      GetVertexOffset() const FPR_NOEXCEPT;
  [[nodiscard]] const fpr::Texture* GetTexture() const;
  [[nodiscard]] const glm::mat4&    GetMatrix() const FPR_NOEXCEPT;
  [[nodiscard]] uint32_t            GetMeshIndex() const FPR_NOEXCEPT;
  fpr::Texture*                     CreateTexture(const std::string& name);
  void                              SetModelMatrix(const glm::mat4& new_model_mat) FPR_NOEXCEPT;
};
} // namespace fpr