pyglet 3.0.dev6__py3-none-any.whl → 3.0.dev7__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.
Files changed (92) hide show
  1. pyglet/__init__.py +13 -9
  2. pyglet/app/async_app.py +2 -2
  3. pyglet/app/cocoa.py +5 -9
  4. pyglet/clock.py +1217 -4
  5. pyglet/config/gl/egl.py +1 -1
  6. pyglet/display/cocoa.py +23 -35
  7. pyglet/display/emscripten.py +1 -1
  8. pyglet/display/headless.py +2 -2
  9. pyglet/event.py +4 -4
  10. pyglet/font/__init__.py +5 -4
  11. pyglet/font/base.py +2 -6
  12. pyglet/font/dwrite/__init__.py +5 -4
  13. pyglet/font/fontconfig.py +6 -5
  14. pyglet/font/freetype.py +6 -4
  15. pyglet/font/group.py +20 -21
  16. pyglet/font/pyodide_js.py +5 -3
  17. pyglet/font/quartz.py +52 -20
  18. pyglet/font/user.py +16 -2
  19. pyglet/font/win32.py +173 -79
  20. pyglet/graphics/__init__.py +4 -4
  21. pyglet/graphics/api/gl/cocoa/context.py +0 -4
  22. pyglet/graphics/api/gl/context.py +9 -2
  23. pyglet/graphics/api/gl/egl/context.py +1 -1
  24. pyglet/graphics/api/gl/framebuffer.py +64 -10
  25. pyglet/graphics/api/gl/state.py +3 -5
  26. pyglet/graphics/api/gl2/framebuffer.py +85 -0
  27. pyglet/graphics/api/webgl/__init__.py +1 -1
  28. pyglet/graphics/api/webgl/buffer.py +2 -2
  29. pyglet/graphics/api/webgl/context.py +6 -7
  30. pyglet/graphics/api/webgl/framebuffer.py +59 -21
  31. pyglet/graphics/api/webgl/renderer.py +1 -1
  32. pyglet/graphics/api/webgl/shader.py +1 -1
  33. pyglet/graphics/api/webgl/state.py +3 -6
  34. pyglet/graphics/api/webgl/texture.py +113 -60
  35. pyglet/graphics/draw.py +120 -17
  36. pyglet/graphics/framebuffer.py +419 -6
  37. pyglet/graphics/state.py +67 -1
  38. pyglet/graphics/texture.py +26 -1
  39. pyglet/image/codecs/gdiplus.py +2 -0
  40. pyglet/image/codecs/js_image.py +2 -2
  41. pyglet/input/emscripten/gamepad_js.py +3 -3
  42. pyglet/input/macos/darwin_gc.py +97 -10
  43. pyglet/libs/darwin/cocoapy/cocoalibs.py +5 -0
  44. pyglet/libs/darwin/cocoapy/runtime.py +111 -34
  45. pyglet/libs/linux/egl/__init__.py +2 -0
  46. pyglet/libs/linux/egl/egl.py +1 -1
  47. pyglet/libs/linux/egl/eglext.py +22 -1
  48. pyglet/libs/win32/__init__.py +2 -0
  49. pyglet/libs/win32/types.py +1 -0
  50. pyglet/math.py +62 -14
  51. pyglet/media/__init__.py +112 -4
  52. pyglet/media/codecs/__init__.py +44 -4
  53. pyglet/media/codecs/base.py +28 -5
  54. pyglet/media/codecs/coreaudio.py +6 -4
  55. pyglet/media/codecs/ffmpeg.py +196 -33
  56. pyglet/media/codecs/gstreamer.py +1 -1
  57. pyglet/media/codecs/pyogg.py +1 -1
  58. pyglet/media/codecs/wave.py +1 -1
  59. pyglet/media/codecs/webaudio_pyodide.py +3 -3
  60. pyglet/media/codecs/wmf.py +1 -1
  61. pyglet/media/drivers/base.py +6 -0
  62. pyglet/media/drivers/directsound/adaptation.py +4 -0
  63. pyglet/media/drivers/directsound/interface.py +12 -3
  64. pyglet/media/drivers/openal/adaptation.py +5 -1
  65. pyglet/media/drivers/openal/interface.py +31 -10
  66. pyglet/media/drivers/pulse/adaptation.py +5 -1
  67. pyglet/media/drivers/pulse/interface.py +20 -12
  68. pyglet/media/drivers/pyodide_js/adaptation.py +6 -2
  69. pyglet/media/drivers/silent/adaptation.py +9 -0
  70. pyglet/media/drivers/xaudio2/adaptation.py +4 -0
  71. pyglet/media/drivers/xaudio2/interface.py +14 -3
  72. pyglet/model/codecs/gltf.py +172 -30
  73. pyglet/shapes.py +10 -2
  74. pyglet/text/__init__.py +26 -12
  75. pyglet/text/layout/base.py +70 -39
  76. pyglet/text/layout/incremental.py +4 -3
  77. pyglet/window/__init__.py +13 -13
  78. pyglet/window/camera/base.py +239 -4
  79. pyglet/window/camera/camera2d.py +86 -2
  80. pyglet/window/camera/camera3d.py +58 -15
  81. pyglet/window/cocoa/__init__.py +99 -52
  82. pyglet/window/cocoa/pyglet_delegate.py +4 -2
  83. pyglet/window/cocoa/pyglet_view.py +4 -4
  84. pyglet/window/emscripten/__init__.py +2 -2
  85. pyglet/window/headless/__init__.py +1 -1
  86. {pyglet-3.0.dev6.dist-info → pyglet-3.0.dev7.dist-info}/METADATA +10 -7
  87. {pyglet-3.0.dev6.dist-info → pyglet-3.0.dev7.dist-info}/RECORD +89 -91
  88. pyglet/libs/egl/__init__.py +0 -2
  89. pyglet/libs/egl/egl_lib.py +0 -576
  90. pyglet/libs/egl/eglext.py +0 -63
  91. {pyglet-3.0.dev6.dist-info → pyglet-3.0.dev7.dist-info}/WHEEL +0 -0
  92. {pyglet-3.0.dev6.dist-info → pyglet-3.0.dev7.dist-info}/licenses/LICENSE +0 -0
