CSEngine
Loading...
Searching...
No Matches
RenderInterfaces.h
1#pragma once
2#include <vector>
3#include "../../SObject.h"
4#include "../../Manager/ResMgr.h"
5#include "../Matrix.h"
6#include "GLMeshID.h"
7
8namespace CSE {
9 struct CameraMatrixStruct;
10 class SMaterial;
11 class CameraBase;
12 class RenderMgr;
13
14 class SISurface : public SResource {
15 public:
16
17 SISurface() {
18 SetUndestroyable(true);
19 }
20
21 ~SISurface() override = default;
22
23 virtual int GetVertexCount() const = 0;
24
25 virtual int GetLineIndexCount() const = 0;
26
27 virtual int GetTriangleIndexCount() const = 0;
28
29 virtual void GenerateVertices(std::vector<float>& vertices, unsigned char flags = 0) const = 0;
30
31 virtual void GenerateLineIndices(std::vector<unsigned short>& indices) const = 0;
32
33 virtual void GenerateTriangleIndices(std::vector<unsigned short>& indices) const = 0;
34
35 public:
36 mutable GLMeshID m_meshId;
37 };
38
39 class SIRender {
40 public:
41 SIRender() = default;
42
43 virtual ~SIRender() = default;
44
45 virtual void
46 SetMatrix(const CameraMatrixStruct& cameraMatrixStruct,
47 const GLProgramHandle* handle) = 0;
48
49 virtual void Render(const GLProgramHandle* handle) const = 0;
50
51 virtual SMaterial* GetMaterial() const = 0;
52
53 SMaterial* GetMaterialReference() const {
54 return material;
55 }
56
57 protected:
58 SMaterial* material = nullptr;
59 public:
60 bool isRenderActive = false;
61 };
62}