1 #ifndef GRAPHICS_SYSTEM_H
2 #define GRAPHICS_SYSTEM_H
10 #include <OpenGL/gl3.h>
14 #define GLFW_INCLUDE_GLCOREARB
15 #include <GLFW/glfw3.h>
16 #include <glm/glm.hpp>
29 std::shared_ptr<Light> light;
31 friend bool operator<(
const RankedLight& left,
const RankedLight& right) {
32 return left.influence < right.influence;
41 std::string window_title;
43 std::map<int, std::shared_ptr<Graphics::Renderable>> renderables_map;
45 std::list<std::shared_ptr<Light>> lights;
46 unsigned int max_influence_lights;
51 static void errorCallback(
int error,
const char* description);
52 static void windowSizeCallback(GLFWwindow* window,
int width,
int height);
145 int addRenderable(std::shared_ptr<Graphics::Renderable> renderable);
181 void addLight(std::shared_ptr<Light> light) noexcept;
Definition: window_exit_functor.h:7
int renderablesCount()
Returns the number of renderables currently in the system.
Definition: graphics_system.cpp:139
int addRenderable(std::shared_ptr< Graphics::Renderable > renderable)
Adds a renderable to the renderable pool.
Definition: graphics_system.cpp:120
unsigned int getMaxInfluenceLights() const noexcept
Gets the maximum number of influencing lights.
Definition: graphics_system.cpp:220
void startRender()
Starts a render.
Definition: graphics_system.cpp:150
void setWindowName(const std::string &name)
Sets the window name.
Definition: graphics_system.cpp:116
void setMaxInfluenceLights(const unsigned int number) noexcept
Sets the maximum number influencing lights.
Definition: graphics_system.cpp:216
void removeLight(std::shared_ptr< Light > light)
Removes a light.
Definition: graphics_system.cpp:228
void stopRender()
Stops a render.
bool isRunning() noexcept
Determines if running.
Definition: graphics_system.cpp:86
void initialize(const int width, const int height, std::string name, const bool fullscreen, const WindowExitFunctor &window_exit)
Initializes the graphics system.
Definition: graphics_system.cpp:30
int windowWidth()
Getter for the window height.
Definition: graphics_system.cpp:90
bool isInitialized() const noexcept
Getter to see if system is initialized.
Definition: graphics_system.cpp:82
void stopFrame()
Stops a frame.
Definition: graphics_system.cpp:193
std::string windowName() const noexcept
Getter for the window name.
Definition: graphics_system.cpp:110
Class for graphics system.
Definition: graphics_system.h:26
void startFrame()
Starts a frame.
Definition: graphics_system.cpp:161
~GraphicsSystem()
Definition: graphics_system.cpp:24
void addLight(std::shared_ptr< Light > light) noexcept
Adds a light.
Definition: graphics_system.cpp:224
int windowHeight()
Getter for the window width.
Definition: graphics_system.cpp:100
GLFWwindow * getWindow() const noexcept
Gets the window.
Definition: graphics_system.cpp:197
bool removeRenderable(const int id)
Removes a renderable from the renderable pool.
Definition: graphics_system.cpp:127
void destroy()
Closes window, and destroys GLFW context.
Definition: graphics_system.cpp:232
GLFWwindow * getCurrentWindow() noexcept
Definition: graphics_system.cpp:146
GraphicsSystem()
Definition: graphics_system.cpp:21