hx3d  1
2D/3D Simple Game Framework
fade_transition.hpp
1 /*
2  Fade screen transition.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef HX3D_GRAPHICS_FADETRANSITION
22 #define HX3D_GRAPHICS_FADETRANSITION
23 
24 #include "hx3d/graphics/transition.hpp"
25 #include "hx3d/graphics/color.hpp"
26 
27 namespace hx3d {
28 namespace graphics {
29 
33 class FadeTransition: public Transition {
34 public:
42 
43  virtual void render(Batch& batch, Framebuffer& currentFB, Framebuffer& nextFB) override;
44 
45  virtual void onUpdate(float delta) override;
46  virtual void onDone() override;
47  virtual void onStart() override;
48 
49 private:
50  Color _color;
51 };
52 
53 } /* graphics */
54 } /* hx3d */
55 
56 #endif /* HX3D_GRAPHICS_FADETRANSITION */
FadeTransition(window::Game *game, Color color=Color::Black)
Create a fading transition with a color.
Game main class: multiple screens management.
Definition: game.hpp:42
virtual void render(Batch &batch, Framebuffer &currentFB, Framebuffer &nextFB) override
Render the transition.
Four [0..255] components defined color.
Definition: color.hpp:32
hx3d framework namespace
Definition: audio.hpp:26
Transition between two screens.
Definition: transition.hpp:38
virtual void onStart() override
On transition start callback.
virtual void onDone() override
On transition done callback.
Simple base batch implementation. Draw at each draw call.
Definition: batch.hpp:36
virtual void onUpdate(float delta) override
On transition update callback.
Color fading transition.
Render-to-texture buffer.
Definition: framebuffer.hpp:37
static Color Black
Black color.
Definition: color.hpp:109