hx3d  1
2D/3D Simple Game Framework
fit_viewport.hpp
1 /*
2  Fit viewport.
3  Inspired by LibGDX fit viewport.
4  Automatically fit the rendering in the screen.
5 
6  Copyright (C) 2015 Denis BOURGE
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
21  USA
22 */
23 
24 #ifndef HX3D_GRAPHICS_VIEWPORTS_FITVIEWPORT
25 #define HX3D_GRAPHICS_VIEWPORTS_FITVIEWPORT
26 
27 #include "hx3d/graphics/viewports/viewport.hpp"
28 
29 namespace hx3d {
30 namespace graphics {
31 namespace viewports {
32 
36 class FitViewport: public Viewport {
37 
38 public:
39 
46  FitViewport(const float worldWidth, const float worldHeight);
47 
48  virtual void internalUpdate(Camera& camera) override;
49 
50 };
51 
52 } /* viewports */
53 } /* graphics */
54 } /* hx3d */
55 
56 #endif
2D/3D camera.
Definition: camera.hpp:41
hx3d framework namespace
Definition: audio.hpp:26
virtual void internalUpdate(Camera &camera) override
Update the viewport, centering the camera (internal).
FitViewport(const float worldWidth, const float worldHeight)
Create a fit viewport using a world width and height.
Fit the screen resolution.