Skip to content

Instantly share code, notes, and snippets.

@LennyPhoenix
Created August 6, 2020 22:13
Show Gist options
  • Save LennyPhoenix/cc7238ea2a659a8ca0dba1ede6f507b4 to your computer and use it in GitHub Desktop.
Save LennyPhoenix/cc7238ea2a659a8ca0dba1ede6f507b4 to your computer and use it in GitHub Desktop.

Examples

Examples Status

NOTE: I have not tested the subfolder examples. This includes 3dmodel, astraea, game (the example game), noisy, programming_guide and soundspace.

  • apple_remote.py [Unknown]

    • Unable to test as I do not own an apple IR remote.
    • Missing license comment.
  • apple_remote_demo.py [Unknown]

    • Unable to test as I do not own an apple IR remote.
    • Missing license comment.
  • camera.py [Functional]

    • Works as intended.
    • Missing license comment.
  • fixed_resolution.py [Broken]

    • Running throws the following error:

      Traceback (most recent call last):
        File "path/to/pyglet/examples/fixed_resolution.py", line 129, in <module>
          viewport = FixedResolutionViewport(window,
        File "path/to/pyglet/examples/fixed_resolution.py", line 70, in __init__
          self.texture = pyglet.image.Texture.create(width, height,
      TypeError: create() got an unexpected keyword argument 'rectangle'
    • With the kwarg removed, the following error is thrown:

        File "path/to/pyglet/examples/fixed_resolution.py", line 115, in set_fixed_projection
          glMatrixMode(GL_PROJECTION)
        File "path\to\pyglet\pyglet\gl\lib.py", line 106, in errcheck
          raise GLException(msg)
      pyglet.gl.lib.GLException: b'invalid operation'

      (Traceback shortened)

  • font_comparison.py [Functional]

    • Works as intended.
  • gamecontroller.py [Unknown]

    • Unable to test as I do not currently have a game controller with me.
    • Will test later.
    • Missing docstring.
    • Missing license comment.
  • hello_world.py [Functional]

    • Works as intended.
    • Missing docstring.
    • Missing license comment.
  • html_label.py [Broken]

    • Running throws the following error:

      Traceback (most recent call last):
        File "path/to/pyglet/examples/html_label.py", line 60, in <module>
          label = pyglet.text.HTMLLabel(html, location=location,
        File "path\to\pyglet\pyglet\text\__init__.py", line 506, in __init__
          super(HTMLLabel, self).__init__(document, x, y, width, height,
        File "path\to\pyglet\pyglet\text\__init__.py", line 268, in __init__
          super(DocumentLabel, self).__init__(document,
        File "path\to\pyglet\pyglet\text\layout.py", line 810, in __init__
          self.document = document
        File "path\to\pyglet\pyglet\text\layout.py", line 918, in document
          self._init_document()
        File "path\to\pyglet\pyglet\text\layout.py", line 1020, in _init_document
          self._update()
        File "path\to\pyglet\pyglet\text\layout.py", line 958, in _update
          self._create_vertex_lists(left + line.x, top + line.y, line.start, line.boxes, context)
        File "path\to\pyglet\pyglet\text\layout.py", line 1420, in _create_vertex_lists
          box.place(self, i, x, y, context)
        File "path\to\pyglet\pyglet\text\layout.py", line 453, in place
          self.element.place(layout, x, y)
        File "path\to\pyglet\pyglet\text\formats\structured.py", line 57, in place
          group = pyglet.graphics.TextureGroup(self.image.get_texture(), layout.top_group)
      AttributeError: 'HTMLLabel' object has no attribute 'top_group'
  • image_convert.py [Functional]

    • Works as intended converting png to jpg.
    • Other formats have not been tested.
  • image_display.py [Broken]

    • Running throws the following error:

        File "image_display.py", line 57, in on_draw
          background.blit_tiled(0, 0, 0, window.width, window.height)
        File "path\to\pyglet\pyglet\image\__init__.py", line 1828, in blit_tiled
          glEnable(self.target)
        File "path\to\pyglet\pyglet\gl\lib.py", line 106, in errcheck
          raise GLException(msg)
      pyglet.gl.lib.GLException: b'invalid enumerant'

      (Traceback shortened)

  • input.py [Functional]

    • Works as intended with mouse and keyboard.
    • Other input devices have not been tested.
    • Missing license comment.
  • joystick.py [Unknown]

    • Unable to test as I do not own a joystick.
    • Missing valid docstring.
    • Missing license comment.
  • media_info.py [Semi-Functional]

    • Claims that ffmpeg is not installed despite a valid ffmpeg.exe in system path.
    • Prints media info perfectly fine.
    • Missing license comment.
  • media_player.py [Broken]

    • Running throws the following error:

        File "media_player.py", line 70, in draw_rect
          glBegin(GL_LINE_LOOP)
        File "path\to\pyglet\pyglet\gl\lib.py", line 106, in errcheck
          raise GLException(msg)
      pyglet.gl.lib.GLException: b'invalid operation'

      (Traceback shortened)

  • multiple_windows.py [Broken]

    • Running throws the following error:

        File "path/to/pyglet/examples/multiple_windows.py", line 53, in setup
          glColor3f(.5, .5, .5)
        File "path\to\pyglet\pyglet\gl\lib.py", line 106, in errcheck
          raise GLException(msg)
      pyglet.gl.lib.GLException: b'invalid operation'

      (Traceback shortened)

  • opengl.py [Broken]

    • Renders a blank, white screen.

    • The following warnings are outputted when executing:

      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 'v3f'. Please use the actual attribute names as defined in the Shader Program.
        warnings.warn(message)
      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 'n3f'. Please use the actual attribute    names as defined in the Shader Program.
        warnings.warn(message)
  • opengl_context.py [Functional]

    • Works as intended.
    • Missing license comment.
  • opengl_core.py [Semi-Functional]

    • The following warnings are outputted when executing:

      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 'v3f'. Please use the actual attribute names as defined in the Shader Program.
        warnings.warn(message)
      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 'c3f'. Please use the actual attribute    names as defined in the Shader Program.
        warnings.warn(message)
      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 'v2f'. Please use the actual attribute    names as defined in the Shader Program.
        warnings.warn(message)
      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 'v2i'. Please use the actual attribute    names as defined in the Shader Program.
        warnings.warn(message)
    • Aside from this, the example seems to run fine.

    • Missing docstring.

    • Missing license comment.

  • opengl_scissor.py [Broken]

    • Running throws the following error:

        File "path\to\pyglet\pyglet\image\atlas.py", line 274, in add
          atlas = TextureAtlas(self.texture_width, self.texture_height, self._border)
      AttributeError: 'TextureBin' object has no attribute '_border'
    • The issue does not seem to be related to the ScissorGroup class itself, though the class has not actually been tested.

    • Missing license comment.

  • register_event_type.py [Functional]

    • Works as intended.
    • Missing license comment.
  • show_input.py [Issue-Located]

    • Running throws the following error:

        File "path\to\pyglet\pyglet\__init__.py", line 330, in __getattr__
          return getattr(module, name)
      AttributeError: module 'pyglet.graphics' has no attribute 'OrderedGroup'

      (Traceback shortened)

    • The OrderedGroup class is currently missing.

    • Missing license comment.

  • synthesizer.py [Functional]

    • Works as intended.
    • Missing docstring.
    • Missing license comment.
  • tablet.py [Untested]

    • I was unable to test this as I do not own a tablet.
    • Missing docstring.
    • Missing license comment.
  • text_input [Broken]

    • Everything but the input text is rendered.
    • Note that the text is being set correctly, but it and the Caret is not visible.
    • Missing license comment.
  • timer.py [Functional]

    • Works as intended.
  • video.py [Broken]

    • Nothing is rendered.

    • The following warnings are outputted when executing:

      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 'v3f'. Please use the actual attribute names as defined in the Shader Program.
        warnings.warn(message)
      path\to\pyglet\pyglet\graphics\vertexattribute.py:250: UserWarning: Vertex attribute shorthand notation is deprecated: 't3f'. Please use the actual attribute    names as defined in the Shader Program.
        warnings.warn(message)
    • After waiting long enough, the following error is outputted:

        File "video.py", line 67, in on_draw
          player.texture.blit(0, 0)
      AttributeError: 'NoneType' object has no attribute 'blit'

      (Traceback shortened)

  • window_events.py [Issue-Located]

    • pyglet.window.event is not imported by default, so it usually returns an AttributeError, however it can be fixed easily by adding the following to the top of the file:

      import pyglet.window.event

      Note that it may be more desirable to add the import to pyglet.window.__init__.

  • window_platform_event.py [Functional]

    • Works as intended.
    • NOTE: Only the Windows event was tested, Linux is yet to be tested.

Example Ideas

List any ideas for future examples here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment