Debian Codegraph @

include/iobjectrenderer.h

raw
1 #pragma once
2
3 #include <set>
4 #include <vector>
5 #include "igl.h"
6 #include "igeometrystore.h"
7
8 namespace render
9 {
10
11 class IRenderableObject;
12
13 /**
14 * An IObjectRenderer issues the openGL draw calls to render
15 * the specified geometry in the attached IGeometryStore.
16 */
17 class IObjectRenderer
18 {
19 public:
20 virtual ~IObjectRenderer() {}
21
22 // Sets up the renderer. Must be called before submitting any geometry
23 virtual void initAttributePointers() = 0;
24
25 // Draws the given object, sets up transform and submits geometry
26 virtual void submitObject(IRenderableObject& object) = 0;
27
28 // Draws the geometry of the given slot in the given primitive mode, no transforms
29 virtual void submitGeometry(IGeometryStore::Slot slot, GLenum primitiveMode) = 0;
30
31 // Draws the specified number of instances of the geometry of the given slot in the given primitive mode, no transforms
32 virtual void submitInstancedGeometry(IGeometryStore::Slot slot, int numInstances, GLenum primitiveMode) = 0;
33
34 // Draws all geometry as defined by their store IDs in the given mode, no transforms (std::set variant)
35 virtual void submitGeometry(const std::set<IGeometryStore::Slot>& slots, GLenum primitiveMode) = 0;
36
37 // Draws all geometry as defined by their store IDs in the given mode, no transforms (std::vector variant)
38 virtual void submitGeometry(const std::vector<IGeometryStore::Slot>& slots, GLenum primitiveMode) = 0;
39
40 // Draws all geometry as defined by their store IDs in the given mode, no transforms (std::vector variant)
41 virtual void submitInstancedGeometry(const std::vector<IGeometryStore::Slot>& slots, int numInstances, GLenum primitiveMode) = 0;
42
43 // Draws the geometry with a custom set of indices
44 virtual void submitGeometryWithCustomIndices(IGeometryStore::Slot slot, GLenum primitiveMode,
45 const std::vector<unsigned int>& indices) = 0;
46 };
47
48 }