Id: To index
Original: Legend
Status:
Mutant: Show

Testcases to display

Filter by kind

Filter by status

1:
// A basic game structure example
2:
// @eigenbom 2017
3:
4:
#
include
 
"game.h"
5:
#
include
 
"window.h"
6:
7:
#
include
 
<
memory
>
8:
9:
void
 
runGame
(
)
 
{
10:    
std
::
unique_ptr
<
Window
>
 
window
{
new
 
Window
}
;
11:    
std
::
unique_ptr
<
Game
>
 
game
{
new
 
Game
{
*
window
}
}
;
12:
13:    
game
->
setup
(
)
;
14:    
while
 
(
window
->
handleEvents
(
)
)
 
{
15:        
if
 
(
!
game
->
update
(
)
)
16:            
break
;
17:        
game
->
render
(
)
;
18:        
window
->
render
(
)
;
19:    
}
20:
}
21:
22:
int
 
main
(
int
 
argc
,
 
const
 
char
*
 
argv
[
]
)
 
{
23:    
runGame
(
)
;
24:    
return
 
0
;
25:
}