This commit is contained in:
BrSh31 2025-11-10 16:20:01 +01:00
commit 3ceecb69f9
7 changed files with 130 additions and 92 deletions

31
.gitignore vendored Normal file
View File

@ -0,0 +1,31 @@
# Ignore CMake build folders
cmake-build-debug/
build/
# CLion project files
.idea/
*.iml
# Executables
*.exe
*.out
*.app
# Object files and libraries
*.o
*.obj
*.a
*.lib
*.so
*.dll
*.dylib
# CMake generated files
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
compile_commands.json
# Temporary files
*.log
*.tmp

113
.idea/workspace.xml generated
View File

@ -28,52 +28,14 @@
</configurations> </configurations>
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="bc14ea44-6152-4afc-90d0-07644981c8ca" name="Changes" comment=""> <list default="true" id="bc14ea44-6152-4afc-90d0-07644981c8ca" name="Changes" comment="otto">
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/query/cache-v2" beforeDir="false" /> <change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/query/codemodel-v2" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/CMakeLists.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/query/toolchains-v1" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/gamecube.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/gamecube.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/cache-v2-26fadb9308b8155ab863.json" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/gamecube.h" beforeDir="false" afterPath="$PROJECT_DIR$/includes/gamecube.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/cache-v2-fbf4a2b9ca92fc7ef85d.json" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/gamematrix.h" beforeDir="false" afterPath="$PROJECT_DIR$/includes/gamematrix.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/cmakeFiles-v1-02c2dc126835d6afc55e.json" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/main.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/cmakeFiles-v1-308a5d6da17c4de0a89b.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-798b7ea5b88f6efe1e96.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-9dea2b442e0ec6147017.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/index-2025-10-26T17-41-38-0649.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/index-2025-10-27T15-44-42-0976.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/target-Prog3B-Debug-5b953e9dac460ea09172.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/target-Prog3B-Debug-792d125264c5420d6d10.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/toolchains-v1-2f427dcd6919a7ef66e5.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.cmake/api/v1/reply/toolchains-v1-6082f31f4c46160119db.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.ninja_deps" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/.ninja_log" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeCache.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CMakeCCompiler.cmake" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CMakeCXXCompiler.cmake" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_C.bin" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CMakeDetermineCompilerABI_CXX.bin" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CMakeRCCompiler.cmake" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CMakeSystem.cmake" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.c" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CompilerIdC/CMakeCCompilerId.o" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CompilerIdC/a.exe" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.cpp" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CompilerIdCXX/CMakeCXXCompilerId.o" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/3.30.5/CompilerIdCXX/a.exe" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/CMakeConfigureLog.yaml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/Prog3B.dir/main.cpp.o" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/TargetDirectories.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/clion-Debug-log.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/clion-environment.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/cmake.check_cache" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeFiles/rules.ninja" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/Prog3B" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/Testing/Temporary/LastTest.log" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/build.ninja" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/cmake_install.cmake" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/cmake-build-debug/compile_commands.json" beforeDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -101,29 +63,34 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;CMake Application.Prog3B.executor&quot;: &quot;Run&quot;, "CMake Application.Prog3B.executor": "Run",
&quot;RunOnceActivity.RadMigrateCodeStyle&quot;: &quot;true&quot;, "RunOnceActivity.RadMigrateCodeStyle": "true",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;, "RunOnceActivity.cidr.known.project.marker": "true",
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;, "RunOnceActivity.git.unshallow": "true",
&quot;RunOnceActivity.readMode.enableVisualFormatting&quot;: &quot;true&quot;, "RunOnceActivity.readMode.enableVisualFormatting": "true",
&quot;RunOnceActivity.west.config.association.type.startup.service&quot;: &quot;true&quot;, "RunOnceActivity.west.config.association.type.startup.service": "true",
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;, "SHARE_PROJECT_CONFIGURATION_FILES": "true",
&quot;cf.first.check.clang-format&quot;: &quot;false&quot;, "cf.first.check.clang-format": "false",
&quot;cidr.known.project.marker&quot;: &quot;true&quot;, "cidr.known.project.marker": "true",
&quot;git-widget-placeholder&quot;: &quot;master&quot;, "git-widget-placeholder": "Merging master",
&quot;last_opened_file_path&quot;: &quot;/Users/bendit.str/Desktop/CLION/PROG_3B&quot;, "last_opened_file_path": "/Users/bendit.str/Desktop/CLION/PROG_3B",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, "nodejs_package_manager_path": "npm",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="RunManager"> <component name="RunManager">
<configuration default="true" type="CLionExternalRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true">
<method v="2">
<option name="CLION.EXTERNAL.BUILD" enabled="true" />
</method>
</configuration>
<configuration name="Prog3B" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Prog3B" TARGET_NAME="Prog3B" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="Prog3B" RUN_TARGET_NAME="Prog3B"> <configuration name="Prog3B" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Prog3B" TARGET_NAME="Prog3B" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="Prog3B" RUN_TARGET_NAME="Prog3B">
<method v="2"> <method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
@ -158,7 +125,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1761580176311</updated> <updated>1761580176311</updated>
</task> </task>
<option name="localTasksCounter" value="3" /> <task id="LOCAL-00003" summary="otto">
<option name="closed" value="true" />
<created>1762787735213</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1762787735214</updated>
</task>
<option name="localTasksCounter" value="4" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -171,6 +146,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="otto" /> <MESSAGE value="otto" />
<option name="LAST_COMMIT_MESSAGE" value="" /> <option name="LAST_COMMIT_MESSAGE" value="otto" />
</component> </component>
</project> </project>

