Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions arcade/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import pyglet.config
import pyglet.window.mouse
from pyglet.config import GraphicsAPI
from pyglet.display.base import Screen, ScreenMode
from pyglet.event import EVENT_HANDLE_STATE, EVENT_UNHANDLED
from pyglet.window import MouseCursor
Expand Down Expand Up @@ -211,15 +212,21 @@ def __init__(
self._pixel_perfect: bool = pixel_perfect
"""If True, ignore OS DPI scaling and use a 1:1 pixel ratio."""

_GL_API_MAP = {
"opengl": GraphicsAPI.OPENGL,
"opengles": GraphicsAPI.OPENGL_ES_3,
}

config = None
# Attempt to make window with antialiasing
if gl_api == "opengl" or gl_api == "opengles":
graphics_api = _GL_API_MAP[gl_api]
if antialiasing:
try:
config = pyglet.config.OpenGLConfig(
config = pyglet.config.OpenGLUserConfig(
major_version=gl_version[0],
minor_version=gl_version[1],
opengl_api=gl_api.replace("open", ""), # type: ignore # pending: upstream fix
api=graphics_api,
double_buffer=True,
sample_buffers=1,
samples=samples,
Expand All @@ -236,10 +243,10 @@ def __init__(
antialiasing = False
# If we still don't have a config
if not config:
config = pyglet.config.OpenGLConfig(
config = pyglet.config.OpenGLUserConfig(
major_version=gl_version[0],
minor_version=gl_version[1],
opengl_api=gl_api.replace("open", ""), # type: ignore # pending: upstream fix
api=graphics_api,
double_buffer=True,
depth_size=24,
stencil_size=8,
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/gui/exp_controller_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import pyglet.font
from pyglet.event import EVENT_HANDLED
from pyglet.gl import GL_NEAREST
from pyglet.graphics.api.gl import GL_NEAREST
Comment thread
Cleptomania marked this conversation as resolved.
Outdated
from pyglet.input import Controller

import arcade
Expand Down
2 changes: 1 addition & 1 deletion arcade/future/video/video_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class VideoPlayer:
def __init__(self, path: str | Path, loop: bool = False):
self.player = pyglet.media.VideoPlayer()
self.player.loop = loop
self.player.queue(pyglet.media.load(str(arcade.resources.resolve(path))))
self.player.queue(pyglet.media.load_video(str(arcade.resources.resolve(path))))
self.player.play()

self.ctx = arcade.get_window().ctx
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/backends/opengl/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def get(self, enum, default=0) -> int:
value = c_int()
gl.glGetIntegerv(enum, value)
return value.value
except pyglet.gl.lib.GLException:
except gl.lib.GLException:
return default

def get_float(self, enum, default=0.0) -> float:
Expand Down
2 changes: 1 addition & 1 deletion arcade/gl/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def blend_func(self) -> Tuple[int, int] | Tuple[int, int, int, int]:

These enums can be accessed in the ``arcade.gl``
module or simply as attributes of the context object.
The raw enums from ``pyglet.gl`` can also be used.
The raw enums from ``pyglet.graphics.api.gl`` can also be used.

Example::

Expand Down
2 changes: 1 addition & 1 deletion arcade/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, file_name: str | Path, streaming: bool = False):
raise FileNotFoundError(f"The sound file '{file_name}' is not a file or can't be read.")
self.file_name = str(file_name)

self.source: Source = media.load(self.file_name, streaming=streaming)
self.source: Source = media.load_audio(self.file_name, streaming=streaming)
"""
The :py:class:`pyglet.media.Source` object that holds the audio data.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
dependencies = [
"pillow>=11.3.0",
"pytiled-parser~=2.2.9",
"pyglet==3.0.dev2",
"pyglet==3.0.dev3",
]
dynamic = ["version"]

Expand Down
Loading