Skip to content

Commit

Permalink
Merge branch 'master' into deprecate_setup_py
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Oct 13, 2023
2 parents 69dbac0 + 200f2b9 commit 035250e
Show file tree
Hide file tree
Showing 46 changed files with 201,164 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = W503,C901
max-line-length = 120
exclude = tests/*,temp/
exclude = tests/*,temp/,.tox,.venv
max-complexity = 10
3 changes: 2 additions & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
image: latest

python:
version: 3.7
version: 3.8
install:
- method: pip
path: .
Expand Down
42 changes: 41 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## 2.4.4

* Added `--backend` option to specify context backend.
This is mostly for the headless window to enable EGL.
* Window now has a ``backend`` property containing the name of the context backend
* Window now has a ``headless`` boolean property to check if the window is headless.
This is useful for adding headless only paths in your code.
* Added stencil bits to window framebuffers by default

## 2.4.3

* Fix compatibility with moderngl 5.8.x
* Camera now has keymap support (QWERTY, AZERTY etc)

## 2.4.2

* Allow toggling vsync and runtime for most windows
* Allow rendering with imgui in headless mode
* Fixed a crash when using fullscreen mode with glfw
* Support moving OrbitCamera
* Added SSAO example
* Added `on_generic_event` callback for pygame user events
* Fixed zoom sensitivity getter returning the wrong value
* Fixed several typos
* Bumped several dependencies to reasonable versions

Thanks to @Rafale25, @n3onUser, @erikstrand (Erik Strand),
@sheepman4267 and @dbs4261 (Daniel Simon) for contributions to this release.

## 2.4.1

* Experimental support for ffmpeg capture
* Event callbacks can now be assigned in WindowConfig.__init__
* Initial support for confirming window close (glfw)
* Fixed a crash when closing a pyglet window
* Remove some spammy prints in the text writer

Thanks to @DavideRuzza, @wk39 and @joehalliwell for their
contributions to this release.

## 2.4.0

Python 3.5 is no longer supported from this version.
Expand All @@ -10,7 +50,7 @@ New Features
* Various smaller improvements
* F11 now toggles fullscreen mode by default
* Window modules are now fetched from `moderngl_window.WINDOW_CLASSES`
as a fallback. This is necessary in some enviroments.
as a fallback. This is necessary in some environments.
* Absolute paths will now bypass all registered resource directories
and load the specified file directly.

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def __getattr__(cls, name):
# -- Project information -----------------------------------------------------

project = 'moderngl-window'
copyright = '2019, Einar Forselv'
copyright = '2023, Einar Forselv'
author = 'Einar Forselv'

# The short X.Y version
version = '2.3.0'
version = '2.4.4'
# The full version, including alpha/beta/rc tags
release = version

Expand Down
3 changes: 3 additions & 0 deletions docs/reference/context/basewindow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Attributes
.. autoattribute:: BaseWindow.keys
:annotation:
.. autoattribute:: BaseWindow.ctx
.. autoattribute:: BaseWindow.backend
.. autoattribute:: BaseWindow.headless
.. autoattribute:: BaseWindow.fbo
.. autoattribute:: BaseWindow.title
.. autoattribute:: BaseWindow.exit_key
Expand Down Expand Up @@ -63,6 +65,7 @@ Attributes
.. autoattribute:: BaseWindow.close_func
.. autoattribute:: BaseWindow.iconify_func
.. autoattribute:: BaseWindow.key_event_func
.. autoattribute:: BaseWindow.on_generic_event_func
.. autoattribute:: BaseWindow.mouse_position_event_func
.. autoattribute:: BaseWindow.mouse_press_event_func
.. autoattribute:: BaseWindow.mouse_release_event_func
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/context/glfw.window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Attributes
.. autoattribute:: Window.keys
:annotation:
.. autoattribute:: Window.ctx
.. autoattribute:: Window.backend
.. autoattribute:: Window.headless
.. autoattribute:: Window.fbo
.. autoattribute:: Window.title
.. autoattribute:: Window.exit_key
Expand Down Expand Up @@ -63,6 +65,7 @@ Attributes
.. autoattribute:: Window.resize_func
.. autoattribute:: Window.iconify_func
.. autoattribute:: Window.key_event_func
.. autoattribute:: Window.on_generic_event_func
.. autoattribute:: Window.mouse_position_event_func
.. autoattribute:: Window.mouse_press_event_func
.. autoattribute:: Window.mouse_release_event_func
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/context/headless.window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Attributes
.. autoattribute:: Window.keys
:annotation:
.. autoattribute:: Window.ctx
.. autoattribute:: Window.backend
.. autoattribute:: Window.headless
.. autoattribute:: Window.fbo
.. autoattribute:: Window.title
.. autoattribute:: Window.exit_key
Expand Down Expand Up @@ -63,6 +65,7 @@ Attributes
.. autoattribute:: Window.close_func
.. autoattribute:: Window.iconify_func
.. autoattribute:: Window.key_event_func
.. autoattribute:: Window.on_generic_event_func
.. autoattribute:: Window.mouse_position_event_func
.. autoattribute:: Window.mouse_press_event_func
.. autoattribute:: Window.mouse_release_event_func
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/context/pyglet.window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Attributes
.. autoattribute:: Window.keys
:annotation:
.. autoattribute:: Window.ctx
.. autoattribute:: Window.backend
.. autoattribute:: Window.headless
.. autoattribute:: Window.fbo
.. autoattribute:: Window.title
.. autoattribute:: Window.exit_key
Expand Down Expand Up @@ -80,6 +82,7 @@ Attributes
.. autoattribute:: Window.close_func
.. autoattribute:: Window.iconify_func
.. autoattribute:: Window.key_event_func
.. autoattribute:: Window.on_generic_event_func
.. autoattribute:: Window.mouse_position_event_func
.. autoattribute:: Window.mouse_press_event_func
.. autoattribute:: Window.mouse_release_event_func
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/context/pyqt5.window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Attributes
.. autoattribute:: Window.keys
:annotation:
.. autoattribute:: Window.ctx
.. autoattribute:: Window.backend
.. autoattribute:: Window.headless
.. autoattribute:: Window.fbo
.. autoattribute:: Window.title
.. autoattribute:: Window.exit_key
Expand Down Expand Up @@ -76,6 +78,7 @@ Attributes
.. autoattribute:: Window.close_func
.. autoattribute:: Window.iconify_func
.. autoattribute:: Window.key_event_func
.. autoattribute:: Window.on_generic_event_func
.. autoattribute:: Window.mouse_position_event_func
.. autoattribute:: Window.mouse_press_event_func
.. autoattribute:: Window.mouse_release_event_func
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/context/pyside2.window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Attributes
.. autoattribute:: Window.keys
:annotation:
.. autoattribute:: Window.ctx
.. autoattribute:: Window.backend
.. autoattribute:: Window.headless
.. autoattribute:: Window.fbo
.. autoattribute:: Window.title
.. autoattribute:: Window.exit_key
Expand Down Expand Up @@ -76,6 +78,7 @@ Attributes
.. autoattribute:: Window.close_func
.. autoattribute:: Window.iconify_func
.. autoattribute:: Window.key_event_func
.. autoattribute:: Window.on_generic_event_func
.. autoattribute:: Window.mouse_position_event_func
.. autoattribute:: Window.mouse_press_event_func
.. autoattribute:: Window.mouse_release_event_func
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/context/sdl2.window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Attributes
.. autoattribute:: Window.keys
:annotation:
.. autoattribute:: Window.ctx
.. autoattribute:: Window.backend
.. autoattribute:: Window.headless
.. autoattribute:: Window.fbo
.. autoattribute:: Window.title
.. autoattribute:: Window.exit_key
Expand Down Expand Up @@ -68,6 +70,7 @@ Attributes
.. autoattribute:: Window.close_func
.. autoattribute:: Window.iconify_func
.. autoattribute:: Window.key_event_func
.. autoattribute:: Window.on_generic_event_func
.. autoattribute:: Window.mouse_position_event_func
.. autoattribute:: Window.mouse_press_event_func
.. autoattribute:: Window.mouse_release_event_func
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/moderngl_window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
moderngl_window
===============

General helper functions aiding in the boostrapping of this library.
General helper functions aiding in the bootstrapping of this library.

.. autofunction:: setup_basic_logging
.. autofunction:: activate_context
Expand Down
1 change: 1 addition & 0 deletions examples/advanced/pygame2.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self, **kwargs):
# 24 bit (rgba) moderngl texture
self.pg_texture = self.ctx.texture(self.pg_res, 4)
self.pg_texture.filter = moderngl.NEAREST, moderngl.NEAREST
self.pg_texture.swizzle = "BGRA"

# Simple geometry and shader to render
self.cube = geometry.cube(size=(2.0, 2.0, 2.0))
Expand Down
1 change: 1 addition & 0 deletions examples/advanced/pygame2_background_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self, **kwargs):
# 24 bit (rgba) moderngl texture
self.pg_texture = self.ctx.texture(self.window_size, 4)
self.pg_texture.filter = moderngl.NEAREST, moderngl.NEAREST
self.pg_texture.swizzle = "BGRA"

self.texture_program = self.load_program('programs/texture.glsl')
self.quad_texture = self.load_texture_2d('textures/python-bg.png')
Expand Down
Loading

0 comments on commit 035250e

Please sign in to comment.