basilisk-engine 0.1.20__py3-none-any.whl → 0.1.21__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of basilisk-engine might be problematic. Click here for more details.
- basilisk/engine.py +8 -2
- basilisk/render/post_process.py +7 -0
- {basilisk_engine-0.1.20.dist-info → basilisk_engine-0.1.21.dist-info}/METADATA +1 -1
- {basilisk_engine-0.1.20.dist-info → basilisk_engine-0.1.21.dist-info}/RECORD +6 -6
- {basilisk_engine-0.1.20.dist-info → basilisk_engine-0.1.21.dist-info}/WHEEL +0 -0
- {basilisk_engine-0.1.20.dist-info → basilisk_engine-0.1.21.dist-info}/top_level.txt +0 -0
basilisk/engine.py
CHANGED
|
@@ -39,8 +39,10 @@ class Engine():
|
|
|
39
39
|
"""Object containing information about the user's mouse"""
|
|
40
40
|
root: str
|
|
41
41
|
"""Path to the root directory containing internal data"""
|
|
42
|
+
event_resize: bool
|
|
43
|
+
"""Bool for if a resize event has occured this frame"""
|
|
42
44
|
|
|
43
|
-
def __init__(self, win_size=(800, 800), title="Basilisk Engine", vsync=None, grab_mouse=True, headless=False) -> None:
|
|
45
|
+
def __init__(self, win_size=(800, 800), title="Basilisk Engine", vsync=None, grab_mouse=True, headless=False, resizable=True) -> None:
|
|
44
46
|
"""
|
|
45
47
|
Basilisk Engine Class. Sets up the engine enviornment and allows the user to interact with Basilisk
|
|
46
48
|
Args:
|
|
@@ -60,6 +62,7 @@ class Engine():
|
|
|
60
62
|
|
|
61
63
|
# Save the window size
|
|
62
64
|
self.win_size = win_size
|
|
65
|
+
self.event_resize = None
|
|
63
66
|
|
|
64
67
|
pg.init()
|
|
65
68
|
# Initialize pygame and OpenGL attributes
|
|
@@ -73,7 +76,8 @@ class Engine():
|
|
|
73
76
|
pg.display.set_mode((300, 50), vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF)
|
|
74
77
|
pg.display.iconify()
|
|
75
78
|
else:
|
|
76
|
-
pg.display.set_mode(self.win_size, vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF | pg.RESIZABLE)
|
|
79
|
+
if resizable: pg.display.set_mode(self.win_size, vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF | pg.RESIZABLE)
|
|
80
|
+
else: pg.display.set_mode(self.win_size, vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF)
|
|
77
81
|
pg.display.set_caption(title)
|
|
78
82
|
|
|
79
83
|
# Init sound
|
|
@@ -125,6 +129,7 @@ class Engine():
|
|
|
125
129
|
self.delta_time = self.clock.tick() / 1000
|
|
126
130
|
self.time += self.delta_time
|
|
127
131
|
pg.display.set_caption(f"FPS: {round(self.clock.get_fps())}")
|
|
132
|
+
self.event_resize = False
|
|
128
133
|
|
|
129
134
|
# Update the previous input lists for the next frame
|
|
130
135
|
self.previous_keys = self.keys
|
|
@@ -141,6 +146,7 @@ class Engine():
|
|
|
141
146
|
return
|
|
142
147
|
if event.type == pg.VIDEORESIZE:
|
|
143
148
|
# Updates the viewport
|
|
149
|
+
self.event_resize = True
|
|
144
150
|
self.win_size = (event.w, event.h)
|
|
145
151
|
self.ctx.viewport = (0, 0, event.w, event.h)
|
|
146
152
|
self.scene.camera.use()
|
basilisk/render/post_process.py
CHANGED
|
@@ -61,6 +61,13 @@ class PostProcess:
|
|
|
61
61
|
|
|
62
62
|
raise ValueError(f'PostProces.apply: Invalid postprocess source type {type(source)}')
|
|
63
63
|
|
|
64
|
+
def resize(self, size: tuple=None):
|
|
65
|
+
"""
|
|
66
|
+
Resize the post process
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
self.size = size if size else self.engine.win_size
|
|
70
|
+
|
|
64
71
|
def _render_post_process(self, source: mgl.Texture):
|
|
65
72
|
# Clear and use the fbo as a render target
|
|
66
73
|
self.fbo.use()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
basilisk/__init__.py,sha256=nltSEm5HK3aeg1VSkYBEBGLj7DcFzUwt4yZUmEJQ8EM,602
|
|
2
2
|
basilisk/config.py,sha256=ynTRlX633DGoEtZOeAK8KNJF6offV3k3XFD7cia3Keg,61
|
|
3
|
-
basilisk/engine.py,sha256=
|
|
3
|
+
basilisk/engine.py,sha256=ibtObFxYwHUAahXSKsf_523Cn8eZq-Vxrqyx4Ekiuqo,7237
|
|
4
4
|
basilisk/scene.py,sha256=sa8UIV1MH-4OEmlc4geaSHBmzSPRNFS8g5MsO-XjwNA,12153
|
|
5
5
|
basilisk/audio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
basilisk/audio/sound.py,sha256=BjqaPv_07iD_-NDRy1cc0TS4PJzAnQc4hfsW9ntNjGQ,719
|
|
@@ -76,7 +76,7 @@ basilisk/render/light.py,sha256=hFqODv9iK4GEDZeDyBHxOWwwd4v8Pm089_xoScBMjVY,3879
|
|
|
76
76
|
basilisk/render/light_handler.py,sha256=Le5InqqjgglSXUu7MwkVVsb7WbNJeRkRKldYDQGr6kg,2161
|
|
77
77
|
basilisk/render/material.py,sha256=JmmwCxSYkPLHw73bH-7SzPo5ewzbU3QPTIvI_2pInXQ,9655
|
|
78
78
|
basilisk/render/material_handler.py,sha256=dbfQs0u7qkEan0e0FsnqPpxbmkSNAQmH2B9jv4vx-bs,4242
|
|
79
|
-
basilisk/render/post_process.py,sha256=
|
|
79
|
+
basilisk/render/post_process.py,sha256=w71zgvnc1VyQAK7xTAyEe1FsUBDzch_6TrkhxZ27MgA,5098
|
|
80
80
|
basilisk/render/shader.py,sha256=C4LtkAqC_QE1I9ftiFBTsCNM9uv811gOAyriXuqGRKk,3988
|
|
81
81
|
basilisk/render/shader_handler.py,sha256=G3cQ_tTIC_GUa68MP_l_VycMxqfZq2IyZqJQeipmUZk,2579
|
|
82
82
|
basilisk/render/sky.py,sha256=TwLJ_6dYWCOAb06HZocrRdBzlbR6mQ0ojmmJgCC6im4,4910
|
|
@@ -97,7 +97,7 @@ basilisk/shaders/particle.frag,sha256=Cv8cWQpVVQvhZeWj3NqL0D5nLtSO3EWV0VzOU-ZVL4
|
|
|
97
97
|
basilisk/shaders/particle.vert,sha256=ElXzT7ywiZ0SjrFcUistVDBi4wOobQ7_J5O7XVxrsVs,3027
|
|
98
98
|
basilisk/shaders/sky.frag,sha256=vTmZ1Xsd601_gmeBRfLYodHuBoBDI-M_1IybRt0ZDFk,178
|
|
99
99
|
basilisk/shaders/sky.vert,sha256=v_BSdnMiljSJGPqno-J_apAiom38IrBzbDoxM7pIgwI,345
|
|
100
|
-
basilisk_engine-0.1.
|
|
101
|
-
basilisk_engine-0.1.
|
|
102
|
-
basilisk_engine-0.1.
|
|
103
|
-
basilisk_engine-0.1.
|
|
100
|
+
basilisk_engine-0.1.21.dist-info/METADATA,sha256=pGt6cObHl05qjZyPaht52rpz1YPsEdFUOlyvIcQvBD8,1147
|
|
101
|
+
basilisk_engine-0.1.21.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
102
|
+
basilisk_engine-0.1.21.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
|
|
103
|
+
basilisk_engine-0.1.21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|