pyglet/__init__.py CHANGED
@@ -18,10 +18,10 @@ if TYPE_CHECKING:
18
18
  from typing import Any, Callable, ItemsView, Sized
19
19
 
20
20
  #: The release version
21
- version = '3.0.dev6'
21
+ version = '3.0.dev7'
22
22
  __version__ = version
23
23
 
24
- MIN_PYTHON_VERSION = 3, 8
24
+ MIN_PYTHON_VERSION = 3, 10
25
25
  MIN_PYTHON_VERSION_STR = ".".join([str(v) for v in MIN_PYTHON_VERSION])
26
26
 
27
27
  if sys.version_info < MIN_PYTHON_VERSION:
@@ -190,16 +190,20 @@ class Options:
190
190
  """
191
191
 
192
192
  text_shaping: Literal["platform", "harfbuzz", False] = 'platform'
193
- """Determines how text is processed and displayed based on features of the font.
193
+ """Selects the text-shaping backend used by layouts and labels that enable shaping.
194
+
195
+ Individual :class:`~pyglet.text.Label`, :class:`~pyglet.text.HTMLLabel`, and
196
+ :class:`~pyglet.text.DocumentLabel` instances can opt out with ``shaping=False``.
197
+ This option selects the backend; it does not force shaping on every label.
194
198
 
195
199
  Valid option names are:
196
200
 
197
- * ``False``, Disables the shaping process for text. This may increase performance as it reduces the amount
198
- of calls during rendering. If your font is simple, monospaced, or you require no advanced OpenType features,
199
- this option may be useful.
200
- * ``'platform'``, Uses platform's font system for shaping. Supported by Windows (DirectWrite) and Mac (CoreText).
201
- * ``'harfbuzz'``, Utilize the harfbuzz library for font shaping. This requires an optional dependency, if not
202
- found, it will fallback to platform shaping.
201
+ * ``False``, Disables shaping for every layout and label. Prefer ``shaping=False`` on individual labels when
202
+ only frequently-updated text, such as an FPS counter, does not need advanced typography.
203
+ * ``'platform'``, Uses the platform font system for shaping. Supported by Windows (DirectWrite) and Mac
204
+ (CoreText); other platforms use unshaped glyph metrics.
205
+ * ``'harfbuzz'``, Uses the HarfBuzz library for shaping. This is an explicit opt-in because it is an optional
206
+ dependency and can change text metrics. If it is unavailable, pyglet falls back to platform behavior.
203
207
 
204
208
  .. versionadded:: 2.0
205
209
  """
