Fix cmake #7

Merged
williamistGitHub merged 4 commits from fix-cmake into main 2024-10-18 22:58:58 +00:00
4 changed files with 11 additions and 4 deletions

View File

@ -18,5 +18,9 @@ add_custom_target(copy_assets ALL
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# global dependency directories
include_directories(../Dependencies/include/)
link_directories(../Dependencies/lib/)
add_subdirectory(vendor/imgui)
add_subdirectory(src)

View File

@ -4,6 +4,7 @@ add_executable(scuffed_mc
Camera.cpp Planet.cpp WorldGen.cpp ../vendor/glad.c
)
include_directories(../../Dependencies/include/)
# make sure the program runs in the right place from visual studio
set_target_properties(scuffed_mc PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
target_link_libraries(scuffed_mc imgui glfw)
target_link_libraries(scuffed_mc imgui $<IF:$<PLATFORM_ID:Windows>,glfw3,glfw>)

View File

@ -6,6 +6,8 @@
Planet* Planet::planet = nullptr;
const unsigned int Planet::chunkSize = 32;
// Public
Planet::Planet(Shader* solidShader, Shader* waterShader, Shader* billboardShader)
: solidShader(solidShader), waterShader(waterShader), billboardShader(billboardShader)

View File

@ -25,7 +25,7 @@ public:
public:
static Planet* planet;
unsigned int numChunks = 0, numChunksRendered = 0;
static const unsigned int chunkSize = 32;
static const unsigned int chunkSize;
private:
std::unordered_map<std::tuple<int, int, int>, Chunk> chunks;