AnimEngine
RenderSystem.hpp
1 #pragma once
2 #ifndef KJY_ANIM_ENGINE_RENDER_SYSTEM_HPP_
3 #define KJY_ANIM_ENGINE_RENDER_SYSTEM_HPP_
4 #include "SystemInterface.hpp"
5 #include "util/ShaderLibrary.hpp"
6 #define GLFW_INCLUDE_NONE
7 #include <GLFW/glfw3.h>
8 
9 
10 class Render_System : public SystemInterface{ // Unusual name formatting to indicate singleton
11  public:
12  static Render_System& getInstance() {
13  static Render_System _instance_;
14  return(_instance_);
15  }
16 
17  virtual void init(GLFWwindow* window);
18  virtual void process(Scene& scene);
19  virtual void processEntity(Scene& scene, const MVPset& MVP, Entity* entity, Program* shader = nullptr);
20 
21  virtual void processPanels(Scene& scene, vector<unsigned int> alphaMaps, unsigned int panelOutline, int frameCount);
22  virtual void processEntityPanels(Scene& scene, const MVPset& MVP, Entity* entity, int alphaMapIdx, Program* shader = nullptr);
23  virtual glm::ivec2 getRenderDimensions() const;
24  virtual void setPanelParams(int alphaMapIdx);
25  virtual void drawPigSpider(Scene& scene, const MVPset& MVP, Entity* entity, int i);
26  virtual void processPigSpider(Scene& scene, const MVPset& MVP, Entity* entity, int i);
27 
28  virtual void enableIgnoreGloballyIlluminated() {mSkipGiEntities = true;}
29  virtual void disableIgnoreGloballyIlluminated() {mSkipGiEntities = false;}
30 
31  static Pose getFinalWorldPose(Entity* entity);
32  static void drawAxes(MVPset MVP);
33  static void drawAxes(const Pose& pose, const glm::mat4& V, const glm::mat4& P);
34 
35  static void changeViewport(int x1, int y1, int x2, int y2);
36  static void onResize(GLFWwindow* window, int width, int height);
37  static int getWidth() { return w_width; };
38  static int getHeight() { return w_height; };
39 
40 protected:
41  Render_System() {}
42  GLFWwindow* _mWindow = nullptr;
43 
44  private:
45  static int w_width;
46  static int w_height;
47  Entity* backupEntity;
48 
49  bool mSkipGiEntities = false;
50 
51  // for panel scenes
52  vector<unsigned int> alphaMaps;
53  unsigned int panelOutline;
54  int frameCount;
55 
56 };
57 
58 #endif
Definition: Program.h:15
Definition: drawable.hpp:8
Definition: RenderSystem.hpp:10
Definition: EntitiesBase.hpp:18
Definition: SystemInterface.hpp:6
Definition: Scene.hpp:12
Definition: Pose.hpp:11