hx3d  1
2D/3D Simple Game Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
hx3d::graphics::viewports::FitViewport Class Reference

Fit the screen resolution. More...

#include <fit_viewport.hpp>

Public Member Functions

 FitViewport (const float worldWidth, const float worldHeight)
 Create a fit viewport using a world width and height. More...
 
virtual void internalUpdate (Camera &camera) override
 Update the viewport, centering the camera (internal).
 
- Public Member Functions inherited from hx3d::graphics::viewports::Viewport
void setScreenPosition (const float x, const float y)
 Set the viewport position. More...
 
void apply (Camera &camera)
 Apply the viewport on the screen, centering the camera. More...
 
void update (Camera &camera, const int screenWidth, const int screenHeight)
 Update the viewport with a new screen width and height, centering the camera. More...
 
glm::vec2 screenToWorld (const glm::vec2 screenPoint)
 Convert a screen point to a world point. More...
 
glm::vec2 getWorldSize ()
 Get the world size.
 

Additional Inherited Members

- Protected Attributes inherited from hx3d::graphics::viewports::Viewport
float _worldWidth
 World width.
 
float _worldHeight
 World height.
 
int _screenX
 X offset.
 
int _screenY
 Y offset.
 
int _screenWidth
 Screen width.
 
int _screenHeight
 Screen height.
 

Detailed Description

Fit the screen resolution.

Definition at line 36 of file fit_viewport.hpp.

Constructor & Destructor Documentation

hx3d::graphics::viewports::FitViewport::FitViewport ( const float  worldWidth,
const float  worldHeight 
)

Create a fit viewport using a world width and height.

Parameters
worldWidthWorld width
worldHeightWorld height

Definition at line 34 of file fit_viewport.cpp.


The documentation for this class was generated from the following files: