9#include "imgui_impl_glfw.h"
10#include "imgui_impl_opengl3.h"
float m_lastX
Last cursor X position (in pixels).
Definition renderer.h:175
std::vector< Box > m_boxes
Vector of Box.
Definition renderer.h:171
void drawBoxes()
Draws the m_boxes boxes.
Definition renderer.cpp:209
void ImGuiParticleViewerMenu(std::vector< Particle > &particles, ImGuiWindowFlags window_flags)
Render particles viewer ImGui menu.
Definition renderer.cpp:415
double m_runTime
Definition renderer.h:180
Camera m_camera
Definition renderer.h:173
GLUquadric * m_quadric
GLU Utility for rendering quadratic shapes.
Definition renderer.h:172
void initializeGLFW()
Initializes the GLFW library. This method is called by the constructor.
Definition renderer.cpp:28
std::vector< float > m_lastFrameratesBuffer
vector of last framerates values
Definition renderer.h:188
Renderer(const Config &config)
Initialize renderer. This method setup the GLFW library for rendering the scene and the Dear ImGui li...
Definition renderer.cpp:3
double m_scaleFactor
Scale factor applied for rendering.
Definition renderer.h:186
void keyboardCallback(int key, int scancode, int action, int mods)
Define Callback for Keyboard inputs.
Definition renderer.cpp:108
float m_lastY
Last cursor Y position (in pixels).
Definition renderer.h:176
double m_lastFrameTime
GLFW time of the last frame (in seconds).
Definition renderer.h:178
void ImGuiInformationMenu(const Universe &universe, ImGuiWindowFlags window_flags)
Render information ImGui menu.
Definition renderer.cpp:375
void ImGuiControlsMenu(Universe &universe, ImGuiWindowFlags window_flags)
Render control ImGui menu.
Definition renderer.cpp:276
void ImGuiParticleEditorMenu(std::vector< Particle > &particles, ImGuiWindowFlags window_flags)
Render particles editor ImGui menu.
Definition renderer.cpp:430
double m_simulationTimePaused
Definition renderer.h:179
void cursorPosCallback(double xpos, double ypos)
Define Callback for cursor position.
Definition renderer.cpp:97
void renderParticleTrail(const Particle &particle)
Render the trail of the given particle.
Definition renderer.cpp:191
void initializeImPlot()
Initializes the imPlot library. This method is called by the constructor.
Definition renderer.cpp:135
void clear()
Clears the renderer.
Definition renderer.cpp:496
std::array< bool, 1024 > m_keyStates
States of the keys.
Definition renderer.h:182
void renderImGui(Universe &universe)
Render Dear ImGui.
Definition renderer.cpp:249
void initializeImGui()
Initializes the Dear ImGui library. This method is called by the constructor.
Definition renderer.cpp:121
bool isRunning()
Determines if the renderer is running.
Definition renderer.cpp:500
const Config & m_config
Reference to simulation configuration.
Definition renderer.h:170
const double & getRunTime() const
Return the run time.
Definition renderer.h:165
void render(Universe &universe)
Renders the given universe.
Definition renderer.cpp:146
std::vector< float > m_lastFrameratesIndexes
vector of last framerates indexes
Definition renderer.h:189
void toggleSpectatorMode()
Toggle spectator mode. The spectator mode will take into account keyboard and mouse inputs for camera...
Definition renderer.cpp:486
void framebufferSizeCallback(int width, int height)
Define Callback for window framebuffer size. This method is a callback function given to GLFW via glf...
Definition renderer.cpp:85
GLFWwindow * m_window
GLFW window pointer.
Definition renderer.h:169
bool m_isSpectatorMode
Determines if spectator is enable.
Definition renderer.h:184
void swapBuffers()
Call glfwSwapBuffers(m_window).
Definition renderer.cpp:244
~Renderer()
Destroys the renderer.
Definition renderer.cpp:12