supertux
title_screen.hpp
1 // SuperTux
2 // Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
3 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program 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
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef HEADER_SUPERTUX_SUPERTUX_TITLE_SCREEN_HPP
19 #define HEADER_SUPERTUX_SUPERTUX_TITLE_SCREEN_HPP
20 
21 #include "supertux/screen.hpp"
22 #include "video/surface_ptr.hpp"
23 
24 #include <string>
25 
26 class CodeController;
27 class GameSession;
28 class Savegame;
29 
32 class TitleScreen final : public Screen
33 {
34 public:
35  TitleScreen(Savegame& savegame);
36  virtual ~TitleScreen();
37 
38  virtual void setup() override;
39  virtual void leave() override;
40 
41  virtual void draw(Compositor& compositor) override;
42  virtual void update(float dt_sec, const Controller& controller) override;
43 
44 private:
45  void make_tux_jump();
46 
47 private:
48  SurfacePtr m_frame;
49  std::unique_ptr<CodeController> m_controller;
50  std::unique_ptr<GameSession> m_titlesession;
51  std::string m_copyright_text;
52  std::string m_videosystem_name;
53 
54 private:
55  TitleScreen(const TitleScreen&) = delete;
56  TitleScreen& operator=(const TitleScreen&) = delete;
57 };
58 
59 #endif
60 
61 /* EOF */
Definition: controller.hpp:56
Abstract base class for code the MainLoop runs exclusively and full-screen.
Definition: screen.hpp:29
virtual void draw(Compositor &compositor) override
gets called once per frame.
Definition: title_screen.cpp:109
Definition: compositor.hpp:29
Definition: savegame.hpp:66
virtual void update(float dt_sec, const Controller &controller) override
gets called for once (per logical) frame.
Definition: title_screen.cpp:133
This is a dummy controller that doesn&#39;t react to any user input but should be controlled by code...
Definition: codecontroller.hpp:24
Screen that displays the SuperTux logo, lets players start a new game, etc.
Definition: title_screen.hpp:32
virtual void setup() override
gets called before this screen gets activated (which is at least once before the first draw or update...
Definition: title_screen.cpp:87
virtual void leave() override
gets called when the current screen is temporarily suspended
Definition: title_screen.cpp:101
Screen that runs a Level, where Players run and jump through Sectors.
Definition: game_session.hpp:41