Skip to content

Commit 19e0d17

Browse files
authored
Merge pull request #1 from Creative-Rift/feature/menu
Feature/menu
2 parents 22165ae + 940d501 commit 19e0d17

113 files changed

Lines changed: 987 additions & 15126 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cmake_linux.cmake

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
2+
## PROJECT VAR
3+
## <=====================================>
4+
project( Incaribus
5+
VERSION
6+
0.1
7+
DESCRIPTION
8+
"Example project to test ShipWreckEngine"
9+
)
10+
set( EXEC incaribus )
11+
set( EXT cpp )
12+
13+
## SOURCE FOLDERS
14+
set( SRC_FOLDERS
15+
${CMAKE_SOURCE_DIR}/sources/
16+
${CMAKE_SOURCE_DIR}/sources/scenes/
17+
${CMAKE_SOURCE_DIR}/sources/script/
18+
)
19+
## INCLUDE FOLDERS
20+
set( INC_FOLDERS
21+
${CMAKE_SOURCE_DIR}/libraries/
22+
${CMAKE_SOURCE_DIR}/libraries/module/
23+
${CMAKE_SOURCE_DIR}/libraries/core/
24+
${CMAKE_SOURCE_DIR}/includes/
25+
${CMAKE_SOURCE_DIR}/includes/scenes/
26+
${CMAKE_SOURCE_DIR}/includes/script/
27+
)
28+
## IMPORTED SHARED LIBRARY NAME
29+
set( SHARED_LIB_NAME
30+
Jsnp
31+
SWEngine-Core-Debug
32+
SWEngine-OpenGLModule
33+
glfw
34+
yaml-cpp
35+
)
36+
## IMPORTED SHARED LIBRARY LOCATION
37+
set( SHARED_LIB_LOCATION
38+
${CMAKE_SOURCE_DIR}/libraries/libJsnp.so
39+
${CMAKE_SOURCE_DIR}/libraries/libSWEngine-Core-Debug.so
40+
${CMAKE_SOURCE_DIR}/libraries/libSWEngine-OpenGLModule.so
41+
${CMAKE_SOURCE_DIR}/libraries/libglfw.so
42+
${CMAKE_SOURCE_DIR}/libraries/libyaml-cpp.so
43+
)
44+
## <=====================================>
45+
46+
47+
## GET SOURCES
48+
## <=====================================>
49+
foreach(filePath ${SRC_FOLDERS})
50+
string(APPEND TMP "${filePath}*.${EXT};")
51+
endforeach()
52+
file(GLOB SRC ${TMP})
53+
## <=====================================>
54+
55+
56+
## OUTPUT
57+
## <=====================================>
58+
## EXECUTABLE
59+
add_executable(${EXEC} ${SRC})
60+
61+
## or SHARED LIB
62+
# add_library(${EXEC} SHARED ${SRC})
63+
64+
## or STATIC LIB
65+
# add_library(${EXEC} STATIC ${SRC})
66+
## <=====================================>
67+
68+
69+
## ADD INCLUDES
70+
## <=====================================>
71+
target_include_directories(${EXEC} PRIVATE ${INC_FOLDERS})
72+
## <=====================================>
73+
74+
## ADD PARAMETER
75+
## <=====================================>
76+
if (UNIX)
77+
target_compile_options(${EXEC} PRIVATE -g3)
78+
endif (UNIX)
79+
## <=====================================>
80+
81+
82+
## SHARED LIBRARY LINKING
83+
## <=====================================>
84+
list(LENGTH SHARED_LIB_NAME list_len)
85+
math(EXPR LIST_LEN "${list_len} - 1")
86+
87+
foreach(ctr RANGE ${LIST_LEN})
88+
list(GET SHARED_LIB_NAME ${ctr} lib)
89+
list(GET SHARED_LIB_LOCATION ${ctr} loc)
90+
add_library(${lib} SHARED IMPORTED)
91+
set_target_properties(${lib} PROPERTIES
92+
IMPORTED_LOCATION ${loc}
93+
)
94+
endforeach()
95+
target_link_libraries(${EXEC}
96+
PUBLIC
97+
${SHARED_LIB_NAME}
98+
)
99+
## <=====================================>
100+
101+
102+
## PACKAGE LINKING
103+
## <=====================================>
104+
## <=====================================>

.cmake_windows.cmake

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
2+
## PROJECT VAR
3+
## <=====================================>
4+
project( Incaribus
5+
VERSION
6+
0.1
7+
DESCRIPTION
8+
"Example project to test ShipWreckEngine"
9+
LANGUAGES
10+
CXX
11+
)
12+
set( EXEC incaribus )
13+
set( EXT cpp )
14+
15+
## SOURCE FOLDERS
16+
set( SRC_FOLDERS
17+
${CMAKE_SOURCE_DIR}/sources/
18+
${CMAKE_SOURCE_DIR}/sources/scenes/
19+
)
20+
## INCLUDE FOLDERS
21+
set( INC_FOLDERS
22+
${CMAKE_SOURCE_DIR}/libs/
23+
${CMAKE_SOURCE_DIR}/libs/module/opengl/
24+
${CMAKE_SOURCE_DIR}/libs/core/includes/
25+
${CMAKE_SOURCE_DIR}/includes/
26+
${CMAKE_SOURCE_DIR}/includes/scenes/
27+
)
28+
## IMPORTED SHARED LIBRARY NAME
29+
set( SHARED_LIB_NAME
30+
Jsnp
31+
SWEngine-Core
32+
SWEngine-OpenGLModule
33+
glfw3
34+
)
35+
## IMPORTED SHARED LIBRARY LOCATION
36+
set( SHARED_LIB_LOCATION
37+
${CMAKE_SOURCE_DIR}/libs/Jsnp.dll
38+
${CMAKE_SOURCE_DIR}/libs/SWEngine-Core.dll
39+
${CMAKE_SOURCE_DIR}/libs/SWEngine-OpenGLModule.dll
40+
${CMAKE_SOURCE_DIR}/libs/glfw3.dll
41+
)
42+
## IMPORTED SHARED LIBRARY lib file
43+
set( SHARED_LIB
44+
${CMAKE_SOURCE_DIR}/libs/Jsnp.lib
45+
${CMAKE_SOURCE_DIR}/libs/SWEngine-Core.lib
46+
${CMAKE_SOURCE_DIR}/libs/SWEngine-OpenGLModule.lib
47+
${CMAKE_SOURCE_DIR}/libs/glfw3.lib
48+
)
49+
## <=====================================>
50+
51+
52+
## GET SOURCES
53+
## <=====================================>
54+
foreach(filePath ${SRC_FOLDERS})
55+
string(APPEND TMP "${filePath}*.${EXT};")
56+
endforeach()
57+
file(GLOB SRC ${TMP})
58+
## <=====================================>
59+
60+
61+
## OUTPUT
62+
## <=====================================>
63+
## EXECUTABLE
64+
add_executable(${EXEC} ${SRC})
65+
66+
## or SHARED LIB
67+
# add_library(${EXEC} SHARED ${SRC})
68+
69+
## or STATIC LIB
70+
# add_library(${EXEC} STATIC ${SRC})
71+
## <=====================================>
72+
73+
74+
## ADD INCLUDES
75+
## <=====================================>
76+
target_include_directories(${EXEC} PRIVATE ${INC_FOLDERS})
77+
## <=====================================>
78+
79+
## ADD PARAMETER
80+
## <=====================================>
81+
if (UNIX)
82+
target_compile_options(${EXEC} PRIVATE -g3)
83+
endif (UNIX)
84+
## <=====================================>
85+
86+
87+
## SHARED LIBRARY LINKING
88+
## <=====================================>
89+
list(LENGTH SHARED_LIB_NAME list_len)
90+
math(EXPR LIST_LEN "${list_len} - 1")
91+
92+
foreach(ctr RANGE ${LIST_LEN})
93+
list(GET SHARED_LIB_NAME ${ctr} lib)
94+
list(GET SHARED_LIB_LOCATION ${ctr} loc)
95+
list(GET SHARED_LIB ${ctr} filelib)
96+
add_library(${lib} SHARED IMPORTED)
97+
file(COPY ${loc} DESTINATION ${CMAKE_SOURCE_DIR}/out/)
98+
set_target_properties(${lib} PROPERTIES
99+
IMPORTED_LOCATION ${loc}
100+
IMPORTED_IMPLIB ${filelib}
101+
)
102+
endforeach()
103+
target_link_libraries(${EXEC}
104+
PUBLIC
105+
${SHARED_LIB_NAME}
106+
)
107+
## <=====================================>
108+
109+
110+
## PACKAGE LINKING
111+
## <=====================================>
112+
## <=====================================>

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@
3333
# IDE cache
3434
.idea
3535
.vscode
36-
cmake-*
36+
cmake-*
37+
libraries

CMakeLists.txt

Lines changed: 13 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## CMAKE VAR
22
## <=====================================>
33
cmake_minimum_required( VERSION 3.17...3.20 )
4-
set( CMAKE_BUILD_TYPE Release ) # Release / RelWithDebInfo / Debug
4+
set( CMAKE_BUILD_TYPE Debug ) # Release / RelWithDebInfo / Debug
55
set( CMAKE_CXX_STANDARD 20 )
66
set( CMAKE_CXX_STANDARD_REQUIRED True )
7-
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/ )
8-
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/ )
9-
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/ )
7+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
8+
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
9+
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
1010
## <=====================================>
1111

