pyglet is a cross-platform windowing and multimedia library for Python, for developing games and other visually rich applications.

Overview

pypi rtd

logo_large.png

pyglet

pyglet is a cross-platform windowing and multimedia library for Python, intended for developing games and other visually rich applications. It supports windowing, user interface event handling, Joysticks, OpenGL graphics, loading images and videos, and playing sounds and music. pyglet works on Windows, OS X and Linux.

NOTE! The pyglet-1.5-maintenance branch is the current stable release. The master branch contains the the development code for the upcoming 2.0 release, and may be unstable. If you want to do a pull request, please target the pyglet-1.5-maintenance branch where appropriate.

Pyglet has an active developer and user community. If you find a bug or a problem with the documentation, please open an issue. Anyone is welcome to join our discord server where a lot of the development discussion is going on. It's also a great place to ask for help.

Some of the features of pyglet are:

  • No external dependencies or installation requirements. For most application and game requirements, pyglet needs nothing else besides Python, simplifying distribution and installation. It's easy to package your project with freezers such as PyInstaller.
  • Take advantage of multiple windows and multi-monitor desktops. pyglet allows you to use multiple platform-native windows, and is fully aware of multi-monitor setups for use with fullscreen games.
  • Load images, sound, music and video in almost any format. pyglet can optionally use FFmpeg to play back audio formats such as MP3, OGG/Vorbis and WMA, and video formats such as MPEG2, H.264, H.265, WMV and Xvid. Without FFmpeg, pyglet contains built-in support for standard formats such as wav, png, bmp, and others.
  • pyglet is written entirely in pure Python, and makes use of the ctypes module to interface with system libraries. You can modify the codebase or make a contribution without any second language compilation steps or compiler setup. Despite being pure Python, pyglet has excellent performance thanks to advanced batching for drawing thousands of objects.
  • pyglet is provided under the BSD open-source license, allowing you to use it for both commercial and other open-source projects with very little restriction.

Requirements

Pyglet runs under Python 3.5+. Being written in pure Python, it also works on other Python interpreters such as PyPy. Supported platforms are:

  • Windows 7 or later
  • Mac OS X 10.3 or later
  • Linux, with the following libraries (most recent distributions will have these in a default installation):
    • OpenGL and GLX
    • GDK 2.0+ or Pillow (required for loading images other than PNG and BMP)
    • OpenAL or Pulseaudio (required for playing audio)

Please note that pyglet v1.5 will likely be the last version to support legacy OpenGL. Future releases of pyglet will be targeting OpenGL 3.3+. Previous releases will remain available for download.

Starting with version 1.4, to play compressed audio and video files, you will also need FFmpeg.

Installation

pyglet is installable from PyPI:

pip install --upgrade --user pyglet

Installation from source

If you're reading this README from a source distribution, you can install pyglet with:

python setup.py install --user

You can also install the latest development version direct from Github using:

pip install --upgrade --user https://github.com/pyglet/pyglet/archive/master.zip

For local development install pyglet in editable mode:

# with pip
pip install -e .
# with setup.py
python setup.py develop

There are no compilation steps during the installation; if you prefer, you can simply add this directory to your PYTHONPATH and use pyglet without installing it. You can also copy pyglet directly into your project folder.

Contributing

A good way to start contributing to a component of pyglet is by its documentation. When studying the code you are going to work with, also read the associated docs. If you don't understand the code with the help of the docs, it is a sign that the docs should be improved.

If you want to contribute to pyglet, we suggest the following:

  • Fork the official repository.
  • Checkout the branch you wish to contribute to (such as pyglet-1.4-maintenance).
  • Apply your changes to your fork.
  • Submit a pull request describing the changes you have made.
  • Alternatively you can create a patch and submit it to the issue tracker.

When making a pull request, check that you have addressed its respective documentation, both within the code docstrings and the programming guide (if applicable). It is very important to all of us that the documentation matches the latest code and vice-versa.

Consequently, an error in the documentation, either because it is hard to understand or because it doesn't match the code, is a bug that deserves to be reported on a ticket.

Building Docs

pip install -r doc/requirements.txt
python setup.py build_sphinx

Please check the README.md file in the doc directory for more details.

Testing

pyglet makes use of pytest for its test suite.

pip install -r tests/requirements.txt --user
# Only run unittests
pytest tests/unit

Please check the testing section in the development guide for more information about running and writing tests.

Contact

pyglet is developed by many individual volunteers, and there is no central point of contact. If you have a question about developing with pyglet, or you wish to contribute, please join the mailing list or the discord server.

For legal issues, please contact Alex Holkner.

