forked from rktrlng/rt2d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (35 loc) · 1.03 KB
/
Copy pathmain.cpp
File metadata and controls
40 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* Copyright 2015 Your Name <you@yourhost.com>
*
* @brief Description of My Awesome Game.
*
* @file main.cpp
*
* @mainpage My Awesome Game
*
* @section intro Introduction
*
* Detailed description of My Awesome Game.
*
* There's even a second paragraph.
*/
#include <rt2d/core.h>
#include "myscene.h"
/// @brief main entry point
int main( void )
{
// Core instance
Core core;
// Scene01
MyScene* myscene = new MyScene(); // create Scene on the heap
while(myscene->isRunning()) { // check status of Scene every frame
core.run(myscene); // update and render the current scene
core.showFrameRate(5); // show framerate in output every n seconds
}
//core.cleanup(); // cleanup ResourceManager (Textures + Meshes, but not Shaders)
delete myscene; // delete Scene and everything in it from the heap to make space for next Scene
// No need to explicitly clean up the core.
// As a local var, core will go out of scope and destroy Renderer->ResourceManager.
// ResourceManager destructor also deletes Shaders.
return 0;
}