Arkanoid Remake  1.0
App.h
Go to the documentation of this file.
1 /*
2 ArkanoidRemakeSDL
3 a sample of object-oriented game programming with C++.
4 version 1.0, May 2016
5 
6 Copyright (c) 2016 Giovanni Paolo Vigano'
7 
8 The source code of the SDL library used by ArkanoidRemakeSDL can be found here:
9 https://www.libsdl.org/
10 ---
11 ArkanoidRemakeSDL source code is licensed with the same zlib license:
12 (http://www.gzip.org/zlib/zlib_license.html)
13 
14 This software is provided 'as-is', without any express or implied warranty. In
15 no event will the authors be held liable for any damages arising from the use of
16 this software.
17 
18 Permission is granted to anyone to use this software for any purpose, including
19 commercial applications, and to alter it and redistribute it freely, subject to
20 the following restrictions:
21 
22  1. The origin of this software must not be misrepresented; you must not
23  claim that you wrote the original software. If you use this software in a
24  product, an acknowledgment in the product documentation would be appreciated
25  but is not required.
26 
27  2. Altered source versions must be plainly marked as such, and must not be
28  misrepresented as being the original software.
29 
30  3. This notice may not be removed or altered from any source distribution.
31 */
32 
33 
44 
45 #pragma once
46 
47 #ifndef APP_H
48 #define APP_H
49 
50 #include <string>
51 
54 
56 class App
57 {
58 protected:
60  bool mQuit;
61 public:
62 
64  App();
65 
67  virtual bool Init() { return false; }
68 
70  virtual void Start() {}
71 
73  virtual void Update() {}
74 
76  virtual void Stop() {}
77 
79  virtual void CleanUp() {}
80 
84  bool Run();
85 };
86 
88 
89 
90 #endif//APP_H
bool mQuit
Flag used in the Run() method while calling Update() in a loop.
Definition: App.h:60
virtual void Stop()
Stop the application.
Definition: App.h:76
virtual void CleanUp()
Clean up the application and free memory.
Definition: App.h:79
virtual bool Init()
Initialization (the first method to call)
Definition: App.h:67
virtual void Update()
Update the application (call it in an iteration loop)
Definition: App.h:73
bool Run()
Run the application.
virtual void Start()
Start the application (the second method to call)
Definition: App.h:70
Application interface definition.
Definition: App.h:56
App()
Constructor.