-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APP] Extracted GameApplication::init from run. Made window member.
Added empty (virtual) destructor definition in .cpp to allow class-forwarding RenderWindow accessed via unique_ptr
- Loading branch information
Showing
3 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
|
||
namespace sf | ||
{ | ||
class RenderWindow; | ||
} | ||
|
||
/// Game Application. Handles game loop. | ||
class GameApplication | ||
{ | ||
public: | ||
GameApplication(); | ||
virtual ~GameApplication(); | ||
|
||
GameApplication(const GameApplication&) = delete; | ||
GameApplication& operator=(const GameApplication&) = delete; | ||
|
||
public: | ||
/// Initialize game application. | ||
void init(); | ||
|
||
/// Run game loop. Returns when the loop is over, i.e. the window is closed. | ||
void run(); | ||
|
||
private: | ||
/* State */ | ||
|
||
/// Render window | ||
std::unique_ptr<sf::RenderWindow> window; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters