Skip to content

Commit 4ad2714

Browse files
committed
WIP
1 parent 311cda7 commit 4ad2714

18 files changed

Lines changed: 1459 additions & 50 deletions

.vscode/c_cpp_properties.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"${workspaceFolder}/**",
77
"${workspaceFolder}/src",
88
"${workspaceFolder}/../pilotlight/libs",
9+
"${workspaceFolder}/../pilotlight/extensions",
10+
"${workspaceFolder}/../pilotlight/src",
11+
"${workspaceFolder}/../pilotlight/dependencies/stb",
12+
"${workspaceFolder}/../pilotlight/dependencies/glfw/include",
913
"${workspaceFolder}/dependencies/cpython",
1014
"${workspaceFolder}/dependencies/cpython/Include",
1115
"${workspaceFolder}/dependencies/cpython/PC"

pilotlight/_pilotlight.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from typing import List, Any, Callable, Union, Tuple
2+
import pilotlight._pilotlight as internal
3+
##########################################################
4+
# This file is generated automatically #
5+
##########################################################
6+
7+
def pilotlight_setup(**kwargs) -> None:
8+
"""Testing pilotlight_setup"""
9+
10+
return internal.pilotlight_setup(**kwargs)
11+
12+
def pilotlight_begin_frame(**kwargs) -> bool:
13+
"""Testing pilotlight_begin_frame"""
14+
15+
return internal.pilotlight_begin_frame(**kwargs)
16+
17+
def pilotlight_window_create(**kwargs) -> None:
18+
"""Testing pilotlight_window_create"""
19+
20+
return internal.pilotlight_window_create(**kwargs)
21+
22+
def pilotlight_io_new_frame(**kwargs) -> None:
23+
"""Testing pilotlight_io_new_frame"""
24+
25+
return internal.pilotlight_io_new_frame(**kwargs)
26+
27+
def pilotlight_io_is_key_pressed(key : int, **kwargs) -> bool:
28+
"""Testing Documentation"""
29+
30+
return internal.pilotlight_io_is_key_pressed(key, **kwargs)
31+

pilotlight/_pilotlight.pyi

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from typing import List, Any, Callable, Union, Tuple
2+
from pilotlight._pilotlight import *
3+
##########################################################
4+
# This file is generated automatically #
5+
##########################################################
6+
7+
def pilotlight_setup() -> None:
8+
"""Testing pilotlight_setup"""
9+
...
10+
11+
def pilotlight_begin_frame() -> bool:
12+
"""Testing pilotlight_begin_frame"""
13+
...
14+
15+
def pilotlight_window_create() -> None:
16+
"""Testing pilotlight_window_create"""
17+
...
18+
19+
def pilotlight_io_new_frame() -> None:
20+
"""Testing pilotlight_io_new_frame"""
21+
...
22+
23+
def pilotlight_io_is_key_pressed(pilotlight_io_is_key_pressed : int) -> bool:
24+
"""Testing Documentation"""
25+
...
26+

pilotlight/_starter.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import List, Any, Callable, Union, Tuple
2+
import pilotlight._starter as internal
3+
##########################################################
4+
# This file is generated automatically #
5+
##########################################################
6+
7+
def starter_begin_frame(**kwargs) -> None:
8+
"""Testing starter_begin_frame"""
9+
10+
return internal.starter_begin_frame(**kwargs)
11+

pilotlight/_starter.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from typing import List, Any, Callable, Union, Tuple
2+
from pilotlight._starter import *
3+
##########################################################
4+
# This file is generated automatically #
5+
##########################################################
6+
7+
def starter_begin_frame() -> None:
8+
"""Testing starter_begin_frame"""
9+
...
10+

pilotlight/pilotlight.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
import pilotlight._pilotlight as internal_pilotlight
22

3-
def func0():
4-
internal_pilotlight.func0()
3+
class plIOI:
54

6-
def func1():
7-
return internal_pilotlight.func1()
5+
def new_frame():
6+
return internal_pilotlight.pilotlight_io_new_frame()
87

9-
def func2(x, y):
10-
return internal_pilotlight.func2(x, y)
8+
def is_key_pressed(key):
9+
return internal_pilotlight.pilotlight_io_is_key_pressed(key)
10+
11+
12+
class plWindowI:
13+
14+
def create():
15+
return internal_pilotlight.pilotlight_window_create()
16+
17+
18+
def run(app):
19+
20+
internal_pilotlight.pilotlight_setup()
21+
22+
app.pl_app_load()
23+
24+
while True:
25+
if internal_pilotlight.pilotlight_begin_frame():
26+
app.pl_app_update()
27+
else:
28+
app.pl_app_resize()
29+
30+
app.pl_app_shutdown()

sandbox/app.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import pilotlight.pilotlight as pl
2+
from pilotlight.pilotlight import plIOI
3+
from pilotlight.pilotlight import plWindowI
4+
5+
class App:
6+
7+
def __init__(self):
8+
self.ptWindow = None
9+
10+
def pl_app_load(self):
11+
plWindowI.create()
12+
13+
def pl_app_shutdown(self):
14+
print("shutting down")
15+
16+
def pl_app_resize(self):
17+
print("resizing")
18+
19+
def pl_app_update(self):
20+
plIOI.new_frame()
21+
if plIOI.is_key_pressed(561):
22+
print("P key pressed!")
23+
24+
pl.run(App())

sandbox/main.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/gen_build.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
# project wide settings
3030
pl.set_output_directory("../out")
31-
pl.add_link_directories("../out")
31+
pl.add_link_directories("../out", "../../pilotlight/out")
3232
pl.add_definitions("_USE_MATH_DEFINES")
3333
pl.add_include_directories("../src")
3434

@@ -40,21 +40,27 @@
4040

4141
pl.add_include_directories(
4242
"../../pilotlight/libs",
43+
"../../pilotlight/extensions",
44+
"../../pilotlight/src",
45+
"../../pilotlight/dependencies/stb",
46+
"../../pilotlight/dependencies/glfw/include/",
4347
"../dependencies/cpython/",
4448
"../dependencies/cpython/Include/",
4549
"../dependencies/cpython/PC/"
4650
)
4751

48-
pl.add_source_files("main.c")
52+
pl.add_source_files("main.c", "unity.c")
4953
pl.set_output_binary("pilotlight_python")
5054

5155
with pl.configuration("debug"):
5256

5357
# win32
5458
with pl.platform("Windows"):
5559
with pl.compiler("msvc"):
56-
pl.add_link_directories("../dependencies/cpython/PCbuild/amd64/")
57-
pl.add_linker_flags("-noimplib", "-noexp", "-incremental:no")
60+
pl.add_static_link_libraries("user32", "Shell32", "Ole32", "gdi32", "ucrtd")
61+
pl.add_static_link_libraries("shaderc_combined", "spirv-cross-c-shared", "vulkan-1", "glfwd")
62+
pl.add_link_directories("../dependencies/cpython/PCbuild/amd64/", '%VULKAN_SDK%\\Lib')
63+
pl.add_linker_flags("-noimplib", "-noexp", "-incremental:no", "-nodefaultlib:MSVCRT")
5864
pl.add_compiler_flags("-Zc:preprocessor", "-nologo", "-std:c11", "-W4", "-WX", "-wd4201",
5965
"-wd4100", "-wd4996", "-wd4505", "-wd4189", "-wd5105", "-wd4115",
6066
"-permissive-", "-Od", "-MDd", "-Zi")
@@ -64,6 +70,7 @@
6470
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python3.dll" "..\\out\\" >nul\n'
6571
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python3_d.dll" "..\\out\\" >nul\n'
6672
)
73+
6774

6875
#-----------------------------------------------------------------------------
6976
# [SECTION] examples
@@ -73,6 +80,8 @@
7380

7481
pl.add_include_directories(
7582
"../../pilotlight/libs",
83+
"../../pilotlight/extensions",
84+
"../../pilotlight/src",
7685
"../dependencies/cpython/",
7786
"../dependencies/cpython/Include/",
7887
"../dependencies/cpython/PC/"

0 commit comments

Comments
 (0)