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.
- pyglet/__init__.py +13 -9
- pyglet/app/async_app.py +2 -2
- pyglet/app/cocoa.py +5 -9
- pyglet/clock.py +1217 -4
- pyglet/config/gl/egl.py +1 -1
- pyglet/display/cocoa.py +23 -35
- pyglet/display/emscripten.py +1 -1
- pyglet/display/headless.py +2 -2
- pyglet/event.py +4 -4
- pyglet/font/__init__.py +5 -4
- pyglet/font/base.py +2 -6
- pyglet/font/dwrite/__init__.py +5 -4
- pyglet/font/fontconfig.py +6 -5
- pyglet/font/freetype.py +6 -4
- pyglet/font/group.py +20 -21
- pyglet/font/pyodide_js.py +5 -3
- pyglet/font/quartz.py +52 -20
- pyglet/font/user.py +16 -2
- pyglet/font/win32.py +173 -79
- pyglet/graphics/__init__.py +4 -4
- pyglet/graphics/api/gl/cocoa/context.py +0 -4
- pyglet/graphics/api/gl/context.py +9 -2
- pyglet/graphics/api/gl/egl/context.py +1 -1
- pyglet/graphics/api/gl/framebuffer.py +64 -10
- pyglet/graphics/api/gl/state.py +3 -5
- pyglet/graphics/api/gl2/framebuffer.py +85 -0
- pyglet/graphics/api/webgl/__init__.py +1 -1
- pyglet/graphics/api/webgl/buffer.py +2 -2
- pyglet/graphics/api/webgl/context.py +6 -7
- pyglet/graphics/api/webgl/framebuffer.py +59 -21
- pyglet/graphics/api/webgl/renderer.py +1 -1
- pyglet/graphics/api/webgl/shader.py +1 -1
- pyglet/graphics/api/webgl/state.py +3 -6
- pyglet/graphics/api/webgl/texture.py +113 -60
- pyglet/graphics/draw.py +120 -17
- pyglet/graphics/framebuffer.py +419 -6
- pyglet/graphics/state.py +67 -1
- pyglet/graphics/texture.py +26 -1
- pyglet/image/codecs/gdiplus.py +2 -0
- pyglet/image/codecs/js_image.py +2 -2
- pyglet/input/emscripten/gamepad_js.py +3 -3
- pyglet/input/macos/darwin_gc.py +97 -10
- pyglet/libs/darwin/cocoapy/cocoalibs.py +5 -0
- pyglet/libs/darwin/cocoapy/runtime.py +111 -34
- pyglet/libs/linux/egl/__init__.py +2 -0
- pyglet/libs/linux/egl/egl.py +1 -1
- pyglet/libs/linux/egl/eglext.py +22 -1
- pyglet/libs/win32/__init__.py +2 -0
- pyglet/libs/win32/types.py +1 -0
- pyglet/math.py +62 -14
- pyglet/media/__init__.py +112 -4
- pyglet/media/codecs/__init__.py +44 -4
- pyglet/media/codecs/base.py +28 -5
- pyglet/media/codecs/coreaudio.py +6 -4
- pyglet/media/codecs/ffmpeg.py +196 -33
- pyglet/media/codecs/gstreamer.py +1 -1
- pyglet/media/codecs/pyogg.py +1 -1
- pyglet/media/codecs/wave.py +1 -1
- pyglet/media/codecs/webaudio_pyodide.py +3 -3
- pyglet/media/codecs/wmf.py +1 -1
- pyglet/media/drivers/base.py +6 -0
- pyglet/media/drivers/directsound/adaptation.py +4 -0
- pyglet/media/drivers/directsound/interface.py +12 -3
- pyglet/media/drivers/openal/adaptation.py +5 -1
- pyglet/media/drivers/openal/interface.py +31 -10
- pyglet/media/drivers/pulse/adaptation.py +5 -1
- pyglet/media/drivers/pulse/interface.py +20 -12
- pyglet/media/drivers/pyodide_js/adaptation.py +6 -2
- pyglet/media/drivers/silent/adaptation.py +9 -0
- pyglet/media/drivers/xaudio2/adaptation.py +4 -0
- pyglet/media/drivers/xaudio2/interface.py +14 -3
- pyglet/model/codecs/gltf.py +172 -30
- pyglet/shapes.py +10 -2
- pyglet/text/__init__.py +26 -12
- pyglet/text/layout/base.py +70 -39
- pyglet/text/layout/incremental.py +4 -3
- pyglet/window/__init__.py +13 -13
- pyglet/window/camera/base.py +239 -4
- pyglet/window/camera/camera2d.py +86 -2
- pyglet/window/camera/camera3d.py +58 -15
- pyglet/window/cocoa/__init__.py +99 -52
- pyglet/window/cocoa/pyglet_delegate.py +4 -2
- pyglet/window/cocoa/pyglet_view.py +4 -4
- pyglet/window/emscripten/__init__.py +2 -2
- pyglet/window/headless/__init__.py +1 -1
- {pyglet-3.0.dev6.dist-info → pyglet-3.0.dev7.dist-info}/METADATA +10 -7
- {pyglet-3.0.dev6.dist-info → pyglet-3.0.dev7.dist-info}/RECORD +89 -91
- pyglet/libs/egl/__init__.py +0 -2
- pyglet/libs/egl/egl_lib.py +0 -576
- pyglet/libs/egl/eglext.py +0 -63
- {pyglet-3.0.dev6.dist-info → pyglet-3.0.dev7.dist-info}/WHEEL +0 -0
- {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.
|
|
21
|
+
version = '3.0.dev7'
|
|
22
22
|
__version__ = version
|
|
23
23
|
|
|
24
|
-
MIN_PYTHON_VERSION = 3,
|
|
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
|
-
"""
|
|
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
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
* ``'harfbuzz'``,
|
|
202
|
-
|
|
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
|
|
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)
|