27#include "GraphicsApi.h"
33#ifndef DOXYGEN_SHOULD_SKIP_THIS
94 class GF_GRAPHICS_API
View {
161 onSizeChange(m_size);
440 [[deprecated(
"You should use setInitialFramebufferSize() instead")]]
442 setInitialFramebufferSize(screenSize);
488#ifndef DOXYGEN_SHOULD_SKIP_THIS
Adaptative view.
Definition: View.h:390
AdaptativeView(const RectF &rect)
Construct the view from a rectangle.
Definition: View.h:408
AdaptativeView(Vector2f center, Vector2f size)
Construct the view from its center and size.
Definition: View.h:420
void setInitialFramebufferSize(Vector2i framebufferSize)
Set the initial framebuffer size.
void setInitialScreenSize(Vector2i screenSize)
Set the initial screen size.
Definition: View.h:441
AdaptativeView()
Default constructor.
Definition: View.h:397
virtual void onFramebufferSizeChange(Vector2i framebufferSize)=0
Callback when the framebuffer has just been resized.
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
2D camera that defines what region is shown on framebuffer
Definition: View.h:94
void setViewport(const RectF &viewport)
Set the target viewport.
void rotate(float angle)
Rotate the view relatively to its current orientation.
void reset(const RectF &rect)
Reset the view to the given rectangle.
void setSizeNoCallback(Vector2f size)
Set the world size, without calling onSizeChange()
Definition: View.h:328
View(const RectF &rect)
Construct the view from a rectangle.
virtual void onSizeChange(Vector2f size)
Callback when the world has just been resized.
void zoom(float factor)
Resize the view rectangle relatively to its current size.
void setSize(Vector2f size)
Set the size of the view.
Definition: View.h:159
Matrix3f getInverseTransform() const
Get the inverse projection transform of the view.
RectF getBounds() const
Get the non-rotated bounds.
virtual void onViewportChange(const RectF &viewport)
Callback when the viewport has just been changed.
void setCenter(Vector2f center)
Set the center of the view.
Definition: View.h:137
Vector2f getCenter() const
Get the center of the view.
Definition: View.h:148
void setRotation(float angle)
Set the orientation of the view.
Definition: View.h:184
void move(Vector2f offset)
Move the view relatively to its current position.
void setViewportNoCallback(const RectF &viewport)
Set the viewport, without calling onViewportChange()
float getRotation() const
Get the current orientation of the view.
Definition: View.h:195
const RectF & getViewport() const
Get the target viewport rectangle of the view.
Definition: View.h:228
View(Vector2f center, Vector2f size)
Construct the view from its center and size.
Vector2f getSize() const
Get the size of the view.
Definition: View.h:171
View()
Default constructor.
virtual ~View()
Destructor.
void zoom(float factor, Vector2f fixed)
Resize the view rectangle relatively to its current size and a fixed point.
Matrix3f getTransform() const
Get the projection transform of the view.
A view adaptor for zooming/moving with the mouse.
Definition: View.h:458
void processEvent(const Event &event)
Update the original view thanks to the event.
ZoomingViewAdaptor(const RenderTarget &target, View &view)
Constructor.
GF_CORE_API float angle(Direction direction)
Get an angle from a direction.
@ Event
An event is pending on the sockets.
The namespace for gf classes.
Defines a system event and its parameters.
Definition: Event.h:224