basilisk-engine 0.1.21__py3-none-any.whl → 0.1.22__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 -4
- {basilisk_engine-0.1.21.dist-info → basilisk_engine-0.1.22.dist-info}/METADATA +1 -1
- {basilisk_engine-0.1.21.dist-info → basilisk_engine-0.1.22.dist-info}/RECORD +5 -5
- {basilisk_engine-0.1.21.dist-info → basilisk_engine-0.1.22.dist-info}/WHEEL +0 -0
- {basilisk_engine-0.1.21.dist-info → basilisk_engine-0.1.22.dist-info}/top_level.txt +0 -0
basilisk/engine.py
CHANGED
|
@@ -42,7 +42,7 @@ class Engine():
|
|
|
42
42
|
event_resize: bool
|
|
43
43
|
"""Bool for if a resize event has occured this frame"""
|
|
44
44
|
|
|
45
|
-
def __init__(self, win_size=(800, 800), title="Basilisk Engine", vsync=None, grab_mouse=True, headless=False, resizable=True) -> None:
|
|
45
|
+
def __init__(self, win_size=(800, 800), title="Basilisk Engine", vsync=None, max_fps=None, grab_mouse=True, headless=False, resizable=True) -> None:
|
|
46
46
|
"""
|
|
47
47
|
Basilisk Engine Class. Sets up the engine enviornment and allows the user to interact with Basilisk
|
|
48
48
|
Args:
|
|
@@ -71,6 +71,7 @@ class Engine():
|
|
|
71
71
|
pg.display.gl_set_attribute(pg.GL_CONTEXT_PROFILE_MASK, pg.GL_CONTEXT_PROFILE_CORE)
|
|
72
72
|
# Check vsync against platform defaults
|
|
73
73
|
if vsync == None: vsync = True if platform == 'linux' else False
|
|
74
|
+
self.max_fps = max_fps
|
|
74
75
|
# Pygame display init
|
|
75
76
|
if headless:
|
|
76
77
|
pg.display.set_mode((300, 50), vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF)
|
|
@@ -78,7 +79,9 @@ class Engine():
|
|
|
78
79
|
else:
|
|
79
80
|
if resizable: pg.display.set_mode(self.win_size, vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF | pg.RESIZABLE)
|
|
80
81
|
else: pg.display.set_mode(self.win_size, vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF)
|
|
81
|
-
|
|
82
|
+
|
|
83
|
+
self.caption = title
|
|
84
|
+
if title: pg.display.set_caption(title)
|
|
82
85
|
|
|
83
86
|
# Init sound
|
|
84
87
|
pg.mixer.pre_init(44100, -16, 2, 512)
|
|
@@ -126,9 +129,10 @@ class Engine():
|
|
|
126
129
|
"""
|
|
127
130
|
|
|
128
131
|
# Tick the clock and get delta time
|
|
129
|
-
self.delta_time = self.clock.tick() / 1000
|
|
132
|
+
if self.max_fps: self.delta_time = self.clock.tick(self.max_fps) / 1000
|
|
133
|
+
else: self.delta_time = self.clock.tick() / 1000
|
|
130
134
|
self.time += self.delta_time
|
|
131
|
-
pg.display.set_caption(f"FPS: {round(self.clock.get_fps())}")
|
|
135
|
+
if not self.caption: pg.display.set_caption(f"FPS: {round(self.clock.get_fps())}")
|
|
132
136
|
self.event_resize = False
|
|
133
137
|
|
|
134
138
|
# Update the previous input lists for the next frame
|
|
@@ -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=qfyUk_o0gVrVc-3sCp2qbBNCEx0MsfHI5VbTAVZ9PsE,7441
|
|
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
|
|
@@ -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.22.dist-info/METADATA,sha256=dCFBegbwaCFFRnZnUwmFQq-pK6sgZ3buKRDtLziFL5k,1147
|
|
101
|
+
basilisk_engine-0.1.22.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
102
|
+
basilisk_engine-0.1.22.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
|
|
103
|
+
basilisk_engine-0.1.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|