pyglet/app/async_app.py CHANGED
@@ -13,8 +13,8 @@ if TYPE_CHECKING:
13
13
 
14
14
  _is_pyglet_doc_run = hasattr(sys, "is_pyglet_doc_run") and sys.is_pyglet_doc_run
15
15
  try:
16
- from js import requestAnimationFrame, performance
17
- from pyodide.ffi import create_proxy
16
+ from js import requestAnimationFrame, performance # noqa: F821
17
+ from pyodide.ffi import create_proxy # noqa: F821
18
18
  except ImportError:
19
19
  raise ImportError('Pyodide not available.')
20
20
 
pyglet/app/cocoa.py CHANGED
@@ -4,7 +4,7 @@ import signal
4
4
  import time
5
5
 
6
6
  from pyglet import app
7
- from pyglet.app.base import PlatformEventLoop, EventLoop
7
+ from pyglet.app.base import EventLoop, PlatformEventLoop
8
8
  from pyglet.libs.darwin import cocoapy, AutoReleasePool, ObjCSubclass, PyObjectEncoding, ObjCInstance, send_super, \
9
9
  ObjCClass, get_selector, set_realtime_thread_policy
10
10
 
@@ -17,7 +17,6 @@ NSUserDefaults = cocoapy.ObjCClass('NSUserDefaults')
17
17
  NSTimer = cocoapy.ObjCClass('NSTimer')
18
18
  NSRunningApplication = cocoapy.ObjCClass('NSRunningApplication')
19
19
 
20
-
21
20
  def add_menu_item(menu, title, action, key):
22
21
  with AutoReleasePool():
23
22
  title = cocoapy.CFSTR(title)
@@ -29,6 +28,8 @@ def add_menu_item(menu, title, action, key):
29
28
 
30
29
  # cleanup
31
30
  menuItem.release()
31
+ cocoapy.cf.CFRelease(title)
32
+ cocoapy.cf.CFRelease(key)
32
33
 
33
34
 
34
35
  def create_menu():
@@ -157,6 +158,7 @@ class CocoaAlternateEventLoop(EventLoop):
157
158
  if self.platform_event_loop is not None:
158
159
  self.platform_event_loop.nsapp_stop()
159
160
 
161
+
160
162
  class CocoaPlatformEventLoop(PlatformEventLoop):
161
163
 
162
164
  def __init__(self):
@@ -173,17 +175,11 @@ class CocoaPlatformEventLoop(PlatformEventLoop):
173
175
  if not self.NSApp.mainMenu():
174
176
  create_menu()
175
177
  self.NSApp.setActivationPolicy_(cocoapy.NSApplicationActivationPolicyRegular)
176
- # Prevent Lion / Mountain Lion from automatically saving application state.
177
- # If we don't do this, new windows will not display on 10.8 after finishLaunching
178
- # has been called.
179
178
  defaults = NSUserDefaults.standardUserDefaults()
180
- ignoreState = cocoapy.CFSTR("ApplePersistenceIgnoreState")
181
- if not defaults.objectForKey_(ignoreState):
182
- defaults.setBool_forKey_(True, ignoreState)
183
-
184
179
  holdEnabled = cocoapy.CFSTR("ApplePressAndHoldEnabled")
185
180
  if not defaults.objectForKey_(holdEnabled):
186
181
  defaults.setBool_forKey_(False, holdEnabled)
182
+ cocoapy.cf.CFRelease(holdEnabled)
187
183
 
188
184
  self.appdelegate = _AppDelegate.alloc().init(self)
189
185
  self.NSApp.setDelegate_(self.appdelegate)