Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Onuralp SEZER
Game Library
Commits
aa716b19
Commit
aa716b19
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
rename terrain test in the menu
parent
38a1e10c
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
demo/demo/main.cpp
+9
-5
9 additions, 5 deletions
demo/demo/main.cpp
with
9 additions
and
5 deletions
demo/demo/main.cpp
+
9
−
5
View file @
aa716b19
...
...
@@ -79,13 +79,15 @@ static void setupServiceLocators(fggl::util::ServiceLocator& locator) {
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
fggl
::
App
app
(
"fggl-demo"
);
auto
&
locator
=
fggl
::
util
::
ServiceLocator
::
instance
();
setupServiceLocators
(
locator
);
// Would be nice to not take args like this, it messes with lifetimes
auto
&
windowing
=
app
.
use
<
fggl
::
gfx
::
ecsGlfwModule
>
(
locator
.
get
<
fggl
::
input
::
Input
>
());
// create the application
fggl
::
App
app
(
"fggl-demo"
);
// Would be nice to not take args like this, it messes with lifetimes
auto
&
windowing
=
app
.
use
<
fggl
::
gfx
::
ecsGlfwModule
>
(
locator
.
get
<
fggl
::
input
::
Input
>
());
// -- should not be our problem - this is a broken api
auto
window
=
windowing
.
createWindow
(
"Demo Game"
);
...
...
@@ -101,11 +103,13 @@ int main(int argc, const char* argv[]) {
// Add a basic main menu
auto
*
menu
=
app
.
add_state
<
fggl
::
scenes
::
BasicMenu
>
(
"menu"
);
menu
->
add
(
"start"
,
[
&
app
]()
{
app
.
change_state
(
"game"
);
});
// add some menu items for the game states
menu
->
add
(
"terrain"
,
[
&
app
]()
{
app
.
change_state
(
"game"
);
});
menu
->
add
(
"rollball"
,
[
&
app
]()
{
app
.
change_state
(
"rollball"
);
});
menu
->
add
(
"quit"
,
[
&
app
]()
{
app
.
running
(
false
);
});
// the game state
itself
// the game state
s themselves
app
.
add_state
<
GameScene
>
(
"game"
);
app
.
add_state
<
demo
::
RollBall
>
(
"rollball"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment