matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
|
Implements basic drawing methods that the core::App implementation uses. More...
#include <GraphicsController.hpp>
Public Member Functions | |
std::string_view | name () const override |
void | begin_gui () |
Calls internal methods for the beginning of gui drawing. Should be called in pair with GraphicsController::end_gui. | |
void | end_gui () |
Calls internal method for the ending of gui drawing. Should be called in pair with GraphicsController::begin_gui. | |
void | draw_skybox (const resources::Shader *shader, const resources::Skybox *skybox) |
Draws a resources::Skybox with the resources::Shader. | |
Camera * | camera () |
template<ProjectionType type = Perspective> | |
glm::mat4 | projection_matrix () const |
Compute the projection matrix. | |
glm::mat4 | projection_matrix (ProjectionType type=Perspective) const |
Compute the projection matrix. | |
PerspectiveMatrixParams & | perspective_params () |
Use this function to change the perspective projection matrix parameters. Projection matrix is always computed when the GraphicsController::projection_matrix is called. | |
const PerspectiveMatrixParams & | perspective_params () const |
Get the current PerspectiveMatrixParams values. | |
OrthographicMatrixParams & | orthographic_params () |
Use this function to change the orthographic projection matrix parameters. Projection matrix is always computed when GraphicsController::projection_matrix is called. | |
const OrthographicMatrixParams & | orthographic_params () const |
Get the current OrthographicMatrixParams values. | |
Public Member Functions inherited from engine::core::Controller | |
virtual | ~Controller ()=default |
void | before (Controller *next) |
void | after (Controller *prev) |
const std::vector< Controller * > & | next () const |
bool | is_enabled () const |
Controller will execute as long this function returns true. | |
void | set_enable (bool value) |
Enables or disables the controller based on value. The ControllerManager executes only the enabled controllers, except for the Controller::poll_events function, that's executed always. By default, controllers are enabled when registered. | |
Private Member Functions | |
void | initialize () override |
Initializes OpenGL, ImGUI, and projection matrix params;. | |
void | terminate () |
Terminate the controller. Executes in the core::App::terminate. | |
Private Attributes | |
PerspectiveMatrixParams | m_perspective_params {} |
OrthographicMatrixParams | m_ortho_params {} |
glm::mat4 | m_projection_matrix {} |
Camera | m_camera {} |
ImGuiContext * | m_imgui_context {} |
Additional Inherited Members | |
Static Public Member Functions inherited from engine::core::Controller | |
template<typename TController > | |
static TController * | get (std::source_location location=std::source_location::current()) |
Serves as a single access point for all the Controller types throughout the code base. Make sure to register the controller via App::register_controller before calling this function. | |
Implements basic drawing methods that the core::App implementation uses.
This class should implement all the complex functions needed for drawing an entity in the scene. For example GraphicsController::draw_skybox.
|
overridevirtual |
Returns the controller class name; used for logging.
Reimplemented from engine::core::Controller.
void engine::graphics::GraphicsController::begin_gui | ( | ) |
Calls internal methods for the beginning of gui drawing. Should be called in pair with GraphicsController::end_gui.
Example:
void engine::graphics::GraphicsController::end_gui | ( | ) |
Calls internal method for the ending of gui drawing. Should be called in pair with GraphicsController::begin_gui.
void engine::graphics::GraphicsController::draw_skybox | ( | const resources::Shader * | shader, |
const resources::Skybox * | skybox | ||
) |
Draws a resources::Skybox with the resources::Shader.
|
inline |
|
inline |
Compute the projection matrix.
|
inline |
Compute the projection matrix.
|
inline |
Use this function to change the perspective projection matrix parameters. Projection matrix is always computed when the GraphicsController::projection_matrix is called.
|
inline |
Get the current PerspectiveMatrixParams values.
|
inline |
Use this function to change the orthographic projection matrix parameters. Projection matrix is always computed when GraphicsController::projection_matrix is called.
|
inline |
Get the current OrthographicMatrixParams values.
|
overrideprivatevirtual |
Initializes OpenGL, ImGUI, and projection matrix params;.
Reimplemented from engine::core::Controller.
|
privatevirtual |
Terminate the controller. Executes in the core::App::terminate.
Note that the terminate
executes in the reverse order from initialize.
Reimplemented from engine::core::Controller.
|
private |
|
private |
|
private |
|
private |
|
private |