1212

@@ -20,94 +20,13 @@ project( Incaribus
2020
LANGUAGES
2121
CXX
2222
)
23-
set( EXEC incaribus )
24-
set( EXT cpp )
2523

26-
## SOURCE FOLDERS
27-
set( SRC_FOLDERS
28-
${CMAKE_SOURCE_DIR}/sources/
29-
${CMAKE_SOURCE_DIR}/sources/scenes/
30-
)
31-
## INCLUDE FOLDERS
32-
set( INC_FOLDERS
33-
${CMAKE_SOURCE_DIR}/libs/
34-
${CMAKE_SOURCE_DIR}/libs/module/
35-
${CMAKE_SOURCE_DIR}/libs/core/includes
36-
${CMAKE_SOURCE_DIR}/includes/
37-
${CMAKE_SOURCE_DIR}/includes/scenes/
38-
)
39-
## IMPORTED SHARED LIBRARY NAME
40-
set( SHARED_LIB_NAME
41-
Jsnp
42-
SWEngine-Core
43-
SWEngine-OpenGLModule
44-
glfw
45-
)
46-
## IMPORTED SHARED LIBRARY LOCATION
47-
set( SHARED_LIB_LOCATION
48-
${CMAKE_SOURCE_DIR}/libs/libJsnp.so
49-
${CMAKE_SOURCE_DIR}/libs/libSWEngine-Core.so
50-
${CMAKE_SOURCE_DIR}/libs/libSWEngine-OpenGLModule.so
51-
${CMAKE_SOURCE_DIR}/libs/libglfw.so
52-
)
53-
## <=====================================>
54-
55-
56-
## GET SOURCES
57-
## <=====================================>
58-
foreach(filePath ${SRC_FOLDERS})
59-
string(APPEND TMP "${filePath}*.${EXT};")
60-
endforeach()
61-
file(GLOB SRC ${TMP})
62-
## <=====================================>
63-
64-
65-
## OUTPUT
66-
## <=====================================>
67-
## EXECUTABLE
68-
add_executable(${EXEC} ${SRC})
69-
70-
## or SHARED LIB
71-
# add_library(${EXEC} SHARED ${SRC})
72-
73-
## or STATIC LIB
74-
# add_library(${EXEC} STATIC ${SRC})
75-
## <=====================================>
76-
77-
78-
## ADD INCLUDES
79-
## <=====================================>
80-
target_include_directories(${EXEC} PRIVATE ${INC_FOLDERS})
81-
## <=====================================>
82-
83-
## ADD PARAMETER
84-
## <=====================================>
85-
if (UNIX)
86-
target_compile_options(${EXEC} PRIVATE -g3)
87-
endif (UNIX)
88-
## <=====================================>
89-
90-
91-
## SHARED LIBRARY LINKING
92-
## <=====================================>
93-
list(LENGTH SHARED_LIB_NAME list_len)
94-
math(EXPR LIST_LEN "${list_len} - 1")
95-
96-
foreach(ctr RANGE ${LIST_LEN})
97-
list(GET SHARED_LIB_NAME ${ctr} lib)
98-
list(GET SHARED_LIB_LOCATION ${ctr} loc)
99-
add_library(${lib} SHARED IMPORTED)
100-
set_target_properties(${lib} PROPERTIES
101-
IMPORTED_LOCATION ${loc}
102-
)
103-
endforeach()
104-
target_link_libraries(${EXEC}
105-
PUBLIC
106-
${SHARED_LIB_NAME}
107-
)
108-
## <=====================================>
109-
110-
111-
## PACKAGE LINKING
112-
## <=====================================>
113-
## <=====================================>
24+
if (WIN32)
25+
message("Windows system detected, prepare project...")
26+
include(.cmake_windows.cmake)
27+
elseif(UNIX)
28+
message("Linux system detected, prepare project...")
29+
include(.cmake_linux.cmake)
30+
else()
31+
message(FATAL_ERROR "System not supported!")
32+
endif()

includes/Project.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
** Society: Creative Rift
3+
** SHIPWRECK ENGINE, 2022
4+
** Author: Guillaume S.
5+
** File name: Project.hpp
6+
** Description: [CHANGE]
7+
*/
8+
9+
#ifndef INCARIBUS_PROJECT_HPP
10+
#define INCARIBUS_PROJECT_HPP
11+
12+
namespace sw
13+
{
14+
void CreateScenes();
15+
}
16+
17+
#endif //INCARIBUS_PROJECT_HPP

includes/scenes/Main.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Main : public sw::AScene {
1818
void onLoad() override;
1919
void onUpdate() override;
2020
void onUnload() override;
21+
std::string type() const override { return (""); }
2122
};
2223

2324
#endif //INCARIBUS_MAIN_HPP

0 commit comments

Comments
 (0)