feat: friend class with renderer + accept render count
This commit is contained in:
@ -8,6 +8,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "shader.h"
|
#include "shader.h"
|
||||||
|
#include "renderer/renderer.h"
|
||||||
#include "renderer/material.h"
|
#include "renderer/material.h"
|
||||||
#include "renderer/mesh.h"
|
#include "renderer/mesh.h"
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ enum ObjElement { OHASH, MTLLIB, USEMTL, O, V, VN, VT, F, OUNKNOWN };
|
|||||||
enum MtlElement { MHASH, NEWMTL, NS, KA, KS, KD, NI, D, ILLUM, MAP_KD, MAP_KA, MUNKNOWN };
|
enum MtlElement { MHASH, NEWMTL, NS, KA, KS, KD, NI, D, ILLUM, MAP_KD, MAP_KA, MUNKNOWN };
|
||||||
|
|
||||||
class Object {
|
class Object {
|
||||||
|
friend class Renderer;
|
||||||
private:
|
private:
|
||||||
static inline int NormalizeIndex(int idx, int baseCount);
|
static inline int NormalizeIndex(int idx, int baseCount);
|
||||||
|
|
||||||
@ -34,8 +36,10 @@ private:
|
|||||||
Mesh& GetLastMesh();
|
Mesh& GetLastMesh();
|
||||||
void CreateNewMesh(const std::string& materialName);
|
void CreateNewMesh(const std::string& materialName);
|
||||||
public:
|
public:
|
||||||
void Render(Shader& shader);
|
void Render(Shader& shader, unsigned int count);
|
||||||
[[nodiscard]] inline const std::string Name() const { return m_name; }
|
[[nodiscard]] inline const std::string Name() const { return m_name; }
|
||||||
|
protected:
|
||||||
|
void EnableBatch(unsigned int instanceVBO);
|
||||||
private:
|
private:
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::vector<glm::vec3> m_vertices;
|
std::vector<glm::vec3> m_vertices;
|
||||||
|
Reference in New Issue
Block a user