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
1febd4f3
Commit
1febd4f3
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
clean up app makefile - remove unused scene interface
parent
a080fc49
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
fggl/CMakeLists.txt
+42
-38
42 additions, 38 deletions
fggl/CMakeLists.txt
fggl/scenes/Scene.cpp
+0
-25
0 additions, 25 deletions
fggl/scenes/Scene.cpp
fggl/scenes/Scene.h
+0
-53
0 additions, 53 deletions
fggl/scenes/Scene.h
fggl/scenes/menu.cpp
+0
-4
0 additions, 4 deletions
fggl/scenes/menu.cpp
with
42 additions
and
120 deletions
fggl/CMakeLists.txt
+
42
−
38
View file @
1febd4f3
# headers
file
(
GLOB_RECURSE HEADER_LIST CONFIGURE_DEPENDS
"
${
CMAKE_SOURCE_DIR
}
/include/fggl/**.hpp"
)
file
(
GLOB_RECURSE HEADER_LIST CONFIGURE_DEPENDS
"
${
CMAKE_SOURCE_DIR
}
/include/fggl/**.hpp"
)
# the fggl library itself
add_library
(
fggl
${
HEADER_LIST
}
)
# we need to tell people using the library about our headers
target_include_directories
(
fggl
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_SOURCE_DIR
}
/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories
(
fggl
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_SOURCE_DIR
}
/include>
$<INSTALL_INTERFACE:include>
)
# users of this library need at least C++17
target_compile_features
(
fggl PUBLIC cxx_std_17
)
target_compile_features
(
fggl PUBLIC cxx_std_17
)
# IDE support for nice header files
source_group
(
TREE
"
${
PROJECT_SOURCE_DIR
}
/include"
PREFIX
"Header Files"
FILES
${
HEADER_LIST
}
TREE
"
${
PROJECT_SOURCE_DIR
}
/include"
PREFIX
"Header Files"
FILES
${
HEADER_LIST
}
)
# Generation of configuration header
...
...
@@ -27,40 +27,44 @@ configure_file(FgglConfig.h.in FgglConfig.h)
# clang tidy
find_program
(
CLANG_TIDY_FOUND clang-tidy
)
if
(
CLANG_TIDY_FOUND
)
set
(
CMAKE_CXX_CLANG_TIDY clang-tidy -checks=*,-llvmlibc-*,-fuchsia-*,-cppcoreguidelines-*,-android-*,-llvm-*,-altera-*,-modernize-use-trailing-return-type
)
endif
()
if
(
CLANG_TIDY_FOUND
)
set
(
CMAKE_CXX_CLANG_TIDY clang-tidy -checks=*,-llvmlibc-*,-fuchsia-*,-cppcoreguidelines-*,-android-*,-llvm-*,-altera-*,-modernize-use-trailing-return-type
)
endif
()
target_sources
(
${
PROJECT_NAME
}
PRIVATE
app.cpp
ecs/ecs.cpp
data/model.cpp
data/procedural.cpp
data/heightmap.cpp
ecs3/fast/Container.cpp
ecs3/prototype/world.cpp
scenes/Scene.cpp
scenes/menu.cpp
ecs3/module/module.cpp
input/camera_input.cpp
input/input.cpp
input/mouse.cpp
data/heightmap.cpp
gui/widget.cpp
gui/widgets.cpp
gui/containers.cpp
gui/fonts.cpp
math/triangulation.cpp
math/shapes.cpp
)
PRIVATE
app.cpp
data/model.cpp
data/procedural.cpp
data/heightmap.cpp
ecs/ecs.cpp
ecs3/module/module.cpp
ecs3/fast/Container.cpp
ecs3/prototype/world.cpp
scenes/menu.cpp
input/input.cpp
input/mouse.cpp
input/camera_input.cpp
gui/widget.cpp
gui/widgets.cpp
gui/containers.cpp
gui/fonts.cpp
math/triangulation.cpp
math/shapes.cpp
)
# spdlog for cleaner logging
find_package
(
spdlog
)
find_package
(
spdlog
)
target_link_libraries
(
${
PROJECT_NAME
}
PRIVATE spdlog::spdlog
)
find_package
(
freetype
)
target_link_libraries
(
${
PROJECT_NAME
}
PUBLIC freetype
)
find_package
(
freetype
)
target_link_libraries
(
${
PROJECT_NAME
}
PUBLIC freetype
)
# Graphics backend
add_subdirectory
(
gfx
)
...
...
This diff is collapsed.
Click to expand it.
fggl/scenes/Scene.cpp
deleted
100644 → 0
+
0
−
25
View file @
a080fc49
//
// Created by webpigeon on 20/11/2021.
//
#include
"Scene.h"
#include
<utility>
namespace
fggl
::
scenes
{
void
SceneManager
::
create
(
const
std
::
string
&
name
,
std
::
shared_ptr
<
Scene
>
scene
)
{
m_scenes
[
name
]
=
std
::
move
(
scene
);
}
void
SceneManager
::
activate
(
const
std
::
string
&
name
)
{
auto
newScene
=
m_scenes
.
at
(
name
);
if
(
m_active
!=
nullptr
)
{
m_active
->
cleanup
();
m_active
=
nullptr
;
}
newScene
->
setup
();
m_active
=
newScene
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
fggl/scenes/Scene.h
deleted
100644 → 0
+
0
−
53
View file @
a080fc49
//
// Created by webpigeon on 20/11/2021.
//
#ifndef FGGL_SCENE_H
#define FGGL_SCENE_H
#include
<memory>
#include
<string>
#include
<unordered_map>
namespace
fggl
::
scenes
{
class
Scene
{
public:
virtual
~
Scene
()
=
default
;
// no copying
Scene
(
const
Scene
&
)
=
delete
;
Scene
&
operator
=
(
const
Scene
&
)
=
delete
;
virtual
void
setup
()
=
0
;
virtual
void
cleanup
()
=
0
;
virtual
void
update
()
=
0
;
virtual
void
render
()
=
0
;
};
class
SceneManager
{
public:
SceneManager
()
=
default
;
void
create
(
const
std
::
string
&
name
,
std
::
shared_ptr
<
Scene
>
scene
);
void
activate
(
const
std
::
string
&
name
);
inline
void
update
()
{
if
(
m_active
==
nullptr
)
{
return
;
}
m_active
->
update
();
}
inline
void
render
()
{
if
(
m_active
==
nullptr
)
{
return
;
}
m_active
->
render
();
}
private
:
std
::
shared_ptr
<
Scene
>
m_active
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
Scene
>>
m_scenes
;
};
}
#endif //FGGL_SCENE_H
This diff is collapsed.
Click to expand it.
fggl/scenes/menu.cpp
+
0
−
4
View file @
1febd4f3
...
...
@@ -14,10 +14,6 @@ namespace fggl::scenes {
BasicMenu
::
BasicMenu
(
fggl
::
App
&
app
)
:
AppState
(
app
),
m_inputs
(
nullptr
),
m_active
(),
m_hover
(
nullptr
)
{
auto
&
locator
=
fggl
::
util
::
ServiceLocator
::
instance
();
m_inputs
=
locator
.
get
<
input
::
Input
>
();
math
::
vec2
pos
{
500.
F
,
500.
F
};
math
::
vec2
size
{
32.5
F
,
35.
F
};
m_canvas
.
add
(
std
::
make_unique
<
gui
::
Button
>
(
pos
,
size
));
}
void
BasicMenu
::
update
()
{
...
...
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