19 #ifndef EZGL_CAMERA_HPP
20 #define EZGL_CAMERA_HPP
22 #include "ezgl/point.hpp"
23 #include "ezgl/rectangle.hpp"
86 return m_initial_world;
108 return m_screen_to_world;
148 rectangle m_initial_world;
151 point2d m_world_to_widget = {1.0, 1.0};
152 point2d m_widget_to_screen = {1.0, 1.0};
153 point2d m_screen_to_world = {1.0, 1.0};
Manages the transformations between coordinate systems.
Definition: camera.hpp:40
void update_widget(int width, int height)
Update the dimensions of the widget.
void set_world(rectangle new_world)
Update the visible bounds of the world.
point2d widget_to_world(point2d widget_coordinates) const
Convert a point in widget coordinates to world coordinates.
void reset_world(rectangle new_world)
Reset the world coordinates.
camera(rectangle bounds)
Create a camera.
rectangle get_screen() const
Get the dimensions of the screen.
Definition: camera.hpp:68
rectangle get_widget() const
Get the dimensions of the widget.
Definition: camera.hpp:76
rectangle get_initial_world() const
Get the initial bounds of the world.
Definition: camera.hpp:84
point2d widget_to_screen(point2d widget_coordinates) const
Convert a point in widget coordinates to screen coordinates.
point2d world_to_screen(point2d world_coordinates) const
Convert a point in world coordinates to screen coordinates.
void update_scale_factors()
Update the scaling factors.
rectangle get_world() const
Get the currently visible bounds of the world.
Definition: camera.hpp:60
point2d get_world_scale_factor() const
Get the screen to world scaling factor.
Definition: camera.hpp:106
Responsible for creating, destroying, and maintaining the rendering context of a GtkWidget.
Definition: canvas.hpp:54
Represents a two-dimensional point.
Definition: point.hpp:27
Represents a rectangle as two diagonally opposite points.
Definition: rectangle.hpp:31
A library for creating a graphical user interface.
Definition: application.hpp:40