Comments
  • Texts are not displayed correctly

    Texts are not displayed correctly

    I don't know if it's a problem with my computer, because of opengl or something like that, but I'm following this tutorial to the letter and the texts are displayed like this, everything looks fine, except the texts (labels), what can it be? pyglet_issue

    opened by Jalkhov 38
  • Import Error: Can't find framework %s.

    Import Error: Can't find framework %s." % path

    When I try to run from pyglet.gl import *

    The code line 262 tries to find OpenGL inside the directory /System/Library/Frameworks/OpenGL.framework. https://github.com/pyglet/pyglet/blob/d563b7a001506758a77fde035c22c786476d0093/pyglet/lib.py#L262 The function return None which in turn raise ImportError("Can't find framework %s." % path) # on line 283


    System Information

    OS: Mac OS Big Sur Public 11.0 Beta (20A5354i).

    Darwin Akarshs-MacBook-Pro.local 20.0.0 Darwin Kernel Version 20.0.0: Fri Aug 14 00:25:13 PDT 2020; root:xnu-7195.40.44.151.1~4/RELEASE_X86_64 x86_64
    

    Tree structure of the dir /System/Library/Frameworks/OpenGL.framework in my system.

     akarshjain@Akarshs-MacBook-Pro  /System/Library/Frameworks/OpenGL.framework  tree 
    .
    ├── Libraries -> Versions/Current/Libraries
    ├── Resources -> Versions/Current/Resources
    └── Versions
        ├── A
        │   ├── Libraries
        │   │   ├── 3425AMD
        │   │   │   ├── CVMCompiler
        │   │   │   └── libCoreVMClient.mono.dylib
        │   │   ├── 3600
        │   │   │   ├── CVMCompiler
        │   │   │   └── libCoreVMClient.mono.dylib
        │   │   ├── CVMCompiler
        │   │   ├── CVMServer
        │   │   ├── DumpGPURestart
        │   │   ├── ReportGPURestart
        │   │   ├── libGLVMPlugin.dylib
        │   │   ├── libGLVMPlugin31001.dylib
        │   │   ├── libGLVMPlugin3802.dylib
        │   │   └── libGLVMPlugin3902.dylib
        │   ├── Resources
        │   │   ├── BridgeSupport
        │   │   │   └── OpenGL.bridgesupport
        │   │   ├── CVMSPlugin.exp
        │   │   ├── CVMSPluginAll.exp
        │   │   ├── CVMSPluginNoExec.exp
        │   │   ├── GLByteCodes.arm64.bc
        │   │   ├── GLByteCodes.x86_64.bc
        │   │   ├── GLEngine.bundle
        │   │   │   └── GLEngine
        │   │   ├── GLRendererFloat.bundle
        │   │   │   └── GLRendererFloat
        │   │   ├── Info.plist
        │   │   ├── cvmsConfig.plist
        │   │   └── version.plist
        │   └── _CodeSignature
        │       └── CodeResources
        └── Current -> A
    
    
    help wanted mac 
    opened by akarsh1995 33
  • Fix issue #274

    Fix issue #274

    This should fix #274. This is still broken when using official python releases, but the version of python bundled with the macOS 11 Beta (a modified version of 3.8.2) has fixes for some of the issues caused by changes in Big Sur. The appropriate version of python should be found in /usr/bin/python3.

    opened by jerekshoe 29
  • Feature Request: Basic Shape Classes

    Feature Request: Basic Shape Classes

    Pyglet supports gl vertices which means it is very powerful, and very flexible.

    However, dealing with them feels very 'low level' when compared with the rest of pyglet. Like machine code or something.

    Could convenience classes similar (at least in spirit) to the one below be added for the gl impaired coders among us?

    class VertexRectangle:
        def __init__(self, x, y, width, height, color):
            self.x = x
            self.y = y
            self.width = width
            self.height = height
            self.color = color
            r = color[0]
            g = color[1]
            b = color[2]
            self.vertex_list = pyglet.graphics.vertex_list(4, 'v2f', 'c3B')
            self.vertex_list.vertices = [x, y,
                                       x + width, y,
                                       x + width, y + height,
                                       x, y + height]
            self.vertex_list.colors = [r, g, b,
                                       r, g, b,
                                       r, g, b,
                                       r, g, b]
            self.draw_mode = pyglet.gl.GL_QUADS
    
        def draw(self):
            self.vertex_list.draw(self.draw_mode)
    
        def move_relative(self, dx, dy):
            self.__init__(self.x+dx, self.y+dy, self.width, self.height, self.color)
    
        def move_absolute(self, x, y):
            self.__init__(x, y, self.width, self.height, self.color)
    
        def width_absolute(self, w):
            self.__init__(self.x, self.y , w, self.height,
                          self.color)
    
        def width_relative(self, dw):
            self.__init__(self.x, self.y, self.width + dw, self.height,
                          self.color)
    
    
    opened by nbroderick-code 27
  • Issue with two-valued GL version numbers

    Issue with two-valued GL version numbers

    (Reopening https://bitbucket.org/pyglet/pyglet/issues/228/issue-with-two-valued-gl-version-numbers as I didn't have a bitbucket account and therefore missed the request for more information)

    A traceback can be found in https://github.com/sympy/sympy/issues/16537#issuecomment-487540560

    I am pretty sure that it is exactly the same error that I got. (I also realize that it would have been easier to at least point you to where the error happened in the original report. Sorry about that.)

    crash 
    opened by oscargus 24
  • Window buttons on mac cause python/pyglet to crash

    Window buttons on mac cause python/pyglet to crash

    Description: The window buttons (close, minimize, full screen) cause python to crash in various ways. (Segmentation fault, Recursion Error, Abort Trap, Illegal Instruction).

    Pyglet version(s): 1.4.1

    Python version(s): 3.7

    OS: OS X 10.14.5 (Seems to only affect newer Macbooks)

    Related tickets: bitbucket #199 bitbucket #229

    Minimal example:

    import pyglet
    
    pyglet.window.Window(resizable=True)
    
    pyglet.app.run()
    

    Output 1 (close):

    $ python3 example.py 
    Traceback (most recent call last):
      File "_ctypes/callbacks.c", line 232, in 'calling callback function'
      File "/usr/local/lib/python3.7/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1120, in objc_method
        args = convert_method_arguments(encoding, args)
      File "/usr/local/lib/python3.7/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1000, in convert_method_arguments
        new_args.append(ObjCInstance(a))
      File "/usr/local/lib/python3.7/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 921, in __new__
        if not isinstance(object_ptr, c_void_p):
    RecursionError: maximum recursion depth exceeded while calling a Python object
    Segmentation fault: 11
    $ 
    

    Output 2 (minimize):

    $ python3 example.py 
    Traceback (most recent call last):
      File "_ctypes/callbacks.c", line 232, in 'calling callback function'
      File "/usr/local/lib/python3.7/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1120, in objc_method
        args = convert_method_arguments(encoding, args)
      File "/usr/local/lib/python3.7/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1000, in convert_method_arguments
        new_args.append(ObjCInstance(a))
      File "/usr/local/lib/python3.7/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 921, in __new__
        if not isinstance(object_ptr, c_void_p):
    RecursionError: maximum recursion depth exceeded while calling a Python object
    Illegal instruction: 4
    $ 
    
    bug help wanted mac reproducible crash 
    opened by olehermanse 23
  • AttributeError: 'Batch' object has no attribute 'add'

    AttributeError: 'Batch' object has no attribute 'add'

    I assume I do sth wrong, but I don't really know what. This is from an old project of mine, and it used arcade and pyglet, and now I was just trying it out, and I got AttributeError: 'Batch' object has no attribute 'add' while trying to call batch.add, where batch is a class of instance Batch.

    I have pyglet 2.0.dev23 installed.

    When looking at the code of Batch, I also don't see any such method add. Although the documentation says there should be such a method.

    When searching for this error, I did not find anything.

    opened by albertz 22
  • Catalina Mac OS segfaulting in pyglet.input

    Catalina Mac OS segfaulting in pyglet.input

    Hi, I'm moving this over from: https://github.com/pvcraven/arcade/issues/513

    I have a number of students using Arcade this semester, which is built on Pyglet. It's working well for most of my students, but some of the Macs with Catalina (15.5) segfault before Arcade can finish importing. I believe at this point, I've tracked it down to running the following:

    import pyglet.input
    

    This causes a segmentation fault and a large dump. I don't have the exact trace for that command (student I was working with had to go to their next class), but here's the stack trace from when I was still at the Arcade level: https://pastebin.com/raw/6NyDtJmC

    Not sure if you have any insight, but my first thought is that it has something to do with the game controllers?

    opened by acbart 21
  • Memory Leak on Raspberry Pi 3B when playing audio files

    Memory Leak on Raspberry Pi 3B when playing audio files

    When using pyglet.media to play a playlist of music MP3s on a Raspberry Pi 3B, memory usage continually increases until system starts thrashing

    OS: Raspbian 10 Python: 3.7.3 Pyglet: 1.5.7 FFMPEG: 4.1.6-1~deb10u1+rpt2

    The following code reproduces the error. It reads a list of MP3's from a directory of about 30 files each about 2-3 minutes long. The program initially consumes 420MB, but grows to 1.98GB by the time the system becomes unresponsive

    The following code was used to reproduce the issue consistently

    import pyglet
    import os
    
    path = '/path/to/directory/containing/mp3s'
    
    pool = []
    for root, dirs, files in os.walk(path, followlinks = True) :
      for name in files :
        pool.append(os.path.join(root, name))
    
    player = pyglet.media.Player()
    
    def queue_next() :
      s = pool.pop(0)
      print("Queueing: %s" % (s))
      player.queue(pyglet.media.load(s))
      pool.append(s) #put the item back on the end of the playlist so we never run out of songs to play
    
    def on_eos() :
      player.next_source()
      queue_next()
    
    player.on_eos = on_eos
    
    queue_next()
    queue_next()
    player.play()
    
    window = pyglet.window.Window(100,100,)
    
    pyglet.app.run()
    
    opened by tomhaines 20
  • ord('œ̃')... TypeError when processing ligatures

    ord('œ̃')... TypeError when processing ligatures

    I have front.stack, which is a dictionary with some ligatures, french pronunciations I also have front.bulk, which is a pyglet layout

    first I take some texts from front.stack and create a formatted pyglet document like:

    bulk = pgl.text.decode_html(
            
            text = str(charger_dict['bulk'])
            
            )
    

    second I change the current document of existing pyglet layout: front.bulk.document = bulk

    when done on text without ligatures, that works.

    When there are ligatures, it raises TypeError, somewhere deep down the line there happens ord(' some ligature here' ) I understand why it happens technically - ligature is viewed by python as a string of length 2 but what should I do with that? remove all the ligatures from the original text somehow? or modify pyglet module code somehow?

    I am not very good at that, so if you have any advice, I would like to hear 'em thanks in advance ^-^

    i got this, by the way: Exception ignored on calling ctypes callback function: <function Win32Window.get_window_proc..f at 0x0776D610> Traceback (most recent call last): File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\window\win32_init.py", line 720, in f result = event_handler(msg, wParam, lParam) File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\window\win32_init_.py", line 994, in _event_lbuttondown return self.event_mousebutton( File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\window\win32_init.py", line 988, in _event_mousebutton self.dispatch_event(ev, x, y, button, self.get_modifiers()) File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\window_init.py", line 1333, in dispatch_event if EventDispatcher.dispatch_event(self, *args) != False: File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\event.py", line 411, in dispatch_event self._raise_dispatch_exception(event_type, args, handler, exception) File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\event.py", line 476, in _raise_dispatch_exception raise exception File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\event.py", line 408, in dispatch_event if handler(*args): File "B:\PyPro\doors\engine\moves.py", line 496, in on_mouse_press_if_charger load_next_from_stack() File "B:\PyPro\doors\engine\moves.py", line 474, in load_next_from_stack place_the_text(front.stack[ int(front.stack['now']) ] ) File "B:\PyPro\doors\engine\moves.py", line 751, in place_the_text front.bulk.document = bulk File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\text\layout.py", line 920, in _set_document self._init_document() File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\text\layout.py", line 1034, in _init_document self._update() File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\text\layout.py", line 957, in _update lines = self._get_lines() File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\text\layout.py", line 933, in _get_lines glyphs = self._get_glyphs() File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\text\layout.py", line 1076, in _get_glyphs glyphs.extend(font.get_glyphs(text[start:end])) File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\font\base.py", line 386, in get_glyphs self.glyphs[c] = glyph_renderer.render(c) File "b:\miniconda3\envs\doors\lib\site-packages\pyglet\font\win32.py", line 427, in render ord(text), ord(text), byref(abc)): TypeError: ord() expected a character, but string of length 2 found

    opened by timeis-byte 18
  • Continuous errors from directaudio while running pyglet's noisy.py

    Continuous errors from directaudio while running pyglet's noisy.py

    Repro:

    • start noisy.py
    • press once the space key

    The pyglet's window shows a bouncing ball, the ping sound is listened but console displays a continuous stream of errors:

    (py38-cocos2020) D:\dev\pyglet-2019\examples\noisy>python noisy.py
    Unexpected error loading library avutil-56: Could not find module 'avutil-56'. T
    ry using the full path with constructor syntax.
    Exception in thread Thread-11:
    Traceback (most recent call last):
      File "D:\prog\Python38\lib\threading.py", line 932, in _bootstrap_inner
        self.run()
      File "D:\prog\Python38\lib\threading.py", line 1254, in run
        self.function(*self.args, **self.kwargs)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\base.py", line 225, in _run_func
    tion
        self._func()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     182, in _check_refill
        self.refill(write_size)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     187, in refill
        audio_data = self._get_audiodata()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     208, in _get_audiodata
        self._get_new_audiodata()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     216, in _get_new_audiodata
        compensation_time = self.get_audio_time_diff()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\base.py", line 141, in get_audio
    _time_diff
        p_time = self.player.time
    ReferenceError: weakly-referenced object no longer exists
    Exception in thread Thread-22:
    Traceback (most recent call last):
      File "D:\prog\Python38\lib\threading.py", line 932, in _bootstrap_inner
        self.run()
      File "D:\prog\Python38\lib\threading.py", line 1254, in run
        self.function(*self.args, **self.kwargs)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\base.py", line 225, in _run_func
    tion
        self._func()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     182, in _check_refill
        self.refill(write_size)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     187, in refill
        audio_data = self._get_audiodata()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     208, in _get_audiodata
        self._get_new_audiodata()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     216, in _get_new_audiodata
        compensation_time = self.get_audio_time_diff()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\base.py", line 141, in get_audio
    _time_diff
        p_time = self.player.time
    ReferenceError: weakly-referenced object no longer exists
    Exception in thread Thread-30:
    Traceback (most recent call last):
      File "D:\prog\Python38\lib\threading.py", line 932, in _bootstrap_inner
        self.run()
      File "D:\prog\Python38\lib\threading.py", line 1254, in run
        self.function(*self.args, **self.kwargs)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\base.py", line 225, in _run_func
    tion
        self._func()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     182, in _check_refill
        self.refill(write_size)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     187, in refill
        audio_data = self._get_audiodata()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     208, in _get_audiodata
        self._get_new_audiodata()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     216, in _get_new_audiodata
        compensation_time = self.get_audio_time_diff()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\base.py", line 141, in get_audio
    _time_diff
        p_time = self.player.time
    ReferenceError: weakly-referenced object no longer exists
    Exception in thread Thread-32:
    Traceback (most recent call last):
      File "D:\prog\Python38\lib\threading.py", line 932, in _bootstrap_inner
        self.run()
      File "D:\prog\Python38\lib\threading.py", line 1254, in run
        self.function(*self.args, **self.kwargs)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\base.py", line 225, in _run_func
    tion
        self._func()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     182, in _check_refill
        self.refill(write_size)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     192, in refill
        self.write(audio_data, length)
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\adaptation.py", line
     313, in write
        audio_data.consume(write_ptr.audio_length_1.value, self.source.audio_format)
    
    ReferenceError: weakly-referenced object no longer exists
    Exception ignored in: <function DirectSoundBuffer.__del__ at 0x0000000008144280>
    
    Traceback (most recent call last):
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\interface.py", line
    172, in __del__
        self.delete()
      File "d:\dev\pyglet-2019\pyglet\media\drivers\directsound\interface.py", line
    177, in delete
        self._native_buffer.Stop()
      File "d:\dev\pyglet-2019\pyglet\com.py", line 131, in _call
        ret = self.method.get_field()(self.i, self.name)(obj, *args)
    OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF
    
    (py38-cocos2020) D:\dev\pyglet-2019\examples\noisy>
    

    win7, no ffmpeg installed, py 3.8, pyglet-1.4-maintenance at commit commit 6e9c4485cb62789c3c3b5bb27bc75e6dd82653ae Author: Benjamin Moran Date: Sun Jan 12 17:42:02 2020 +0900

    opened by ccanepa 18
  • Breaking change due to v2.0.2.1 v.s. v1.15

    Breaking change due to v2.0.2.1 v.s. v1.15

    Hi, it looks like in pyglet >= 2.0, pyglet.image.Texture.create_for_size is replaced by pyglet.image.Texture.create? But after I updated this API call in my legacy code, the windows only showed a black screen without reporting any error. Is there anything I'm missing?

    The code :

    https://github.com/neozhaoliang/pywonderland/blob/master/src/shader-playground/wythoff_hyperbolic_tilings.py

    This script runs fine with pyglet <= 1.15, but for pyglet >=2.0, I have to change this line:

    https://github.com/neozhaoliang/pywonderland/blob/master/src/shader-playground/wythoff_hyperbolic_tilings.py#L76-L78

    to

    self.iChannel0 = pyglet.image.Texture.create(
                width, height, gl.GL_TEXTURE_2D, gl.GL_RGBA32F
            )
    

    But that doesn't show the animation as reported above.

    bug 
    opened by neozhaoliang 3
  • Multiple window initialization

    Multiple window initialization

    Describe the bug I was attempting to modify the examples/window/multiple_windows.py demo to use common objects and a common update function, see attached demo multiple_windows_share.py. But I ran into an issue if I didn't create at least one shape after the window was created, see multiple_windows_share_FAIL.py. I probably am missing something, but I thought I could initialize/load GL objects pretty much anytime and they'd go into the shadow object state. The object creation seems like its working, but the draw fails for the second window.

    System Information: Windows 10, Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz 2.71 GHz, 32.0 GB (31.6 GB usable) super().dispatch_event(*args) File "C:\Users\gm991e\AppData\Roaming\Python\Python39\site-packages\pyglet\event.py", line 415, in dispatch_event if handler(*args): File "C:\Users\gm991e\Downloads\pyglet-2.0\examples\window\multiple_windows_share_fail.py", line 58, in on_draw drawScene() File "C:\Users\gm991e\Downloads\pyglet-2.0\examples\window\multiple_windows_share_fail.py", line 32, in drawScene s2.draw() File "C:\Users\gm991e\AppData\Roaming\Python\Python39\site-packages\pyglet\shapes.py", line 270, in draw self._vertex_list.draw(GL_TRIANGLES) File "C:\Users\gm991e\AppData\Roaming\Python\Python39\site-packages\pyglet\graphics\vertexdomain.py", line 276, in draw self.domain.draw_subset(mode, self) File "C:\Users\gm991e\AppData\Roaming\Python\Python39\site-packages\pyglet\graphics\vertexdomain.py", line 236, in draw_subset self.vao.bind() File "C:\Users\gm991e\AppData\Roaming\Python\Python39\site-packages\pyglet\graphics\vertexarray.py", line 58, in bind glBindVertexArray(self._id) File "C:\Users\gm991e\AppData\Roaming\Python\Python39\site-packages\pyglet\gl\lib_wgl.py", line 101, in call return self.func(*args, **kwargs) File "C:\Users\gm991e\AppData\Roaming\Python\Python39\site-packages\pyglet\gl\lib.py", line 114, in errcheck raise GLException('(0x%x): %s' % (error, msg)) pyglet.gl.lib.GLException: (0x502): Invalid operation. The specified operation is not allowed in the current state.

    How To Reproduce The two tests are in the zip file. window.zip

    bug 
    opened by gizmoore 1
  • [Feature Request] font.load add attribute filename

    [Feature Request] font.load add attribute filename

    Is your feature request related to a problem? Please describe. I'm always frustrated when I wanna create a font instance, but I cannot get it's path on the drive. I wanna get it's path because I wanna use fonttools to get many information I cannot get with pyglet.

    Describe the solution you'd like I would like that when we load a font, we could have an attribute filename.

    Ex:

    from pyglet import font
    font= font.load('Arial', 16)
    font.filename
    

    This is usefull when you wanna use pyglet to find a font in the system. After that, we can use tool like fonttools to have way more information about the font.

    enhancement 
    opened by JeremieBergeron 1
  • Option to hide text within IncrementalTextLayout

    Option to hide text within IncrementalTextLayout

    Is your feature request related to a problem? Please describe. Developers would like to create a login screen for their games within Arcade. Currently there seems to be no easy way to create a password input field, hiding the text a user inserts as their password.

    Describe the solution you'd like Provide a property to hide show only starts instead of the real text in IncrementalTextLayout, so that passwords are not displayed on the screen.

    enhancement 
    opened by eruvanos 3
  • CodecRegistry.DecodeException: No decoders available for this file type: abc.mp3

    CodecRegistry.DecodeException: No decoders available for this file type: abc.mp3

    Hi Team,

    I am trying to run a project which sends uses pyglet media.load method to decode an audio file and plays it out. But I am facing lot of issues with pyglet. Not sure what is the issue. I am using Mac M1 pro. Initially I got portAudio error while installing PyAudio and then it got resolved when taken care of path of homebrew. Now after resolving that I am seeing the below error:

    image

    Below is my code:

    import pyglet import email import imaplib import speech_recognition as speechRecognition from gtts import gTTS

    def textToVoice(textSentence): #textSentence contains the text/String that needs to be converted to Audio textToSpeech = gTTS(text=textSentence, lang="en") print(textSentence) savedAudioFile=("textToAudioFile.mp3") textToSpeech.save(savedAudioFile) music = pyglet.media.load(savedAudioFile) music.play() time.sleep(music.duration) os.remove(savedAudioFile)

    I can verify that pyglet, portAudio, pyAudio, pip3, python3 all are successfully installed

    opened by ROOPKANTH-KURRA 1
  • Screenshoting on headless window results in blank image

    Screenshoting on headless window results in blank image

    Describe the bug When executing the code below, I get shown the following image: tmphmnhieti I expected this image: tmpuppq5dxo wich is exactly what I get, when I comment line 3 (pyglet.options["headless"] = True).

    I expect the headless and not-headless outputs to be identical (at least that's what I think is intuitive).

    Let me know if the functionality in the make_screenshot function supported in headless mode or how I can get an image of the frame buffer of a headless window, if they even have that.

    How To Reproduce I used the following code:

    import pyglet
    
    pyglet.options["headless"] = True
    
    from pyglet.graphics import Batch
    from pyglet.window import Window
    
    import PIL.Image
    import io
    
    batch = Batch()
    window = Window(500, 500)
    
    circle = pyglet.shapes.Circle(250, 250, 100, color=(255, 255, 0), batch=batch)
    
    
    @window.event
    def on_draw():
        window.clear()
        batch.draw()
    
    
    def make_screenshot(_):
        out = io.BytesIO()
    
        pyglet.image.get_buffer_manager().get_color_buffer().save(file=out)
    
        pil_img = PIL.Image.open(out, formats=("png",))
        pil_img.show()
    
        pyglet.app.exit()
    
    
    pyglet.clock.schedule_once(make_screenshot, 2)
    pyglet.app.run()
    

    System Information:

    Platform
    ------------------------------------------------------------------------------
    platform:  Linux-5.15.78-1-MANJARO-x86_64-with-glibc2.36
    release:   5.15.78-1-MANJARO
    machine:   x86_64
    
    Python
    ------------------------------------------------------------------------------
    implementation: CPython
    sys.version: 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0]
    sys.maxint: 9223372036854775807
    os.getcwd(): /run/media/bela/Belas_SSD/PycharmProjects/music_align
    
    pyglet
    ------------------------------------------------------------------------------
    pyglet.version: 1.5.27
    pyglet.compat_platform: linux
    pyglet.__file__: /home/bela/venv310/lib/python3.10/site-packages/pyglet/__init__.py
    pyglet.options['audio'] = ('xaudio2', 'directsound', 'openal', 'pulse', 'silent')
    pyglet.options['debug_font'] = False
    pyglet.options['debug_gl'] = True
    pyglet.options['debug_gl_trace'] = False
    pyglet.options['debug_gl_trace_args'] = False
    pyglet.options['debug_graphics_batch'] = False
    pyglet.options['debug_lib'] = False
    pyglet.options['debug_media'] = False
    pyglet.options['debug_texture'] = False
    pyglet.options['debug_trace'] = False
    pyglet.options['debug_trace_args'] = False
    pyglet.options['debug_trace_depth'] = 1
    pyglet.options['debug_trace_flush'] = True
    pyglet.options['debug_win32'] = False
    pyglet.options['debug_x11'] = False
    pyglet.options['graphics_vbo'] = True
    pyglet.options['shadow_window'] = True
    pyglet.options['vsync'] = None
    pyglet.options['xsync'] = True
    pyglet.options['xlib_fullscreen_override_redirect'] = False
    pyglet.options['darwin_cocoa'] = True
    pyglet.options['search_local_libs'] = True
    pyglet.options['advanced_font_features'] = False
    pyglet.options['headless'] = False
    pyglet.options['headless_device'] = 0
    pyglet.options['win32_disable_shaping'] = False
    
    pyglet.window
    ------------------------------------------------------------------------------
    display: <pyglet.canvas.xlib.XlibDisplay object at 0x7ff057217cd0>
    screens[0]: XlibScreen(display=<pyglet.canvas.xlib.XlibDisplay object at 0x7ff057217cd0>, x=0, y=0, width=1920, height=1080, xinerama=0)
    config['double_buffer'] = 1
    config['stereo'] = 0
    config['buffer_size'] = 24
    config['aux_buffers'] = 4
    config['sample_buffers'] = 0
    config['samples'] = 0
    config['red_size'] = 8
    config['green_size'] = 8
    config['blue_size'] = 8
    config['alpha_size'] = 0
    config['depth_size'] = 24
    config['stencil_size'] = 0
    config['accum_red_size'] = 16
    config['accum_green_size'] = 16
    config['accum_blue_size'] = 16
    config['accum_alpha_size'] = 16
    config['major_version'] = None
    config['minor_version'] = None
    config['forward_compatible'] = None
    config['debug'] = None
    context: XlibContextARB()
    
    window.context._info
    ------------------------------------------------------------------------------
    gl_info.get_version(): 4.6.0 NVIDIA 520.56.06
    gl_info.get_vendor(): NVIDIA Corporation
    gl_info.get_renderer(): NVIDIA GeForce GTX 1650/PCIe/SSE2
    gl_info.get_extensions():
       GL_AMD_multi_draw_indirect
       GL_AMD_seamless_cubemap_per_texture
       GL_AMD_vertex_shader_layer
       GL_AMD_vertex_shader_viewport_index
       GL_ARB_ES2_compatibility
       GL_ARB_ES3_1_compatibility
       GL_ARB_ES3_2_compatibility
       GL_ARB_ES3_compatibility
       GL_ARB_arrays_of_arrays
       GL_ARB_base_instance
       GL_ARB_bindless_texture
       GL_ARB_blend_func_extended
       GL_ARB_buffer_storage
       GL_ARB_clear_buffer_object
       GL_ARB_clear_texture
       GL_ARB_clip_control
       GL_ARB_color_buffer_float
       GL_ARB_compatibility
       GL_ARB_compressed_texture_pixel_storage
       GL_ARB_compute_shader
       GL_ARB_compute_variable_group_size
       GL_ARB_conditional_render_inverted
       GL_ARB_conservative_depth
       GL_ARB_copy_buffer
       GL_ARB_copy_image
       GL_ARB_cull_distance
       GL_ARB_debug_output
       GL_ARB_depth_buffer_float
       GL_ARB_depth_clamp
       GL_ARB_depth_texture
       GL_ARB_derivative_control
       GL_ARB_direct_state_access
       GL_ARB_draw_buffers
       GL_ARB_draw_buffers_blend
       GL_ARB_draw_elements_base_vertex
       GL_ARB_draw_indirect
       GL_ARB_draw_instanced
       GL_ARB_enhanced_layouts
       GL_ARB_explicit_attrib_location
       GL_ARB_explicit_uniform_location
       GL_ARB_fragment_coord_conventions
       GL_ARB_fragment_layer_viewport
       GL_ARB_fragment_program
       GL_ARB_fragment_program_shadow
       GL_ARB_fragment_shader
       GL_ARB_fragment_shader_interlock
       GL_ARB_framebuffer_no_attachments
       GL_ARB_framebuffer_object
       GL_ARB_framebuffer_sRGB
       GL_ARB_geometry_shader4
       GL_ARB_get_program_binary
       GL_ARB_get_texture_sub_image
       GL_ARB_gl_spirv
       GL_ARB_gpu_shader5
       GL_ARB_gpu_shader_fp64
       GL_ARB_gpu_shader_int64
       GL_ARB_half_float_pixel
       GL_ARB_half_float_vertex
       GL_ARB_imaging
       GL_ARB_indirect_parameters
       GL_ARB_instanced_arrays
       GL_ARB_internalformat_query
       GL_ARB_internalformat_query2
       GL_ARB_invalidate_subdata
       GL_ARB_map_buffer_alignment
       GL_ARB_map_buffer_range
       GL_ARB_multi_bind
       GL_ARB_multi_draw_indirect
       GL_ARB_multisample
       GL_ARB_multitexture
       GL_ARB_occlusion_query
       GL_ARB_occlusion_query2
       GL_ARB_parallel_shader_compile
       GL_ARB_pipeline_statistics_query
       GL_ARB_pixel_buffer_object
       GL_ARB_point_parameters
       GL_ARB_point_sprite
       GL_ARB_polygon_offset_clamp
       GL_ARB_post_depth_coverage
       GL_ARB_program_interface_query
       GL_ARB_provoking_vertex
       GL_ARB_query_buffer_object
       GL_ARB_robust_buffer_access_behavior
       GL_ARB_robustness
       GL_ARB_sample_locations
       GL_ARB_sample_shading
       GL_ARB_sampler_objects
       GL_ARB_seamless_cube_map
       GL_ARB_seamless_cubemap_per_texture
       GL_ARB_separate_shader_objects
       GL_ARB_shader_atomic_counter_ops
       GL_ARB_shader_atomic_counters
       GL_ARB_shader_ballot
       GL_ARB_shader_bit_encoding
       GL_ARB_shader_clock
       GL_ARB_shader_draw_parameters
       GL_ARB_shader_group_vote
       GL_ARB_shader_image_load_store
       GL_ARB_shader_image_size
       GL_ARB_shader_objects
       GL_ARB_shader_precision
       GL_ARB_shader_storage_buffer_object
       GL_ARB_shader_subroutine
       GL_ARB_shader_texture_image_samples
       GL_ARB_shader_texture_lod
       GL_ARB_shader_viewport_layer_array
       GL_ARB_shading_language_100
       GL_ARB_shading_language_420pack
       GL_ARB_shading_language_include
       GL_ARB_shading_language_packing
       GL_ARB_shadow
       GL_ARB_sparse_buffer
       GL_ARB_sparse_texture
       GL_ARB_sparse_texture2
       GL_ARB_sparse_texture_clamp
       GL_ARB_spirv_extensions
       GL_ARB_stencil_texturing
       GL_ARB_sync
       GL_ARB_tessellation_shader
       GL_ARB_texture_barrier
       GL_ARB_texture_border_clamp
       GL_ARB_texture_buffer_object
       GL_ARB_texture_buffer_object_rgb32
       GL_ARB_texture_buffer_range
       GL_ARB_texture_compression
       GL_ARB_texture_compression_bptc
       GL_ARB_texture_compression_rgtc
       GL_ARB_texture_cube_map
       GL_ARB_texture_cube_map_array
       GL_ARB_texture_env_add
       GL_ARB_texture_env_combine
       GL_ARB_texture_env_crossbar
       GL_ARB_texture_env_dot3
       GL_ARB_texture_filter_anisotropic
       GL_ARB_texture_filter_minmax
       GL_ARB_texture_float
       GL_ARB_texture_gather
       GL_ARB_texture_mirror_clamp_to_edge
       GL_ARB_texture_mirrored_repeat
       GL_ARB_texture_multisample
       GL_ARB_texture_non_power_of_two
       GL_ARB_texture_query_levels
       GL_ARB_texture_query_lod
       GL_ARB_texture_rectangle
       GL_ARB_texture_rg
       GL_ARB_texture_rgb10_a2ui
       GL_ARB_texture_stencil8
       GL_ARB_texture_storage
       GL_ARB_texture_storage_multisample
       GL_ARB_texture_swizzle
       GL_ARB_texture_view
       GL_ARB_timer_query
       GL_ARB_transform_feedback2
       GL_ARB_transform_feedback3
       GL_ARB_transform_feedback_instanced
       GL_ARB_transform_feedback_overflow_query
       GL_ARB_transpose_matrix
       GL_ARB_uniform_buffer_object
       GL_ARB_vertex_array_bgra
       GL_ARB_vertex_array_object
       GL_ARB_vertex_attrib_64bit
       GL_ARB_vertex_attrib_binding
       GL_ARB_vertex_buffer_object
       GL_ARB_vertex_program
       GL_ARB_vertex_shader
       GL_ARB_vertex_type_10f_11f_11f_rev
       GL_ARB_vertex_type_2_10_10_10_rev
       GL_ARB_viewport_array
       GL_ARB_window_pos
       GL_ATI_draw_buffers
       GL_ATI_texture_float
       GL_ATI_texture_mirror_once
       GL_EXTX_framebuffer_mixed_formats
       GL_EXT_Cg_shader
       GL_EXT_abgr
       GL_EXT_bgra
       GL_EXT_bindable_uniform
       GL_EXT_blend_color
       GL_EXT_blend_equation_separate
       GL_EXT_blend_func_separate
       GL_EXT_blend_minmax
       GL_EXT_blend_subtract
       GL_EXT_compiled_vertex_array
       GL_EXT_depth_bounds_test
       GL_EXT_direct_state_access
       GL_EXT_draw_buffers2
       GL_EXT_draw_instanced
       GL_EXT_draw_range_elements
       GL_EXT_fog_coord
       GL_EXT_framebuffer_blit
       GL_EXT_framebuffer_multisample
       GL_EXT_framebuffer_multisample_blit_scaled
       GL_EXT_framebuffer_object
       GL_EXT_framebuffer_sRGB
       GL_EXT_geometry_shader4
       GL_EXT_gpu_program_parameters
       GL_EXT_gpu_shader4
       GL_EXT_import_sync_object
       GL_EXT_memory_object
       GL_EXT_memory_object_fd
       GL_EXT_multi_draw_arrays
       GL_EXT_multiview_texture_multisample
       GL_EXT_multiview_timer_query
       GL_EXT_packed_depth_stencil
       GL_EXT_packed_float
       GL_EXT_packed_pixels
       GL_EXT_pixel_buffer_object
       GL_EXT_point_parameters
       GL_EXT_polygon_offset_clamp
       GL_EXT_post_depth_coverage
       GL_EXT_provoking_vertex
       GL_EXT_raster_multisample
       GL_EXT_rescale_normal
       GL_EXT_secondary_color
       GL_EXT_semaphore
       GL_EXT_semaphore_fd
       GL_EXT_separate_shader_objects
       GL_EXT_separate_specular_color
       GL_EXT_shader_image_load_formatted
       GL_EXT_shader_image_load_store
       GL_EXT_shader_integer_mix
       GL_EXT_shadow_funcs
       GL_EXT_sparse_texture2
       GL_EXT_stencil_two_side
       GL_EXT_stencil_wrap
       GL_EXT_texture3D
       GL_EXT_texture_array
       GL_EXT_texture_buffer_object
       GL_EXT_texture_compression_dxt1
       GL_EXT_texture_compression_latc
       GL_EXT_texture_compression_rgtc
       GL_EXT_texture_compression_s3tc
       GL_EXT_texture_cube_map
       GL_EXT_texture_edge_clamp
       GL_EXT_texture_env_add
       GL_EXT_texture_env_combine
       GL_EXT_texture_env_dot3
       GL_EXT_texture_filter_anisotropic
       GL_EXT_texture_filter_minmax
       GL_EXT_texture_integer
       GL_EXT_texture_lod
       GL_EXT_texture_lod_bias
       GL_EXT_texture_mirror_clamp
       GL_EXT_texture_object
       GL_EXT_texture_sRGB
       GL_EXT_texture_sRGB_R8
       GL_EXT_texture_sRGB_decode
       GL_EXT_texture_shadow_lod
       GL_EXT_texture_shared_exponent
       GL_EXT_texture_storage
       GL_EXT_texture_swizzle
       GL_EXT_timer_query
       GL_EXT_transform_feedback2
       GL_EXT_vertex_array
       GL_EXT_vertex_array_bgra
       GL_EXT_vertex_attrib_64bit
       GL_EXT_window_rectangles
       GL_EXT_x11_sync_object
       GL_IBM_rasterpos_clip
       GL_IBM_texture_mirrored_repeat
       GL_KHR_blend_equation_advanced
       GL_KHR_blend_equation_advanced_coherent
       GL_KHR_context_flush_control
       GL_KHR_debug
       GL_KHR_no_error
       GL_KHR_parallel_shader_compile
       GL_KHR_robust_buffer_access_behavior
       GL_KHR_robustness
       GL_KHR_shader_subgroup
       GL_KTX_buffer_region
       GL_NVX_blend_equation_advanced_multi_draw_buffers
       GL_NVX_conditional_render
       GL_NVX_gpu_memory_info
       GL_NVX_nvenc_interop
       GL_NVX_progress_fence
       GL_NV_ES1_1_compatibility
       GL_NV_ES3_1_compatibility
       GL_NV_alpha_to_coverage_dither_control
       GL_NV_bindless_multi_draw_indirect
       GL_NV_bindless_multi_draw_indirect_count
       GL_NV_bindless_texture
       GL_NV_blend_equation_advanced
       GL_NV_blend_equation_advanced_coherent
       GL_NV_blend_minmax_factor
       GL_NV_blend_square
       GL_NV_clip_space_w_scaling
       GL_NV_command_list
       GL_NV_compute_program5
       GL_NV_compute_shader_derivatives
       GL_NV_conditional_render
       GL_NV_conservative_raster
       GL_NV_conservative_raster_dilate
       GL_NV_conservative_raster_pre_snap
       GL_NV_conservative_raster_pre_snap_triangles
       GL_NV_conservative_raster_underestimation
       GL_NV_copy_depth_to_color
       GL_NV_copy_image
       GL_NV_depth_buffer_float
       GL_NV_depth_clamp
       GL_NV_draw_texture
       GL_NV_draw_vulkan_image
       GL_NV_explicit_multisample
       GL_NV_feature_query
       GL_NV_fence
       GL_NV_fill_rectangle
       GL_NV_float_buffer
       GL_NV_fog_distance
       GL_NV_fragment_coverage_to_color
       GL_NV_fragment_program
       GL_NV_fragment_program2
       GL_NV_fragment_program_option
       GL_NV_fragment_shader_barycentric
       GL_NV_fragment_shader_interlock
       GL_NV_framebuffer_mixed_samples
       GL_NV_framebuffer_multisample_coverage
       GL_NV_geometry_shader4
       GL_NV_geometry_shader_passthrough
       GL_NV_gpu_multicast
       GL_NV_gpu_program4
       GL_NV_gpu_program4_1
       GL_NV_gpu_program5
       GL_NV_gpu_program5_mem_extended
       GL_NV_gpu_program_fp64
       GL_NV_gpu_shader5
       GL_NV_half_float
       GL_NV_internalformat_sample_query
       GL_NV_light_max_exponent
       GL_NV_memory_attachment
       GL_NV_memory_object_sparse
       GL_NV_mesh_shader
       GL_NV_multisample_coverage
       GL_NV_multisample_filter_hint
       GL_NV_occlusion_query
       GL_NV_packed_depth_stencil
       GL_NV_parameter_buffer_object
       GL_NV_parameter_buffer_object2
       GL_NV_path_rendering
       GL_NV_path_rendering_shared_edge
       GL_NV_pixel_data_range
       GL_NV_point_sprite
       GL_NV_primitive_restart
       GL_NV_query_resource
       GL_NV_query_resource_tag
       GL_NV_register_combiners
       GL_NV_register_combiners2
       GL_NV_representative_fragment_test
       GL_NV_robustness_video_memory_purge
       GL_NV_sample_locations
       GL_NV_sample_mask_override_coverage
       GL_NV_scissor_exclusive
       GL_NV_shader_atomic_counters
       GL_NV_shader_atomic_float
       GL_NV_shader_atomic_float64
       GL_NV_shader_atomic_fp16_vector
       GL_NV_shader_atomic_int64
       GL_NV_shader_buffer_load
       GL_NV_shader_storage_buffer_object
       GL_NV_shader_subgroup_partitioned
       GL_NV_shader_texture_footprint
       GL_NV_shader_thread_group
       GL_NV_shader_thread_shuffle
       GL_NV_shading_rate_image
       GL_NV_stereo_view_rendering
       GL_NV_texgen_reflection
       GL_NV_texture_barrier
       GL_NV_texture_compression_vtc
       GL_NV_texture_env_combine4
       GL_NV_texture_multisample
       GL_NV_texture_rectangle
       GL_NV_texture_rectangle_compressed
       GL_NV_texture_shader
       GL_NV_texture_shader2
       GL_NV_texture_shader3
       GL_NV_timeline_semaphore
       GL_NV_transform_feedback
       GL_NV_transform_feedback2
       GL_NV_uniform_buffer_unified_memory
       GL_NV_vdpau_interop
       GL_NV_vdpau_interop2
       GL_NV_vertex_array_range
       GL_NV_vertex_array_range2
       GL_NV_vertex_attrib_integer_64bit
       GL_NV_vertex_buffer_unified_memory
       GL_NV_vertex_program
       GL_NV_vertex_program1_1
       GL_NV_vertex_program2
       GL_NV_vertex_program2_option
       GL_NV_vertex_program3
       GL_NV_viewport_array2
       GL_NV_viewport_swizzle
       GL_OVR_multiview
       GL_OVR_multiview2
       GL_S3_s3tc
       GL_SGIS_generate_mipmap
       GL_SGIS_texture_lod
       GL_SGIX_depth_texture
       GL_SGIX_shadow
       GL_SUN_slice_accum
    
    pyglet.gl.glu_info
    ------------------------------------------------------------------------------
    glu_info.get_version(): 1.3
    glu_info.get_extensions():
       GLU_EXT_nurbs_tessellator
       GLU_EXT_object_space_tess
    
    pyglet.gl.glx_info
    ------------------------------------------------------------------------------
    context.is_direct(): 1
    glx_info.get_server_vendor(): NVIDIA Corporation
    glx_info.get_server_version(): 1.4
    glx_info.get_server_extensions():
       GLX_EXT_visual_info
       GLX_EXT_visual_rating
       GLX_EXT_import_context
       GLX_SGIX_fbconfig
       GLX_SGIX_pbuffer
       GLX_SGI_video_sync
       GLX_SGI_swap_control
       GLX_EXT_swap_control
       GLX_EXT_swap_control_tear
       GLX_EXT_texture_from_pixmap
       GLX_EXT_buffer_age
       GLX_ARB_create_context
       GLX_ARB_create_context_profile
       GLX_EXT_create_context_es_profile
       GLX_EXT_create_context_es2_profile
       GLX_ARB_create_context_no_error
       GLX_ARB_create_context_robustness
       GLX_NV_delay_before_swap
       GLX_EXT_stereo_tree
       GLX_EXT_libglvnd
       GLX_ARB_context_flush_control
       GLX_NV_robustness_video_memory_purge
       GLX_NV_multigpu_context
       GLX_ARB_multisample
       GLX_NV_float_buffer
       GLX_ARB_fbconfig_float
       GLX_EXT_framebuffer_sRGB
       GLX_NV_copy_image
    glx_info.get_client_vendor(): NVIDIA Corporation
    glx_info.get_client_version(): 1.4
    glx_info.get_client_extensions():
       GLX_ARB_get_proc_address
       GLX_ARB_multisample
       GLX_EXT_visual_info
       GLX_EXT_visual_rating
       GLX_EXT_import_context
       GLX_SGI_video_sync
       GLX_NV_swap_group
       GLX_SGIX_fbconfig
       GLX_SGIX_pbuffer
       GLX_SGI_swap_control
       GLX_EXT_swap_control
       GLX_EXT_swap_control_tear
       GLX_EXT_buffer_age
       GLX_ARB_create_context
       GLX_ARB_create_context_profile
       GLX_NV_float_buffer
       GLX_ARB_fbconfig_float
       GLX_EXT_fbconfig_packed_float
       GLX_EXT_texture_from_pixmap
       GLX_EXT_framebuffer_sRGB
       GLX_NV_copy_image
       GLX_NV_copy_buffer
       GLX_NV_multisample_coverage
       GLX_EXT_create_context_es_profile
       GLX_EXT_create_context_es2_profile
       GLX_ARB_create_context_no_error
       GLX_ARB_create_context_robustness
       GLX_NV_delay_before_swap
       GLX_EXT_stereo_tree
       GLX_ARB_context_flush_control
       GLX_NV_robustness_video_memory_purge
       GLX_NV_multigpu_context
    glx_info.get_extensions():
       GLX_ARB_get_proc_address
       GLX_ARB_multisample
       GLX_EXT_visual_info
       GLX_EXT_visual_rating
       GLX_EXT_import_context
       GLX_SGI_video_sync
       GLX_SGIX_fbconfig
       GLX_SGIX_pbuffer
       GLX_SGI_swap_control
       GLX_EXT_swap_control
       GLX_EXT_swap_control_tear
       GLX_EXT_buffer_age
       GLX_ARB_create_context
       GLX_ARB_create_context_profile
       GLX_NV_float_buffer
       GLX_ARB_fbconfig_float
       GLX_EXT_texture_from_pixmap
       GLX_EXT_framebuffer_sRGB
       GLX_NV_copy_image
       GLX_EXT_create_context_es_profile
       GLX_EXT_create_context_es2_profile
       GLX_ARB_create_context_no_error
       GLX_ARB_create_context_robustness
       GLX_NV_delay_before_swap
       GLX_EXT_stereo_tree
       GLX_ARB_context_flush_control
       GLX_NV_robustness_video_memory_purge
       GLX_NV_multigpu_context
    
    pyglet.media
    ------------------------------------------------------------------------------
    audio driver: <pyglet.media.drivers.openal.adaptation.OpenALDriver object at 0x7ff0572179d0>
    
    pyglet.media.ffmpeg
    ------------------------------------------------------------------------------
    FFmpeg version: n5.1.2
    
    pyglet.media.drivers.openal
    ------------------------------------------------------------------------------
    Library: <CDLL 'libopenal.so.1', handle 55940f4c54a0 at 0x7ff051c09f30>
    Version: 1.1
    Extensions:
       ALC_ENUMERATE_ALL_EXT
       ALC_ENUMERATION_EXT
       ALC_EXT_CAPTURE
       ALC_EXT_DEDICATED
       ALC_EXT_disconnect
       ALC_EXT_EFX
       ALC_EXT_thread_local_context
       ALC_SOFT_device_clock
       ALC_SOFT_HRTF
       ALC_SOFT_loopback
       ALC_SOFT_loopback_bformat
       ALC_SOFT_output_limiter
       ALC_SOFT_output_mode
       ALC_SOFT_pause_device
       ALC_SOFT_reopen_device
    
    pyglet.input.wintab
    ------------------------------------------------------------------------------
    WinTab not available.
    
    bug 
    opened by Belissimo-T 5
Releases(v2.0.3)
  • v2.0.3(Jan 2, 2023)

    Changes and Improvements

    • shapes: Batch and Group can now be changed on shapes after instantiation, similar to Sprites.
    • font: DirectWrite & Freetype fonts now expose a filename attribute. macOS not yet implemented.
    • Windows: DirectWrite fonts parse font names in a more correct manner. Setting pyglet.options['dw_legacy_naming'] to True will restore the old behavior, but this may be removed at a later date.
    • math: Vec types can now be updated with slices (velocity[:] = 1, 2)
    • math: Matrix operations now behave more like GLSL.

    Bugfixes

    • macOS: fix crash when supplying OpenGL Config without explicit major/minor versions #739
    • To prevent crashing on many OpenGL drivers, Textures are no longer initialized with empty data.
    • fixed font_comparison.py example.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.2.1(Dec 20, 2022)

    Bugfixes

    • Fix Config.opengl_api being always set to None.
    • Windows: fix Display.get_default_screen() always returning the first index.

    Changes

    • Remove legacy Xlib backend code.
    • Add initial support for Compute Shaders.
    • Windows: a high performance event timer is requested by the PlatformEventLoop.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Dec 2, 2022)

    Bugfixes

    • Windows: only enable DirectWrite color font for supported OSes.
    • gui: don't unset TextEntry widget focus on mouse motion.
    • image: Prevent BufferManager crash when stencil buffer query fails #703
    • macOS input: fix broken get_guid link for Controllers.
    • math: fix Mat4.look_at. #708
    • shader: fix vertex_list passing id instead of self to Batch.get_domain
    • shapes: fix crash when setting Arc.visible = False

    Changes

    • shapes: add Arc.start_angle setter
    • graphics: Various default Group changes to help improve Group consolidation
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Nov 1, 2022)

    pyglet 2.0.0 Major Release

    Changes

    • pyglet has been upgraded to use use OpenGL 3.3+ core functionality.
    • All high level modules have been internally updated to use modern OpenGL.
    • A large number of cleanups and optimizations.

    Features

    • New pyglet.math module including common Matrix and Vector operations.
    • New pyglet.graphics.shader module for easily managing Shader objects.
    • New OpenGL bindings, and binding tools.
    • New Game Controller API for modern game controllers, including rumble and automapping.
    • New Framebuffer classes.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.27(Sep 21, 2022)

    Bugfixes

    • Windows - stop setting HWND_TOPMOST for fullscreen windows
    • obj decoder - Fix GL_SHININESS (Ns) value parsing
    • Fix broken property setter for shapes.Polygon (#676)
    • Fix keys getting "stuck" in KeyStateHandler when Window loses focus (#682)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.24(May 12, 2022)

    Features

    • Add initial support for FFmpeg 5.0
    • Windows - The GDI font renderer now supports Unicode font names.

    Bugfixes

    • Windows - Fix on_resize event not dispatched when set_size is called.
    • Documentation updates, fixed links, and corrections.
    • Windows - Fix crash when font characters are more than one codepoint in length.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.23(Mar 21, 2022)

    Features

    • Windows - Add win32_disable_shaping option. This can improve font performance when shaping isn't required.
    • Backport the latest pyglet.math module changes from the development branch.

    Bugfixes

    • Linux - Fix crash when Gstreamer Gst bindings are not installed.
    • Fix math.Vec4.clamp method.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.22(Mar 2, 2022)

    Features

    • If the PyOgg module is installed, it can be used for loading various Vorbis audio formats.
    • Add a new CameraGroup example, to show implementing a Camera with pyglet's Groups.
    • Add angle and start_angle property/setter to shapes.Sector.
    • Windows - new WMF based encoder for faster saving of common image formats.

    Bugfixes

    • Fix indexing error when setting text.Label.opacity (#481)
    • Windows - Fix shift modifier + exclusive mouse mode (#472)
    • Linux - Prevent non-Tablet devices from being detected as Tablets (#491)
    • Windows - Prevent distortion with multiple XAudio2 audio sources (#515)
    • Fix frame dropping bug with FFMpeg decoder.
    • Windows - Fix Video alpha channel for WMF decoder.
    • Varios documentation and docstring fixes. Thanks everyone!
    Source code(tar.gz)
    Source code(zip)
  • v1.5.21(Sep 16, 2021)

    Features

    • A new MovableFrame that allows repositioning Widgets when a specified key modifier is held.
    • Text Layouts now have opacity and visible attributes, similar to Sprites.
    • Add new shapes.Ellipse class.

    Bugfixes

    • Xlib - don't enable certain Window options if transparency is not enabled. (#454)
    • Windows - Fix issue with some fonts where glyphs overhanging their advance would be cut off.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.20(Sep 8, 2021)

    Features

    • Experimental support for transparent and overlay windows on Linux and Windows.
    • Shapes - Allow rotation and changing of border color for the BorderedRectangle.

    Bugfixes

    • Xlib - Fix the mouse Y position being off by 1-pixel.
    • Windows - Fix gapless audio playback on the XAudio2 backend.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.18(Jun 23, 2021)

    Bugfixes

    • If XAudio2 device creation fails, catch exception so that the next driver can be tried.
    • Fix dangling file pointers in GStreamer decoder.
    • Expose font.name attribute to show the font family name.
    • Un-associate queued Source from a deleted Player instance (#256)
    • Fix circular import when trying to create a Windows in 'headless' mode.
    • Un-associate StreamingSources from deleted Player instances (#256)
    • Update pypng lib to avoid deprecated functions (#405)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.17(May 21, 2021)

    Bugfixes

    • FFmpeg decoder add FF_INPUT_BUFFER_PADDING_SIZE to buffers.
    • Add missing DI8DEVTYPE_SUPPLEMENTAL joystick device type.
    • Fix bool clamping causing crash with DirectWrite text decoder.

    Maintenance

    • Change IncrementalTextLayout to use glScissor instead of glClipPlane.
    • Raise warning on Window creation if the GPU drivers do not support OpenGL 2.0

    Features

    • Add a new shapes.Star shape.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.16(Apr 13, 2021)

    Bugfixes

    • 3d model obj decoder supports multiple material types
    • Fix GStreamerSources not being garbage collected #283
    • Fix ScrollableTextLayout not respecting anchors/alignment.

    Features

    • New DirectWrite based font loader. Enable with pyglet.options["advanced_font_features"] = True
    • Add position property to Text Layouts, to mimic other classes.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.15(Feb 9, 2021)

    Bugfix and maintenance release

    Bugfixes

    • shapes.Circle segment calculation will always use a minimum of 14 segments.
    • shapes.Arc is now made from line segments, and by default has unconnected ends.
    • Windows - Use the internal keystate to determine the mod shift rather than relying on GetKeyState which relies on another event that may be called after WM_INPUT.

    Maintenance

    • Various Headless backend and EGL work.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.14(Dec 31, 2020)

    Bugfixes

    • Fix interlaced mp3 decoding in GStreamer backend.
    • Skip functions marked as OBJC_ARM64_UNAVAILABLE for new ARM Macs.

    Features

    • Add a WaveEncoder for saving audio Sources to disk.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.13(Dec 18, 2020)

    Bugfixes

    • Fix crash on looping video with no sound (#322)
    • OSX: Replace remaining usage of find_library to fix Big Sur issues (#332)
    • Windows: Fix default orientation for the XAudio2 listener.

    Features

    • Add new shape.Triangle shape.
    • Windows: on_key_press now dispatches unique events for left/right Shift keys.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.11(Nov 19, 2020)

  • v1.5.9(Nov 9, 2020)

    Bugfixes

    • Explicitly cast media.synthesis data to bytes to prevent issues on some audio drivers.
    • Refactor WIC module to work with new com module. (#298)
    • Prevent crash when setting shapes.Circle.visable. (#294)
    • Remove deprecated tostring calls in PIL/PNG decoders to prevent crash on Python 3.9. (#295, #302)

    Improvements

    • Add new Xaudio2 driver. (#288)
    • Refactor pyglet's lazy module loading to better support code inspection.
    • Added new TextEntry widget.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.8(Oct 16, 2020)

    Improvements

    • Added new experimental gui module. Currently this only contains basic widgets.
    • Added new Group.visible property, to toggle rendering of entire Groups when used in a Batch.
    • Added Sprite.paused and Sprite.frame_index helper properties for controlling Animations.
    • Reorganized the examples folder.
    • Added new CenteredCamera example.
    • Backport pyglet.math from 2.0, for more exposure and testing.
    • Consolidate Codec logic into base class to reuse among various modules.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.7(Jun 21, 2020)

    Bugfixes

    • Fix crash when no audio device is available.
    • Prevent __del__ spam in DirectSound buffers and Wave decoder.
    • Explicitly cast warnings.warn message to a str to prevent numba error.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.6(Jun 12, 2020)

    Bugfixes

    • Fix infinite recursion error on OSX. (#5)
    • The on_mouse_scroll event no longer clamps to int, preventing lost motion on trackpads.
    • Prevent traceback when DirectSound buffers are garbage collected on exit.
    • Fix StaticSource playback with WMF decoder (streaming=False).
    • Fix colorspace for WMF video decoding.
    • Prevent crash on garbage collection for FFmpeg decoder.

    Improvements

    • New image decoder leveraging Windows Imaging Component (WIC).
    • TextureAtlas/Bins now have a border argument for leaving n-pixels of blank space around images when adding. By default the resource module leaves a 1-pixel space around images.
    • Many small documentation fixes and corrections.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.5(May 3, 2020)

    Bugfixes

    • GStreamer decoder clamped to 16bit sample width, since the default OpenAL backend on Linux does not support anything higher.

    Improvements

    • shapes module: added Circle.rotation property and blending to standalone shape draw methods.
    • shapes module: added missing delete and __del__ methods.
    • The ImageMouseCursor has a new accelerated parameter to allow custom mouse points to be drawn natively on Windows and Linux.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.4(Apr 22, 2020)

    Bugfixes

    • Avoid WMFDecoder crash when mixing pyglet with other tookits. (#174)
    • Prevent EventDispatcher subclasses from hiding AttributeError exceptions.

    Improvements

    • Added pyglet.shapes module for creating simple 2D shapes.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.3(Apr 6, 2020)

  • v1.5.2(Mar 23, 2020)

    Bugfixes

    • Fix WMF decoder for pre-Windows 8 systems.
    • Fix WMF decoder loading from file-like objects for Windows Vista.
    • Fix WMF decoder crashing when attempting to seek past file duration.

    Changes

    • Allow GStreamer and FFmpeg decoder to load from file-like objects.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Mar 18, 2020)

    Improvements

    • New "file_drops" Window argument to allow drag and drop of files. This is complimented by a new Window.on_file_drop event, which returns the mouse position and file path.

    Bugfixes

    • Fix issue with changing Label positions by fractional values.
    • Avoid performance issue due to unnecessary context switching with single Window programs.
    • Fix crash on Player.next_source when playing a video with no audio track.
    • Fix crash when disconnecting a Joystick on Windows.
    • Prevent media Players from seeking to negative timestamps.
    • Fix OpenAL audio driver not dispatching events.

    Changes

    • text.TextLayouts are no longer bound to int positioning.
    • Raise exception if attempting to import from legacy Python.
    • Add GStreamer decoder for compressed audio on Linux.
    • Add Windows Media Foundation decoder for compressed audio on Windows.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Feb 18, 2020)

    Bugfix and Maintenance release

    Bugfixes

    • Removed global dubug function access in del methods to prevent smooth shutdown.
    • Fix regression not allow SourceGroups to be queued on Player objects. (#140)

    Changes

    • Support for Python 2 has been dropped. Python 3.5 is now the minimum supported version.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.10(Jan 17, 2020)

  • v1.4.9(Jan 1, 2020)

    Bugfix and small improvement release

    Bugfixes

    • Fix TextLayoutGroup consolidation when using custom Groups for Labels.
    • FFmpeg: Cast 'date' to string instead of int in file_info. (#109)
    • Fix ctypes error causing by incorrectly specifying a Union as an argtype. (#112)

    Improvements

    • Added a simple 2D Camera example to examples/camera.py in the repository.
    • OSX: OpenGL context creation is more lenient with requested versions.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.8(Nov 21, 2019)

    Bugfixes

    • FFmpeg: fix an occasional crash during seek operation.
    • Revert Event Dispatcher changes from v1.4.7 due to possible bug.
    • Linux: Warn on failure to set vsync, instead of crashing.
    Source code(tar.gz)
    Source code(zip)
Kivy is an open source Python framework for creating cross-platform multi-touch mobile applications with Natural User Interface.

Kivy is an open source Python framework for creating cross-platform multi-touch mobile applications with Natural User Interface.

Grace Ugochi Nneji 3 Feb 15, 2022
MediaPlayer-with-PyQt5 - The Multimedia Player with Python and PyQt5

MediaPlayer-with-PyQt5 I made this Multimedia Player with Python and PyQt5, I re

null 4 Oct 6, 2022
A simple Python Module for sending cross-platform desktop notifications on Windows, macOS and Linux

notify.py Cross platform desktop notifications for Python scripts and applications. Docs You can read the docs on this Git's Wiki, or here Supported P

Mustafa 178 Dec 26, 2022
HDLG is a modern cross-platform GUI for hdl-dump with Batch installation capabilities.

HDLG is a modern cross-platform GUI for hdl-dump with Batch installation capabilities. Looking for Artwork This project is looking for an Icon an

null 8 Dec 3, 2022
Cross-platform BrowserViews for the desktop.

Webview We use wxPython Phoenix to provide webviews. It's cross platform between Windows and macOS primarily, Linux versions require extra setup. Appl

null 1 Feb 12, 2022
EZ Presence - A GUI-Python app which makes it easy to set a custom Discord Rich Presence. (BETA)

EZ Presence EZ Presence is a GUI-Python app which makes it easy to set any custom Discord Rich Presence. Using the App How to Run Since the app is in

notsniped 2 Mar 1, 2022
Projeto de mini-games de azar com interface gráfica utilizando Python e PySimpleGui.

Gambling Mini jogos de azar unidos em uma mesma interface gráfica, utilizando a linguagem de programação Python em conjunto com a biblioteca de interf

Clayton Garcia da Silva 3 Nov 19, 2021
A library for building modern declarative desktop applications in WX.

re-wx is a library for building modern declarative desktop applications. It's built as a management layer on top of WXPython, which means you get all the goodness of a mature, native, cross-platform UI kit, wrapped up in a modern, React inspired API.

Chris 115 Dec 24, 2022
Create shortcuts on Windows to your Python, EXE, Batch files or any other file using a GUI made with PySimpleGUI

shor Windows Shortcut Creation Create Windows Shortcuts to your python programs and any other file easily using this application created using PySimpl

PySimpleGUI 7 Nov 16, 2021
Make desktop applications using HTML and CSS with python

Neutron Make desktop applications using HTML and CSS with python What is Neutron Neutron will allow developers to design modern applications in python

Ian Baldelli 284 Dec 29, 2022
A simple yet powerful TUI framework for your Python (3.7+) applications

A simple yet powerful TUI framework for your Python (3.7+) applications

null 1.4k Jan 4, 2023
Python code examples on how to create several applications using Dear PyGui.

Python code examples on how to create several applications using Dear PyGui. Includes building and editing a table, as well as visualizing sorting algorithms in a plot.

Alexander H. 7 Sep 15, 2022
This simple python program can be used to make FontChooser dialog in Tkinter Applications.

tkFontBox This simple python program can be used to make FontChooser dialog in Tkinter Applications. how to use? Copy the tkFontBox.py file into your

Pawan Kumar Prachi 1 Feb 8, 2022
This is a GUI based text and image messenger. Other functionalities will be added soon.

Pigeon-Messenger (Requires Python and Kivy) Pigeon is a GUI based text and image messenger using Kivy and Python. Currently the layout is built. Funct

null 4 Jan 21, 2022
An qt asset browser for applications like houdini/nuke/maya/blender

AssetBrowser A qt asset browser for applications like houdini/nuke/maya/blender Currently in development Note: Only houdini plugin available during de

Jonas Sorgenfrei 6 Aug 5, 2022
A little Python library for making simple Electron-like HTML/JS GUI apps

Eel Eel is a little Python library for making simple Electron-like offline HTML/JS GUI apps, with full access to Python capabilities and libraries. Ee

Chris Knott 5.4k Jan 7, 2023
Edifice: a declarative GUI library for Python

Edifice is a Python library for building reactive UI, inspired by modern Javascript libraries such as React.

David Ding 193 Dec 11, 2022
yfinance is a library where you can see stocks, crypto and tickers information

yfinance is a library where you can see stocks, crypto and tickers information.

Joaquin 3 Nov 19, 2022
Learn to build a Python Desktop GUI app using pywebview, Python, JavaScript, HTML, & CSS.

Python Desktop App Learn how to make a desktop GUI application using Python, JavaScript, HTML, & CSS all thanks to pywebview. pywebview is essentially

Coding For Entrepreneurs 55 Jan 5, 2023