diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index ccdff585..cf6b9bad 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -39,13 +39,19 @@ body: label: System options: - New + - Core + - OS - Drawing + - User Interface - Logging - Profiling - Data structures - Memory + - ECS + - Job + - Stats + - Image + - Allocators - Testing - - Operating system services - - Input & Output - Build - Graphics diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8db81172..f274cb1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: run: | set VULKAN_SDK=C:\VulkanSDK\1.3.224.1 cd $GITHUB_WORKSPACE - cd tools + cd scripts python gen_build.py python gen_examples.py cd ../src @@ -68,14 +68,14 @@ jobs: if not exist ../out/pl_ref_renderer_ext.dll exit 1 if not exist ../out/pl_draw_ext.dll exit 1 if not exist ../out/pl_ui_ext.dll exit 1 - if not exist ../out/pl_camera_script.dll exit 1 + if not exist ../out/pl_script_camera.dll exit 1 if not exist ../out/pilotlight.lib exit 1 - name: Package Pilot Light shell: cmd run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python package.py - name: Upload Pilot Light @@ -101,7 +101,7 @@ jobs: - name: Build Pilot Light run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python3 gen_build.py python3 gen_examples.py cd ../src @@ -133,13 +133,13 @@ jobs: test -f ./out/pl_ref_renderer_ext.dylib || exit 1 test -f ./out/pl_draw_ext.dylib || exit 1 test -f ./out/pl_ui_ext.dylib || exit 1 - test -f ./out/pl_camera_script.dylib || exit 1 + test -f ./out/pl_script_camera.dylib || exit 1 test -f ./out/pilotlight.a || exit 1 - name: Package Pilot Light run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python3 package.py - name: Upload Pilot Light @@ -179,7 +179,7 @@ jobs: - name: Build Pilot Light run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python3 gen_build.py python3 gen_examples.py cd ../src @@ -211,13 +211,13 @@ jobs: test -f ./out/pl_ref_renderer_ext.so || exit 1 test -f ./out/pl_draw_ext.so || exit 1 test -f ./out/pl_ui_ext.so || exit 1 - test -f ./out/pl_camera_script.so || exit 1 + test -f ./out/pl_script_camera.so || exit 1 test -f ./out/pilotlight.a || exit 1 - name: Package Pilot Light run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python3 package.py pwd diff --git a/.github/workflows/deploy-build-tool.yml b/.github/workflows/deploy-build-tool.yml index df9c7bf2..ef03f809 100644 --- a/.github/workflows/deploy-build-tool.yml +++ b/.github/workflows/deploy-build-tool.yml @@ -48,7 +48,7 @@ jobs: run: | cd %GITHUB_WORKSPACE% echo ${{ github.event.inputs.version }} > version_number.txt - ren build pilotlight_build + ren pl_build pilotlight_build cd pilotlight_build cd .. move pilotlight_build\deploy_setup.py deploy_setup.py diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 323504e2..95c4a77d 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -60,7 +60,7 @@ jobs: echo "You may use a free license. More information at https://www.viva64.com/en/b/0457/" exit 0 fi - cd tools + cd scripts python3 gen_build.py cd ../src chmod +x build.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2d8ff384..4b90ce56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: shell: cmd run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python gen_tests.py cd ../tests call build.bat -c debug @@ -58,7 +58,7 @@ jobs: - name: Run Tests run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python3 gen_tests.py cd ../tests chmod +x build.sh @@ -94,7 +94,7 @@ jobs: - name: Run Tests run: | cd $GITHUB_WORKSPACE - cd tools + cd scripts python3 gen_tests.py cd ../tests chmod +x build.sh diff --git a/.gitignore b/.gitignore index 5e341a61..2a654d01 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ data/ out/ # python -build/__pycache__/ +pl_build/__pycache__/ # debug files src/*.pdb diff --git a/apps/app.c b/apps/app.c index 13a1a663..f1b109a5 100644 --- a/apps/app.c +++ b/apps/app.c @@ -240,7 +240,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData) ptAppData->tMainCamera = gptEcs->create_perspective_camera(ptMainComponentLibrary, "main camera", (plVec3){-9.6f, 2.096f, 0.86f}, PL_PI_3, ptIO->afMainViewportSize[0] / ptIO->afMainViewportSize[1], 0.1f, 30.0f, &ptMainCamera); gptCamera->set_pitch_yaw(ptMainCamera, -0.245f, 1.816f); gptCamera->update(ptMainCamera); - gptEcs->attach_script(ptMainComponentLibrary, "pl_camera_script", PL_SCRIPT_FLAG_PLAYING, ptAppData->tMainCamera, NULL); + gptEcs->attach_script(ptMainComponentLibrary, "pl_script_camera", PL_SCRIPT_FLAG_PLAYING, ptAppData->tMainCamera, NULL); // create cull camera plCameraComponent* ptCullCamera = NULL; diff --git a/examples/README.md b/examples/README.md index 7b7e9abf..ce7049fa 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,7 +8,7 @@ Next: ### Windows Example for running example 0: ```bash -cd pilotlight/tools +cd pilotlight/scripts python gen_examples.py cd ../examples build.bat @@ -19,7 +19,7 @@ pilot_light.exe -a example_0 ### MacOS & Linux Example for running example 0: ```bash -cd pilotlight/tools +cd pilotlight/scripts python3 gen_examples.py cd ../examples chmod +x build.sh diff --git a/extensions/pl_metal_ext.m b/extensions/pl_graphics_metal.m similarity index 100% rename from extensions/pl_metal_ext.m rename to extensions/pl_graphics_metal.m diff --git a/extensions/pl_vulkan_ext.c b/extensions/pl_graphics_vulkan.c similarity index 100% rename from extensions/pl_vulkan_ext.c rename to extensions/pl_graphics_vulkan.c diff --git a/scripts/pl_camera_script.c b/extensions/pl_script_camera.c similarity index 99% rename from scripts/pl_camera_script.c rename to extensions/pl_script_camera.c index 422b9c4c..8d569d33 100644 --- a/scripts/pl_camera_script.c +++ b/extensions/pl_script_camera.c @@ -77,7 +77,7 @@ pl_script_run(plComponentLibrary* ptLibrary, plEntity tEntity) static const char* pl_script_name(void) { - return "pl_camera_script"; + return "pl_script_camera"; } //----------------------------------------------------------------------------- diff --git a/ui/pl_ui_core.c b/extensions/pl_ui_core.c similarity index 100% rename from ui/pl_ui_core.c rename to extensions/pl_ui_core.c diff --git a/ui/pl_ui_demo.c b/extensions/pl_ui_demo.c similarity index 100% rename from ui/pl_ui_demo.c rename to extensions/pl_ui_demo.c diff --git a/ui/pl_ui_ext.c b/extensions/pl_ui_ext.c similarity index 100% rename from ui/pl_ui_ext.c rename to extensions/pl_ui_ext.c diff --git a/ui/pl_ui_ext.h b/extensions/pl_ui_ext.h similarity index 100% rename from ui/pl_ui_ext.h rename to extensions/pl_ui_ext.h diff --git a/ui/pl_ui_internal.h b/extensions/pl_ui_internal.h similarity index 100% rename from ui/pl_ui_internal.h rename to extensions/pl_ui_internal.h diff --git a/ui/pl_ui_widgets.c b/extensions/pl_ui_widgets.c similarity index 100% rename from ui/pl_ui_widgets.c rename to extensions/pl_ui_widgets.c diff --git a/build/__init__.py b/pl_build/__init__.py similarity index 100% rename from build/__init__.py rename to pl_build/__init__.py diff --git a/build/deploy_setup.py b/pl_build/deploy_setup.py similarity index 96% rename from build/deploy_setup.py rename to pl_build/deploy_setup.py index 9d92a89d..588fd344 100644 --- a/build/deploy_setup.py +++ b/pl_build/deploy_setup.py @@ -33,7 +33,7 @@ def readme(): description='Pilot Light Build', long_description=readme(), long_description_content_type="text/markdown", - url='https://github.com/hoffstadt/pilotlight-build', # Optional + url='https://github.com/PilotLightTech/pilotlight', # Optional packages=['pilotlight_build'], classifiers=[ 'Development Status :: 4 - Beta', diff --git a/build/pl_build.py b/pl_build/pl_build.py similarity index 100% rename from build/pl_build.py rename to pl_build/pl_build.py diff --git a/tools/download_assets.py b/scripts/download_assets.py similarity index 100% rename from tools/download_assets.py rename to scripts/download_assets.py diff --git a/tools/gen_build.py b/scripts/gen_build.py similarity index 94% rename from tools/gen_build.py rename to scripts/gen_build.py index 48fba915..a490ac7b 100644 --- a/tools/gen_build.py +++ b/scripts/gen_build.py @@ -1,7 +1,7 @@ import os import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../build") +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../pl_build") import pl_build as pl @@ -76,7 +76,7 @@ def add_plugin_to_metal_app(name, reloadable, objc = False, binary_name = None, pl.push_profile(pl.Profile.PILOT_LIGHT_DEBUG_C) pl.push_definitions("_USE_MATH_DEFINES", "PL_PROFILING_ON", "PL_ALLOW_HOT_RELOAD", "PL_ENABLE_VALIDATION_LAYERS") - pl.push_include_directories("../apps", "../src", "../ui", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf") + pl.push_include_directories("../apps", "../src", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf") pl.push_link_directories("../out") pl.push_output_directory("../out") @@ -118,7 +118,7 @@ def add_plugin_to_metal_app(name, reloadable, objc = False, binary_name = None, add_plugin_to_vulkan_app("pl_draw_ext", True) add_plugin_to_vulkan_app("pl_debug_ext", False) add_plugin_to_vulkan_app("pl_image_ext", False) - add_plugin_to_vulkan_app("pl_vulkan_ext", False, "pl_graphics_ext") + add_plugin_to_vulkan_app("pl_graphics_vulkan", False, "pl_graphics_ext") add_plugin_to_vulkan_app("pl_stats_ext", False) add_plugin_to_vulkan_app("pl_job_ext", False) add_plugin_to_vulkan_app("pl_model_loader_ext", False) @@ -126,7 +126,7 @@ def add_plugin_to_metal_app(name, reloadable, objc = False, binary_name = None, add_plugin_to_vulkan_app("pl_resource_ext", False) add_plugin_to_vulkan_app("pl_gpu_allocators_ext", False) add_plugin_to_vulkan_app("pl_ref_renderer_ext", True) - add_plugin_to_vulkan_app("pl_ui_ext", True, None, "../ui/") + add_plugin_to_vulkan_app("pl_ui_ext", True, None) add_plugin_to_metal_app("pl_draw_ext", True) add_plugin_to_metal_app("pl_debug_ext", False) @@ -136,14 +136,14 @@ def add_plugin_to_metal_app(name, reloadable, objc = False, binary_name = None, add_plugin_to_metal_app("pl_ecs_ext", True) add_plugin_to_metal_app("pl_model_loader_ext", False) add_plugin_to_metal_app("pl_resource_ext", False) - add_plugin_to_metal_app("pl_metal_ext", False, True, "pl_graphics_ext") + add_plugin_to_metal_app("pl_graphics_metal", False, True, "pl_graphics_ext") add_plugin_to_metal_app("pl_gpu_allocators_ext", False) add_plugin_to_metal_app("pl_ref_renderer_ext", True) - add_plugin_to_metal_app("pl_ui_ext", True, False, None, "../ui/") + add_plugin_to_metal_app("pl_ui_ext", True, False, None) # scripts - add_plugin_to_vulkan_app("pl_camera_script", False, None, "../scripts/") - add_plugin_to_metal_app("pl_camera_script", False, False, None, "../scripts/") + add_plugin_to_vulkan_app("pl_script_camera", False, None) + add_plugin_to_metal_app("pl_script_camera", False, False, None) pl.pop_target_links() diff --git a/tools/gen_examples.py b/scripts/gen_examples.py similarity index 97% rename from tools/gen_examples.py rename to scripts/gen_examples.py index 941f6a24..b55318a6 100644 --- a/tools/gen_examples.py +++ b/scripts/gen_examples.py @@ -1,7 +1,7 @@ import os import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../build") +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../pl_build") import pl_build as pl @@ -51,7 +51,7 @@ def add_example_app(name): pl.push_profile(pl.Profile.PILOT_LIGHT_DEBUG_C) pl.push_definitions("_USE_MATH_DEFINES", "PL_PROFILING_ON", "PL_ALLOW_HOT_RELOAD", "PL_ENABLE_VALIDATION_LAYERS") - pl.push_include_directories("../apps", "../examples", "../src", "../ui", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf") + pl.push_include_directories("../apps", "../examples", "../src", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf") pl.push_link_directories("../out") pl.push_output_directory("../out") diff --git a/tools/gen_tests.py b/scripts/gen_tests.py similarity index 94% rename from tools/gen_tests.py rename to scripts/gen_tests.py index 8c5c17b4..6db65d05 100644 --- a/tools/gen_tests.py +++ b/scripts/gen_tests.py @@ -1,7 +1,7 @@ import os import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../build") +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../pl_build") import pl_build as pl @@ -21,7 +21,7 @@ pl.push_profile(pl.Profile.PILOT_LIGHT_DEBUG_C) pl.push_definitions("_USE_MATH_DEFINES", "PL_PROFILING_ON", "PL_ALLOW_HOT_RELOAD", "PL_ENABLE_VALIDATION_LAYERS") - pl.push_include_directories("../apps", "../src", "../libs", "../extensions", "../backends", "../out", "../dependencies/pilotlight-libs", "../dependencies/stb") + pl.push_include_directories("../apps", "../src", "../libs", "../extensions", "../out", "../dependencies/stb", "../dependencies/cgltf") pl.push_link_directories("../out") pl.push_output_directory("../out") diff --git a/tools/package.py b/scripts/package.py similarity index 87% rename from tools/package.py rename to scripts/package.py index 81748c6d..7519f486 100644 --- a/tools/package.py +++ b/scripts/package.py @@ -12,9 +12,9 @@ target_directory = "../out/pilotlight" +# extensions extensions = [ "pl_debug_ext", - "pl_graphics_ext", "pl_image_ext", "pl_ecs_ext", "pl_stats_ext", @@ -23,7 +23,14 @@ "pl_ref_renderer_ext", "pl_gpu_allocators_ext", "pl_model_loader_ext", - "pl_draw_ext" + "pl_draw_ext", + "pl_graphics_ext", + "pl_ui_ext" +] + +# scripts +scripts = [ + "pl_script_camera" ] if os.path.isdir(target_directory): @@ -53,11 +60,12 @@ shutil.copy("../src/pl_config.h", target_directory + "/include/pl_config.h") shutil.copy("../src/pl_os.h", target_directory + "/include/pl_os.h") -# copy extension headers +# copy simple extension headers for extension in extensions: shutil.copy("../extensions/" + extension + ".h", target_directory + "/include/" + extension + ".h") + +# special headers shutil.copy("../extensions/pl_script_ext.h", target_directory + "/include/pl_script_ext.h") -shutil.copy("../ui/pl_ui_ext.h", target_directory + "/include/pl_ui_ext.h") # copy pilotlight-lib headers shutil.copy("../libs/pl_ds.h", target_directory + "/include/pl_ds.h") @@ -82,6 +90,16 @@ elif platform.system() == "Linux": shutil.copy("../out/" + extension + ".so", target_directory + "/bin/" + extension + ".so") +# copy scripts +for script in scripts: + if platform.system() == "Windows": + shutil.copy("../out/" + script + ".dll", target_directory + "/bin/" + script + ".dll") + elif platform.system() == "Darwin": + shutil.copy("../out/" + script + ".dylib", target_directory + "/bin/" + script + ".dylib") + shutil.copytree("../out/" + script + ".dylib.dSYM", target_directory + "/bin/" + script + ".dylib.dSYM") + elif platform.system() == "Linux": + shutil.copy("../out/" + script + ".so", target_directory + "/bin/" + script + ".so") + # copy libs & executable if platform.system() == "Windows": shutil.copy("../out/pilot_light.exe", target_directory + "/bin/pilot_light.exe") diff --git a/setup.py b/setup.py index fc0ccc50..2d4783c8 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ "${workspaceFolder}/**", "${workspaceFolder}/apps", "${workspaceFolder}/src", - "${workspaceFolder}/ui", "${workspaceFolder}/libs", "${workspaceFolder}/extensions", "${workspaceFolder}/dependencies/stb",