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
3d682d89
Commit
3d682d89
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
ensure that add state follows naming conventions
parent
68548799
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
demo/demo/main.cpp
+3
-3
3 additions, 3 deletions
demo/demo/main.cpp
include/fggl/app.hpp
+1
-1
1 addition, 1 deletion
include/fggl/app.hpp
with
4 additions
and
4 deletions
demo/demo/main.cpp
+
3
−
3
View file @
3d682d89
...
...
@@ -43,7 +43,7 @@
#include
"rollball.hpp"
static
void
setup_menu
(
fggl
::
App
&
app
)
{
auto
*
menu
=
app
.
add
_s
tate
<
fggl
::
scenes
::
BasicMenu
>
(
"menu"
);
auto
*
menu
=
app
.
add
S
tate
<
fggl
::
scenes
::
BasicMenu
>
(
"menu"
);
// add some menu items for the game states
menu
->
add
(
"terrain"
,
[
&
app
]()
{
...
...
@@ -98,8 +98,8 @@ int main(int argc, const char* argv[]) {
// our test states
setup_menu
(
app
);
app
.
add
_s
tate
<
GameScene
>
(
"game"
);
app
.
add
_s
tate
<
demo
::
RollBall
>
(
"rollball"
);
app
.
add
S
tate
<
GameScene
>
(
"game"
);
app
.
add
S
tate
<
demo
::
RollBall
>
(
"rollball"
);
return
app
.
run
(
argc
,
argv
);
}
This diff is collapsed.
Click to expand it.
include/fggl/app.hpp
+
1
−
1
View file @
3d682d89
...
...
@@ -103,7 +103,7 @@ namespace fggl {
int
run
(
int
argc
,
const
char
**
argv
);
template
<
typename
T
>
T
*
add
_s
tate
(
const
Identifer
&
name
)
{
T
*
add
S
tate
(
const
Identifer
&
name
)
{
static_assert
(
std
::
is_base_of
<
AppState
,
T
>::
value
,
"States must be AppStates"
);
return
m_states
.
put
<
T
>
(
name
,
*
this
);
}
...
...
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