View File

@ -1,39 +1,71 @@
cmake_minimum_required(VERSION 3.28) cmake_minimum_required(VERSION 3.28)
project(Prog3B) project(Prog3B)
set(EXECUTABLE_NAME Prog3B)
set(OS_NAME windows) # Set C++ standard to C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Generate compile_commands.json # Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
# Set the default build type if not specified # Set the default build type if not specified
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif() endif()
set(SRC_FILES # --- Sources & Include directories ---
${CMAKE_CURRENT_LIST_DIR}/main.cpp # Automatically include all .cpp files in the src/ folder
${CMAKE_CURRENT_LIST_DIR}/gamecube.cpp file(GLOB SRC_FILES "src/*.cpp")
)
# Include directories for header files
set(INCLUDE_DIRS set(INCLUDE_DIRS
${CMAKE_CURRENT_LIST_DIR}/linux ${CMAKE_CURRENT_LIST_DIR}/includes
${CMAKE_CURRENT_LIST_DIR}/raylib
) )
add_executable(${EXECUTABLE_NAME} ${SRC_FILES}) # Create the executable target
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${INCLUDE_DIRS}) add_executable(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/${OS_NAME}/libgamematrix.a # Add include directories to the target
${CMAKE_CURRENT_LIST_DIR}/${OS_NAME}/libraylib.a target_include_directories(${PROJECT_NAME} PRIVATE ${INCLUDE_DIRS})
)
# --- Automatic platform detection ---
if (WIN32) if (WIN32)
target_link_libraries(Prog3B PRIVATE winmm) # Windows build
endif() message(STATUS "Building for Windows...")
target_link_libraries(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/windows/libgamematrix.a
${CMAKE_CURRENT_LIST_DIR}/windows/libraylib.a
winmm # Windows multimedia library required by Raylib
)
# Checks if OSX and links appropriate frameworks (Only required on MacOS) elseif(APPLE)
if (APPLE) # macOS build
target_link_libraries(Prog3B "-framework IOKit") message(STATUS "Building for macOS...")
target_link_libraries(Prog3B "-framework Cocoa") if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
target_link_libraries(Prog3B "-framework OpenGL") set(OS_FOLDER "mac_arm")
else()
set(OS_FOLDER "mac_x86")
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/${OS_FOLDER}/libgamematrix.a
${CMAKE_CURRENT_LIST_DIR}/${OS_FOLDER}/libraylib.a
"-framework IOKit" # For device input
"-framework Cocoa" # For windows/UI
"-framework OpenGL" # For rendering
)
elseif(UNIX)
# Linux build
message(STATUS "Building for Linux...")
target_link_libraries(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/linux/libgamematrix.a
${CMAKE_CURRENT_LIST_DIR}/linux/libraylib.a
m pthread dl # Standard Linux libraries
)
else()
# Unsupported OS
message(FATAL_ERROR "Unsupported operating system.")
endif() endif()

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "gamematrix.h" #include "gamematrix.h"
#include "raylib.h" #include "raylib.h"
#include <rlgl.h> #include "rlgl.h"
struct Vec3 //anisch unnötig weil rylib schon vec3 hat struct Vec3 //anisch unnötig weil rylib schon vec3 hat
{ {

View File

@ -1,4 +1,4 @@
#include "gamecube.h" #include "../../prog_3/includes/gamecube.h"
#include <algorithm> #include <algorithm>
#include <ctime> #include <ctime>