Initial commit

This commit is contained in:
2024-06-13 03:30:06 -04:00
commit bf03df8f52
7 changed files with 66 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
/cmake-build-debug
/.idea
/include/Re3D/*
!/include/Re3D/
!/include/Re3D/.gitkeep

36
CMakeLists.txt Normal file
View File

@@ -0,0 +1,36 @@
#TODO this is a massive hack. I'm surprised it even works at-all. But Re3D's dependencies weren't passing through in a nice way when using CPM.
cmake_minimum_required(VERSION 3.18)
project(Re3DExampleProject)
set(CMAKE_CXX_STANDARD 20)
file(GLOB_RECURSE HEADERS "include/*.h")
file(GLOB_RECURSE SOURCES "src/*.cpp")
#Copy assets & cfg to build directory.
file(COPY "assets" DESTINATION "${PROJECT_BINARY_DIR}")
file(COPY "cfg" DESTINATION "${PROJECT_BINARY_DIR}")
include_directories("include" "include/Re3D" "include/Re3D/Re3D")
if(UNIX AND NOT APPLE)
#build Re3D and copy the lib directory to the build dir.
execute_process(
COMMAND bash -c "git clone https://git.redacted.cc/Redacted/Re3D.git && cd Re3D && mkdir build && cd build && cmake .. && make -j$(nproc) && mv lib/ ../../"
)
#Copy the headers to include/Re3D
execute_process(
COMMAND bash -c "cd Re3D/include && mkdir Re3D && mv engine types Re3D && mv Re3D ${CMAKE_SOURCE_DIR}/include/Re3D && cd ../build/_deps && mv archive-src/include/archive.h event-src/include/Event.h event-src/include/EventConnection.h ${CMAKE_SOURCE_DIR}/include/Re3D && mv collage-src/include/Collage glad-src/include/glad glad-src/include/KHR j3ml-src/include/J3ML jgl-src/include/JGL rehardwareid-src/include/reHardwareID retexture-src/include/ReTexture rewindow-src/include/rewindow uuid-src/include/uuid ${CMAKE_SOURCE_DIR}/include/Re3D"
)
#Delete the Re3D directory in the build directory.
execute_process(COMMAND bash -c "rm -rf Re3D/")
endif()
add_executable(Re3DExampleProject ${SOURCES} ${HEADERS} main.cpp)
set_target_properties(Re3DExampleProject PROPERTIES LINKER_LANGUAGE CXX)
#Link based on relative path.
set_target_properties(Re3DExampleProject PROPERTIES BUILD_RPATH "\$ORIGIN/lib")
target_link_libraries(Re3DExampleProject PUBLIC ${CMAKE_BINARY_DIR}/lib/libRe3D.so ${CMAKE_BINARY_DIR}/lib/libJ3ML.so ${CMAKE_BINARY_DIR}/lib/libReWindowLibrary.so ${CMAKE_BINARY_DIR}/lib/libReHardwareID.so ${CMAKE_BINARY_DIR}/lib/libReTexture.so ${CMAKE_BINARY_DIR}/lib/libglad.so ${CMAKE_BINARY_DIR}/lib/libCollage.so ${CMAKE_BINARY_DIR}/lib/libJGL.so ${CMAKE_BINARY_DIR}/lib/libarchive.so ${CMAKE_BINARY_DIR}/lib/libEvent.so)

10
LICENSE Normal file
View File

@@ -0,0 +1,10 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

0
assets/.gitkeep Normal file
View File

5
cfg/engine.cfg Normal file
View File

@@ -0,0 +1,5 @@
Fullscreen: 0
Resolution: 1152 864
Debug: 1
CameraFOV: 72.5

0
include/Re3D/.gitkeep Normal file
View File

10
main.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include <Re3D/engine/engine.h>
int main() {
engine->window = new ReWindow::RWindow("Re3D Test Application", 1152, 864, RenderingAPI::OPENGL);
engine->world = new(World);
engine->init();
engine->window->setVsyncEnabled(false);
engine->window->setResizable(false);
engine->renderLoop();
}