-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add glm folder to make it easier to build
- Loading branch information
Showing
395 changed files
with
60,351 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,110 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
#Set up project | ||
project(mc-one-week VERSION 1.0) | ||
|
||
#Enable debug symbols | ||
if (NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose debug or release" FORCE) | ||
endif() | ||
#Set executable | ||
add_executable(mc-one-week | ||
Source/Item/Material.cpp | ||
Source/Item/ItemStack.cpp | ||
Source/Application.cpp | ||
Source/World/Event/PlayerDigEvent.cpp | ||
Source/World/Block/BlockDatabase.cpp | ||
Source/World/Block/BlockData.cpp | ||
Source/World/Block/ChunkBlock.cpp | ||
Source/World/Block/BlockTypes/BlockType.cpp | ||
Source/World/World.cpp | ||
Source/World/Generation/Biome/LightForest.cpp | ||
Source/World/Generation/Biome/Biome.cpp | ||
Source/World/Generation/Biome/DesertBiome.cpp | ||
Source/World/Generation/Biome/GrasslandBiome.cpp | ||
Source/World/Generation/Biome/TemperateForestBiome.cpp | ||
Source/World/Generation/Biome/OceanBiome.cpp | ||
Source/World/Generation/Structures/TreeGenerator.cpp | ||
Source/World/Generation/Structures/StructureBuilder.cpp | ||
Source/World/Generation/Terrain/SuperFlatGenerator.cpp | ||
Source/World/Generation/Terrain/ClassicOverWorldGenerator.cpp | ||
Source/World/Chunk/ChunkMesh.cpp | ||
Source/World/Chunk/ChunkManager.cpp | ||
Source/World/Chunk/Chunk.cpp | ||
Source/World/Chunk/ChunkSection.cpp | ||
Source/World/Chunk/ChunkMeshBuilder.cpp | ||
Source/States/PlayingState.cpp | ||
Source/Physics/AABB.cpp | ||
Source/Player/Player.cpp | ||
Source/Maths/Ray.cpp | ||
Source/Maths/Frustum.cpp | ||
Source/Maths/NoiseGenerator.cpp | ||
Source/Maths/Vector2XZ.cpp | ||
Source/Maths/Matrix.cpp | ||
Source/Maths/GeneralMaths.cpp | ||
Source/Camera.cpp | ||
Source/GL/GLFunctions.cpp | ||
Source/Context.cpp | ||
Source/Texture/CubeTexture.cpp | ||
Source/Texture/BasicTexture.cpp | ||
Source/Texture/TextureAtlas.cpp | ||
Source/Input/ToggleKey.cpp | ||
Source/Input/Keyboard.cpp | ||
Source/Main.cpp | ||
Source/Controller.cpp | ||
Source/Util/Random.cpp | ||
Source/Util/FPSCounter.cpp | ||
Source/Util/FileUtil.cpp | ||
Source/Shaders/FloraShader.cpp | ||
Source/Shaders/WaterShader.cpp | ||
Source/Shaders/SkyboxShader.cpp | ||
Source/Shaders/Shader.cpp | ||
Source/Shaders/ChunkShader.cpp | ||
Source/Shaders/BasicShader.cpp | ||
Source/Shaders/ShaderLoader.cpp | ||
Source/Renderer/RenderMaster.cpp | ||
Source/Renderer/WaterRenderer.cpp | ||
Source/Renderer/ChunkRenderer.cpp | ||
Source/Renderer/SkyboxRenderer.cpp | ||
Source/Renderer/SFMLRenderer.cpp | ||
Source/Renderer/FloraRenderer.cpp | ||
Source/Model.cpp | ||
) | ||
|
||
project(mc-one-week) | ||
#Set module path | ||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) | ||
|
||
#Add the files | ||
file(GLOB_RECURSE SOURCES Source/*.cpp) | ||
add_executable(mc-one-week ${SOURCES}) | ||
#Find libraries | ||
find_package(Threads) | ||
find_package(SFML REQUIRED audio network graphics window system) | ||
|
||
#Add libraries | ||
#SFML | ||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) | ||
find_package(SFML REQUIRED graphics network audio window system) | ||
add_subdirectory(deps/glm) | ||
add_subdirectory(deps/glad) | ||
|
||
#glm | ||
find_package(glm REQUIRED) | ||
function(setup_target TARGET) | ||
#Set C++17 | ||
target_compile_features(${TARGET} PUBLIC cxx_std_17) | ||
set_target_properties(${TARGET} PROPERTIES CXX_EXTENSIONS OFF) | ||
|
||
# glad | ||
# https://github.com/aaronmjacobs/InitGL | ||
set(GLAD_DIR "Source/glad") | ||
add_library("glad" "${GLAD_DIR}/glad.c") | ||
target_include_directories("glad" PRIVATE "${GLAD_DIR}") | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${GLM_INCLUDE_DIRS} PRIVATE "${GLAD_DIR}") | ||
target_link_libraries(${PROJECT_NAME} "glad" "${CMAKE_DL_LIBS}") | ||
#Set flags | ||
if(MSVC) | ||
target_compile_options(${TARGET} PRIVATE | ||
/W4 /WX) | ||
else() | ||
target_compile_options(${TARGET} PRIVATE | ||
-Wall -Wextra -pedantic) | ||
endif() | ||
|
||
target_include_directories( | ||
${TARGET} | ||
PRIVATE | ||
deps | ||
) | ||
endfunction(setup_target) | ||
|
||
find_package(Threads) | ||
setup_target(mc-one-week) | ||
|
||
target_link_libraries(mc-one-week Threads::Threads ${EXECUTABLE_NAME} ${SFML_LIBRARIES}) | ||
target_link_libraries(mc-one-week | ||
glm | ||
glad | ||
Threads::Threads | ||
${SFML_LIBRARIES} | ||
${SFML_DEPENDENCIES} | ||
${CMAKE_DL_LIBS} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#include "Context.h" | ||
|
||
#include "glad/glad.h" | ||
#include <glad/glad.h> | ||
|
||
|
||
unsigned int g_X; | ||
unsigned int g_Y; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
renderdistance 8 | ||
renderdistance 16 | ||
fullscreen 0 | ||
windowsize 1280 720 | ||
windowsize 1600 900 | ||
fov 105 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_library(glad | ||
glad.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
file(GLOB ROOT_SOURCE *.cpp) | ||
file(GLOB ROOT_INLINE *.inl) | ||
file(GLOB ROOT_HEADER *.hpp) | ||
file(GLOB ROOT_TEXT ../*.txt) | ||
file(GLOB ROOT_MD ../*.md) | ||
file(GLOB ROOT_NAT ../util/glm.natvis) | ||
|
||
file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) | ||
file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) | ||
file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) | ||
|
||
file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp) | ||
file(GLOB_RECURSE EXT_INLINE ./ext/*.inl) | ||
file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp) | ||
|
||
file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) | ||
file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) | ||
file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) | ||
|
||
file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) | ||
file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) | ||
file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) | ||
|
||
file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp) | ||
file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl) | ||
file(GLOB_RECURSE SIMD_HEADER ./simd/*.h) | ||
|
||
source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) | ||
source_group("Core Files" FILES ${CORE_SOURCE}) | ||
source_group("Core Files" FILES ${CORE_INLINE}) | ||
source_group("Core Files" FILES ${CORE_HEADER}) | ||
source_group("EXT Files" FILES ${EXT_SOURCE}) | ||
source_group("EXT Files" FILES ${EXT_INLINE}) | ||
source_group("EXT Files" FILES ${EXT_HEADER}) | ||
source_group("GTC Files" FILES ${GTC_SOURCE}) | ||
source_group("GTC Files" FILES ${GTC_INLINE}) | ||
source_group("GTC Files" FILES ${GTC_HEADER}) | ||
source_group("GTX Files" FILES ${GTX_SOURCE}) | ||
source_group("GTX Files" FILES ${GTX_INLINE}) | ||
source_group("GTX Files" FILES ${GTX_HEADER}) | ||
source_group("SIMD Files" FILES ${SIMD_SOURCE}) | ||
source_group("SIMD Files" FILES ${SIMD_INLINE}) | ||
source_group("SIMD Files" FILES ${SIMD_HEADER}) | ||
|
||
add_library(glm INTERFACE) | ||
target_include_directories(glm INTERFACE ../) | ||
|
||
if(BUILD_STATIC_LIBS) | ||
add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} | ||
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} | ||
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} | ||
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} | ||
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} | ||
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} | ||
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) | ||
target_link_libraries(glm_static PUBLIC glm) | ||
add_library(glm::glm_static ALIAS glm_static) | ||
endif() | ||
|
||
if(BUILD_SHARED_LIBS) | ||
add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} | ||
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} | ||
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} | ||
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} | ||
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} | ||
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} | ||
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) | ||
target_link_libraries(glm_shared PUBLIC glm) | ||
add_library(glm::glm_shared ALIAS glm_shared) | ||
endif() |
Oops, something went wrong.