Skip to content

Commit

Permalink
refac: restructure repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed May 22, 2024
1 parent 6780c65 commit 6bcb9f1
Show file tree
Hide file tree
Showing 26 changed files with 60 additions and 37 deletions.
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
shell: cmd
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python package.py
- name: Upload Pilot Light
Expand All @@ -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
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
- name: Package Pilot Light
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 package.py
- name: Upload Pilot Light
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
- name: Package Pilot Light
run: |
cd $GITHUB_WORKSPACE
cd tools
cd scripts
python3 package.py
pwd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-build-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data/
out/

# python
build/__pycache__/
pl_build/__pycache__/

# debug files
src/*.pdb
Expand Down
2 changes: 1 addition & 1 deletion apps/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

//-----------------------------------------------------------------------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion build/deploy_setup.py → pl_build/deploy_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions tools/gen_build.py → scripts/gen_build.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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", "../extensions/ui", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_link_directories("../out")
pl.push_output_directory("../out")

Expand Down Expand Up @@ -118,15 +118,15 @@ 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)
add_plugin_to_vulkan_app("pl_ecs_ext", True)
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, "../extensions/ui/")

add_plugin_to_metal_app("pl_draw_ext", True)
add_plugin_to_metal_app("pl_debug_ext", False)
Expand All @@ -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, "../extensions/ui/")

# 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()

Expand Down
4 changes: 2 additions & 2 deletions tools/gen_examples.py → scripts/gen_examples.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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", "../extensions/ui", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_link_directories("../out")
pl.push_output_directory("../out")

Expand Down
4 changes: 2 additions & 2 deletions tools/gen_tests.py → scripts/gen_tests.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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", "../extensions/ui", "../out", "../dependencies/stb", "../dependencies/cgltf")
pl.push_link_directories("../out")
pl.push_output_directory("../out")

Expand Down
26 changes: 21 additions & 5 deletions tools/package.py → scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

target_directory = "../out/pilotlight"

# simple extensions
extensions = [
"pl_debug_ext",
"pl_graphics_ext",
"pl_image_ext",
"pl_ecs_ext",
"pl_stats_ext",
Expand All @@ -23,7 +23,8 @@
"pl_ref_renderer_ext",
"pl_gpu_allocators_ext",
"pl_model_loader_ext",
"pl_draw_ext"
"pl_draw_ext",
"pl_graphics_ext",
]

if os.path.isdir(target_directory):
Expand Down Expand Up @@ -53,11 +54,26 @@
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")
shutil.copy("../extensions/ui/pl_ui_ext.h", target_directory + "/include/pl_ui_ext.h")

# special binaries
if platform.system() == "Windows":
shutil.copy("../out/pl_ui_ext.dll", target_directory + "/bin/pl_ui_ext.dll")
shutil.copy("../out/pl_script_camera.dll", target_directory + "/bin/pl_script_camera.dll")
elif platform.system() == "Darwin":
shutil.copy("../out/pl_ui_ext.dylib", target_directory + "/bin/pl_ui_ext.dylib")
shutil.copytree("../out/pl_ui_ext.dylib.dSYM", target_directory + "/bin/pl_ui_ext.dylib.dSYM")
shutil.copy("../out/pl_script_camera.dylib", target_directory + "/bin/pl_script_camera.dylib")
shutil.copytree("../out/pl_script_camera.dylib.dSYM", target_directory + "/bin/pl_script_camera.dylib.dSYM")
elif platform.system() == "Linux":
shutil.copy("../out/pl_ui_ext.so", target_directory + "/bin/pl_ui_ext.so")
shutil.copy("../out/pl_script_camera.so", target_directory + "/bin/pl_script_camera.so")

# copy pilotlight-lib headers
shutil.copy("../libs/pl_ds.h", target_directory + "/include/pl_ds.h")
Expand All @@ -72,7 +88,7 @@
# copy stb libs
shutil.copy("../dependencies/stb/stb_sprintf.h", target_directory + "/include/stb_sprintf.h")

# copy extensions
# copy simple extensions
for extension in extensions:
if platform.system() == "Windows":
shutil.copy("../out/" + extension + ".dll", target_directory + "/bin/" + extension + ".dll")
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
"${workspaceFolder}/**",
"${workspaceFolder}/apps",
"${workspaceFolder}/src",
"${workspaceFolder}/ui",
"${workspaceFolder}/libs",
"${workspaceFolder}/extensions",
"${workspaceFolder}/extensions/ui",
"${workspaceFolder}/extensions/scripts",
"${workspaceFolder}/dependencies/stb",
"${workspaceFolder}/dependencies/cgltf",
"${env:VK_SDK_PATH}/Include"
Expand Down

0 comments on commit 6bcb9f1

Please sign in to comment.