Combined view-projection matrix, defining a 2D perspective to render from.
More...
#include <GREM/graphics_2d/Camera2D.hpp>
Combined view-projection matrix, defining a 2D perspective to render from.
◆ ParameterBuffer
Shader buffer for 2D camera parameters.
◆ Camera2D()
Construct a camera.
- Parameters
-
| device | device to create the camera for. Must outlive the camera. |
| projection | projection matrix or configuration options for the camera projection, see Projection2D. |
| view | view matrix or configuration options for the camera view, see View2D. |
| options | camera options, see Camera3DOptions. |
- Exceptions
-
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
◆ setProjection()
| void grem::graphics::Camera2D::setProjection |
( |
const Projection2D & | newProjection | ) |
|
|
inline |
Set the projection of the camera.
- Parameters
-
| newProjection | new projection matrix or configuration options for the camera projection, see Projection2D. |
- Exceptions
-
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
◆ setView()
| void grem::graphics::Camera2D::setView |
( |
const View2D & | newView | ) |
|
|
inline |
Set the view of the camera.
- Parameters
-
| newView | new view matrix or configuration options for the camera view, see View2D. |
- Exceptions
-
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
◆ setOptions()
| void grem::graphics::Camera2D::setOptions |
( |
const Camera2DOptions & | newOptions | ) |
|
|
inline |
Set the configuration options of the camera.
- Parameters
-
- Exceptions
-
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
◆ setProjectionAndView()
| void grem::graphics::Camera2D::setProjectionAndView |
( |
const Projection2D & | newProjection, |
|
|
const View2D & | newView ) |
|
inline |
Set both the projection and view of the camera.
- Parameters
-
| newProjection | new projection matrix or configuration options for the camera projection, see Projection2D. |
| newView | new view matrix or configuration options for the camera view, see View2D. |
- Exceptions
-
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
◆ setViewAndOptions()
| void grem::graphics::Camera2D::setViewAndOptions |
( |
const View2D & | newView, |
|
|
const Camera2DOptions & | newOptions ) |
|
inline |
Set both the view and configuration options of the camera.
- Parameters
-
| newView | new view matrix or configuration options for the camera view, see View2D. |
| newOptions | new configuration options, see Camera2DOptions. |
- Exceptions
-
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
◆ setProjectionAndViewAndOptions()
Set both the projection and view of the camera, as well as its configuration options.
- Parameters
-
| newProjection | new projection matrix or configuration options for the camera projection, see Projection2D. |
| newView | new view matrix or configuration options for the camera view, see View2D. |
| newOptions | new configuration options, see Camera2DOptions. |
- Exceptions
-
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
◆ getParameterBuffer()
| const ParameterBuffer & grem::graphics::Camera2D::getParameterBuffer |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Get the parameter buffer of the camera.
- Returns
- a read-only reference to the camera's parameter buffer.
◆ getProjectionMatrix()
| const mat3 & grem::graphics::Camera2D::getProjectionMatrix |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Get the projection matrix of the camera.
- Returns
- a read-only reference to the camera's current projection matrix.
◆ getViewMatrix()
| const mat3 & grem::graphics::Camera2D::getViewMatrix |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Get the view matrix of the camera.
- Returns
- a read-only reference to the camera's current view matrix.
◆ getOptions()
Get the configuration options of the camera.
- Returns
- the camera's current options.
The documentation for this class was generated from the following file: