basilisk-engine 0.1.8__py3-none-any.whl → 0.1.9__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/audio/sound.py CHANGED
@@ -1,5 +1,5 @@
1
1
  import os
2
- import openal
2
+ import pygame as pg
3
3
 
4
4
  class Sound:
5
5
  def __init__(self, path: str | os.PathLike):
@@ -10,14 +10,14 @@ class Sound:
10
10
  if not (isinstance(path, str) or isinstance(path, os.PathLike)):
11
11
  raise ValueError(f'bsk.Sound: Invalid source path type {type(path)}. Expected string or os.PathLike')
12
12
 
13
- self.source = openal.oalOpen(path)
13
+ self.source = pg.mixer.Sound(path)
14
14
 
15
15
  def play(self, volume: float=1.0):
16
16
  """
17
17
  Play the sound at the given volume level. Full volume if none given
18
18
  """
19
19
 
20
- self.source.set_gain(volume)
20
+ self.source.set_volume(volume)
21
21
  self.source.play()
22
22
 
23
23
  def stop(self):
@@ -25,8 +25,4 @@ class Sound:
25
25
  Stops the sound
26
26
  """
27
27
 
28
- self.source.stop()
29
-
30
- @property
31
- def isplaying(self):
32
- return self.source.get_state() == openal.AL_PLAYING
28
+ self.source.stop()
basilisk/engine.py CHANGED
@@ -11,7 +11,6 @@ from .input.mouse import Mouse
11
11
  from .mesh.cube import Cube
12
12
  from .render.shader import Shader
13
13
  import glcontext
14
- import openal
15
14
 
16
15
  class Engine():
17
16
  win_size: tuple
@@ -76,6 +75,12 @@ class Engine():
76
75
  else:
77
76
  pg.display.set_mode(self.win_size, vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF | pg.RESIZABLE)
78
77
  pg.display.set_caption(title)
78
+
79
+ # Init sound
80
+ pg.mixer.pre_init(44100, -16, 2, 512)
81
+ pg.mixer.init()
82
+ pg.mixer.set_num_channels(64)
83
+ pg.mixer.music.set_volume(100/100)
79
84
 
80
85
  # MGL context setup
81
86
  self.ctx = mgl.create_context()
@@ -132,7 +137,6 @@ class Engine():
132
137
  # Loop through all pygame events
133
138
  for event in self.events:
134
139
  if event.type == pg.QUIT: # Quit the engine
135
- openal.oalQuit()
136
140
  self.quit()
137
141
  return
138
142
  if event.type == pg.VIDEORESIZE:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: basilisk-engine
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Python 3D Framework
5
5
  Home-page: https://basilisk-website.vercel.app/
6
6
  Author: Name
@@ -12,7 +12,6 @@ Requires-Dist: pygame-ce
12
12
  Requires-Dist: moderngl
13
13
  Requires-Dist: PyGLM
14
14
  Requires-Dist: numba
15
- Requires-Dist: PyOpenAL
16
15
 
17
16
  # Basilisk Engine
18
17
  ![image](https://github.com/user-attachments/assets/5e39445c-e0da-452c-9f18-e590cca948c4)
@@ -1,9 +1,9 @@
1
1
  basilisk/__init__.py,sha256=38Rmitj-4yslVnv6Gik9AHoArXMvCJRh4HcoZVKK48c,545
2
2
  basilisk/config.py,sha256=ynTRlX633DGoEtZOeAK8KNJF6offV3k3XFD7cia3Keg,61
3
- basilisk/engine.py,sha256=1a7aGZW2IRp-h-XO15CLWzZtwFC3SXXp0OOOil3r4II,6774
3
+ basilisk/engine.py,sha256=y15OdTsTjDk51Q06nLkVOx4KlJVM_6_owGdSGh92gBQ,6912
4
4
  basilisk/scene.py,sha256=RCrN0mD0vbZFAf4wY2D5D6okefMaZ-Q0t8Ls7YQGFnw,11602
5
5
  basilisk/audio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- basilisk/audio/sound.py,sha256=YiVYnFY6KYc3f6Q39qvrEEzoLBk9LY90ijkytKWx1kw,815
6
+ basilisk/audio/sound.py,sha256=BjqaPv_07iD_-NDRy1cc0TS4PJzAnQc4hfsW9ntNjGQ,719
7
7
  basilisk/bsk_assets/Roboto-Regular.ttf,sha256=kqYnZjMRQMpbyLulIChCLSdgYa1XF8GsUIoRi2Gcauw,168260
8
8
  basilisk/bsk_assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  basilisk/bsk_assets/basilisk.png,sha256=1xePD8qDycxlRQ7hjEmfuw900BRykhRyumJePi6hxi8,21299
@@ -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.8.dist-info/METADATA,sha256=q2Wa8lTvRYHG1T4jUW2fw1uYhbqMjgG-rP5EpxWLZjk,1171
101
- basilisk_engine-0.1.8.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
102
- basilisk_engine-0.1.8.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
103
- basilisk_engine-0.1.8.dist-info/RECORD,,
100
+ basilisk_engine-0.1.9.dist-info/METADATA,sha256=h1Q6Ltn2WzgCrewFwg6q1zW4CmWGuj-HxKxWhYGoJlA,1146
101
+ basilisk_engine-0.1.9.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
102
+ basilisk_engine-0.1.9.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
103
+ basilisk_engine-0.1.9.dist-info/RECORD,,