Skip to content

Commit e3a2cd4

Browse files
authored
Update SDL2 bindings to 2.0.20 (#214)
* Update bindings to SDL 2.0.20 * Update CI to use 2.0.20 binaries * Updated news.rst
1 parent 93332c9 commit e3a2cd4

File tree

8 files changed

+39
-21
lines changed

8 files changed

+39
-21
lines changed

.ci/getsdl2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
}
2626

2727
libversions = {
28+
'2.0.20': {
29+
'SDL2': '2.0.20',
30+
'SDL2_mixer': '2.0.4',
31+
'SDL2_ttf': '2.0.18',
32+
'SDL2_image': '2.0.5',
33+
'SDL2_gfx': '1.0.4'
34+
},
2835
'2.0.18': {
2936
'SDL2': '2.0.18',
3037
'SDL2_mixer': '2.0.4',

.github/workflows/run_tests.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
26-
sdl2: ['2.0.18']
26+
sdl2: ['2.0.20']
2727
name-prefix: ['Linux (Python ']
2828
include:
2929
- python-version: 'pypy-2.7'
30-
sdl2: '2.0.18'
30+
sdl2: '2.0.20'
3131
name-prefix: 'Experimental / Linux ('
3232
- python-version: 'pypy-3.7'
33-
sdl2: '2.0.18'
33+
sdl2: '2.0.20'
3434
name-prefix: 'Experimental / Linux ('
3535

3636
env:
@@ -71,11 +71,11 @@ jobs:
7171
fail-fast: false
7272
matrix:
7373
python-version: [3.9]
74-
sdl2: ['2.0.18', '2.0.16', '2.0.14']
74+
sdl2: ['2.0.20', '2.0.16', '2.0.14']
7575
name-prefix: ['macOS (Python ']
7676
include:
7777
- python-version: '2.7'
78-
sdl2: '2.0.18'
78+
sdl2: '2.0.20'
7979
name-prefix: 'macOS (Python '
8080
- python-version: '3.9'
8181
sdl2: 'from Homebrew'
@@ -127,20 +127,21 @@ jobs:
127127
matrix:
128128
python-version: [3.9]
129129
architecture: ['x64']
130-
sdl2: ['2.0.18', '2.0.16', '2.0.14', '2.0.12', '2.0.10', '2.0.9', '2.0.8', '2.0.7', '2.0.6', '2.0.5']
130+
sdl2: ['2.0.20', '2.0.18', '2.0.16', '2.0.14', '2.0.12',
131+
'2.0.10', '2.0.9', '2.0.8', '2.0.7', '2.0.6', '2.0.5']
131132
name-prefix: ['Windows (Python ']
132133
include:
133134
- python-version: '2.7'
134135
architecture: 'x64'
135-
sdl2: '2.0.18'
136+
sdl2: '2.0.20'
136137
name-prefix: 'Windows (Python '
137138
- python-version: '2.7'
138139
architecture: 'x86'
139-
sdl2: '2.0.18'
140+
sdl2: '2.0.20'
140141
name-prefix: 'Windows 32-bit (Python '
141142
- python-version: '3.9'
142143
architecture: 'x86'
143-
sdl2: '2.0.18'
144+
sdl2: '2.0.20'
144145
name-prefix: 'Windows 32-bit (Python '
145146
- python-version: '2.7'
146147
architecture: 'x86'

doc/news.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ Release News
22
============
33
This describes the latest changes between the PySDL2 releases.
44

5+
0.9.11
6+
------
7+
8+
Released on XXXX-XX-XX.
9+
10+
New Features:
11+
12+
* Updated to wrap new functions and constants in SDL2 2.0.20 (PR #214)
13+
14+
515
0.9.10
616
------
717

@@ -14,7 +24,7 @@ New Features:
1424
allows functions to support kwargs (i.e. using function arguments by name),
1525
inline documentation, and more flexible handling of argument types and
1626
SDL errors (PR #199)
17-
* Updated to wrap new functions and constants in in SDL2 2.0.18 (PR #197)
27+
* Updated to wrap new functions and constants in SDL2 2.0.18 (PR #197)
1828
* Added full inline documentation for the :mod:`~sdl2.sdlttf`,
1929
:mod:`~sdl2.sdlimage`, and :mod:`~sdl2.sdlgfx` modules, as well as partial
2030
inline documentation for the :mod:`~sdl2.sdlmixer` modlue. In addition to
@@ -154,7 +164,7 @@ Released on 2021-09-02.
154164

155165
New Features:
156166

157-
* Updated to wrap new functions and constants in in SDL2 2.0.16 (PR #190)
167+
* Updated to wrap new functions and constants in SDL2 2.0.16 (PR #190)
158168

159169
Fixed bugs:
160170

@@ -169,7 +179,7 @@ Released on 2021-08-06.
169179

170180
New Features:
171181

172-
* Updated to wrap new functions and constants in introduced in SDL2 2.0.12
182+
* Updated to wrap new functions and constants introduced in SDL2 2.0.12
173183
and 2.0.14 (PR #163 & PR #181)
174184
* Fixed DLL loading issues with Python installed from the Microsoft Store
175185
on Windows (PR #185)

sdl2/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""SDL2 wrapper package"""
2-
from __future__ import absolute_import
32
from .dll import get_dll_file, _bind
43
from ctypes import c_int as _cint
54

sdl2/hints.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
"SDL_HINT_AUDIO_DEVICE_STREAM_ROLE", "SDL_HINT_AUDIO_INCLUDE_MONITORS",
9999
"SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED",
100100
"SDL_HINT_PREFERRED_LOCALES", "SDL_HINT_APP_NAME",
101-
"SDL_HINT_RENDER_BATCHING", "SDL_HINT_EVENT_LOGGING",
102-
"SDL_HINT_POLL_SENTINEL",
101+
"SDL_HINT_RENDER_BATCHING", "SDL_HINT_RENDER_LINE_METHOD",
102+
"SDL_HINT_EVENT_LOGGING", "SDL_HINT_POLL_SENTINEL",
103103
"SDL_HINT_WAVE_RIFF_CHUNK_SIZE", "SDL_HINT_WAVE_TRUNCATION",
104104
"SDL_HINT_WAVE_FACT_CHUNK", "SDL_HINT_DISPLAY_USABLE_BOUNDS",
105105
"SDL_HINT_VIDEO_DOUBLE_BUFFER", "SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY",
@@ -257,6 +257,7 @@
257257
SDL_HINT_APP_NAME = b"SDL_APP_NAME"
258258
SDL_HINT_PREFERRED_LOCALES = b"SDL_PREFERRED_LOCALES"
259259
SDL_HINT_RENDER_BATCHING = b"SDL_RENDER_BATCHING"
260+
SDL_HINT_RENDER_LINE_METHOD = b"SDL_RENDER_LINE_METHOD"
260261
SDL_HINT_EVENT_LOGGING = b"SDL_EVENT_LOGGING"
261262
SDL_HINT_POLL_SENTINEL = b"SDL_POLL_SENTINEL"
262263
SDL_HINT_WAVE_RIFF_CHUNK_SIZE = b"SDL_WAVE_RIFF_CHUNK_SIZE"

sdl2/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class SDL_Texture(c_void_p):
232232
SDL_RenderCopyF = _bind("SDL_RenderCopyF", [POINTER(SDL_Renderer), POINTER(SDL_Texture), POINTER(SDL_Rect), POINTER(SDL_FRect)], c_int, added='2.0.10')
233233
SDL_RenderCopyExF = _bind("SDL_RenderCopyExF", [POINTER(SDL_Renderer), POINTER(SDL_Texture), POINTER(SDL_Rect), POINTER(SDL_FRect), c_double, POINTER(SDL_FPoint), SDL_RendererFlip], c_int, added='2.0.10')
234234
SDL_RenderGeometry = _bind("SDL_RenderGeometry", [POINTER(SDL_Renderer), POINTER(SDL_Texture), POINTER(SDL_Vertex), c_int, POINTER(c_int), c_int], c_int, added='2.0.18')
235-
SDL_RenderGeometryRaw = _bind("SDL_RenderGeometryRaw", [POINTER(SDL_Renderer), POINTER(SDL_Texture), POINTER(c_float), c_int, POINTER(c_int), c_int, POINTER(c_float), c_int, c_int, c_void_p, c_int, c_int], c_int, added='2.0.18')
235+
SDL_RenderGeometryRaw = _bind("SDL_RenderGeometryRaw", [POINTER(SDL_Renderer), POINTER(SDL_Texture), POINTER(c_float), c_int, POINTER(SDL_Color), c_int, POINTER(c_float), c_int, c_int, c_void_p, c_int, c_int], c_int, added='2.0.18')
236236
SDL_RenderReadPixels = _bind("SDL_RenderReadPixels", [POINTER(SDL_Renderer), POINTER(SDL_Rect), Uint32, c_void_p, c_int], c_int)
237237
SDL_RenderPresent = _bind("SDL_RenderPresent", [POINTER(SDL_Renderer)])
238238
SDL_DestroyTexture = _bind("SDL_DestroyTexture", [POINTER(SDL_Texture)])

sdl2/test/render_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,15 +944,15 @@ def test_SDL_RenderGeometry(self):
944944
def test_SDL_RenderGeometryRaw(self):
945945
renderer, target = _software_renderer(100, 100)
946946
# Create vertices for rendering
947-
RED = [255, 0, 0, 255]
947+
RED = SDL_Color(255, 0, 0, 255)
948948
points = [0, 0, 0, 50, 50, 50]
949-
colors = RED * 3
949+
colors = [RED, RED, RED]
950950
tex_coords = [0, 0, 0, 0, 0, 0]
951951
# Convert vertices to ctypes-friendly format
952952
xy_size = sizeof(c_float) * 2
953-
col_size = sizeof(ctypes.c_ubyte) * 4
953+
col_size = sizeof(SDL_Color)
954954
xy = (c_float * len(points))(*points)
955-
col = (c_int * len(colors))(*colors)
955+
col = (SDL_Color * len(colors))(*colors)
956956
uv = (c_float * len(tex_coords))(*tex_coords)
957957
# Try rendering the vertices
958958
ret = render.SDL_RenderGeometryRaw(

sdl2/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SDL_version(Structure):
2626

2727
SDL_MAJOR_VERSION = 2
2828
SDL_MINOR_VERSION = 0
29-
SDL_PATCHLEVEL = 18
29+
SDL_PATCHLEVEL = 20
3030

3131
def SDL_VERSION(x):
3232
x.major = SDL_MAJOR_VERSION

0 commit comments

Comments
 (0)