@kmamal/sdl 0.11.7 → 0.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +3 -3
- package/package.json +2 -2
- package/scripts/build-sdl.mjs +4 -1
- package/scripts/install.mjs +6 -3
- package/scripts/util/fetch.js +6 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [v0.11.8] - 2025-06-26
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Upgraded SDL to v2.32.8.
|
|
13
|
+
|
|
14
|
+
## [v0.11.7] - 2025-03-14
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Started keeping this changelog.
|
|
19
|
+
|
|
20
|
+
[unreleased]: https://github.com/kmamal/node-sdl/compare/v0.11.8...HEAD
|
|
21
|
+
[v0.11.8]: https://github.com/kmamal/node-sdl/compare/v0.11.7...v0.11.8
|
|
22
|
+
[v0.11.7]: https://github.com/kmamal/node-sdl/releases/tag/v0.11.7
|
package/README.md
CHANGED
|
@@ -211,7 +211,7 @@ Check the [`examples/`](https://github.com/kmamal/node-sdl/tree/master/examples#
|
|
|
211
211
|
* [window.utility](#windowutility)
|
|
212
212
|
* [window.render(width, height, stride, format, buffer[, options])](#windowrenderwidth-height-stride-format-buffer-options)
|
|
213
213
|
* [window.setIcon(width, height, stride, format, buffer)](#windowseticonwidth-height-stride-format-buffer)
|
|
214
|
-
* [window.flash(untilFocused)](#windowflashuntilfocused)
|
|
214
|
+
* [window.flash([untilFocused])](#windowflashuntilfocused)
|
|
215
215
|
* [window.stopFlashing()](#windowstopflashing)
|
|
216
216
|
* [window.destroyed](#windowdestroyed)
|
|
217
217
|
* [window.destroy()](#windowdestroy)
|
|
@@ -1100,7 +1100,7 @@ Possible values are:
|
|
|
1100
1100
|
| `'best'` | `SDL_ScaleModeBest` | anisotropic filtering |
|
|
1101
1101
|
|
|
1102
1102
|
If the window was created with either of the `opengl` or `webgpu` options, then you can only render to the window with OpenGL/WebGPU calls.
|
|
1103
|
-
Calls to
|
|
1103
|
+
Calls to `render()` will fail.
|
|
1104
1104
|
|
|
1105
1105
|
### window.setIcon(width, height, stride, format, buffer)
|
|
1106
1106
|
|
|
@@ -1108,7 +1108,7 @@ Calls to [`render()`](#windowrenderwidth-height-stride-format-buffer-options) wi
|
|
|
1108
1108
|
|
|
1109
1109
|
Set's the window's icon, usually displayed in the title bar and the taskbar.
|
|
1110
1110
|
|
|
1111
|
-
### window.flash(untilFocused)
|
|
1111
|
+
### window.flash([untilFocused])
|
|
1112
1112
|
|
|
1113
1113
|
* `untilFocused: <boolean>` Whether to keep flashing the window until the user focuses it. Default: `false`
|
|
1114
1114
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.11.
|
|
2
|
+
"version": "0.11.8",
|
|
3
3
|
"name": "@kmamal/sdl",
|
|
4
4
|
"description": "SDL bindings for Node.js",
|
|
5
5
|
"keywords": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"sdl": {
|
|
68
68
|
"owner": "kmamal",
|
|
69
69
|
"repo": "build-sdl",
|
|
70
|
-
"version": "2.32.
|
|
70
|
+
"version": "2.32.8"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@kmamal/evdev": "^0.0.2",
|
package/scripts/build-sdl.mjs
CHANGED
package/scripts/install.mjs
CHANGED
|
@@ -3,16 +3,19 @@ if (!process.env.NODE_SDL_FROM_SOURCE) {
|
|
|
3
3
|
try {
|
|
4
4
|
await import('./download-release.mjs')
|
|
5
5
|
process.exit(0)
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
catch (_) {
|
|
7
8
|
console.log("failed to download release")
|
|
8
9
|
}
|
|
9
|
-
}
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
10
12
|
console.log("skip download and build from source")
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
try {
|
|
14
16
|
await import('./download-sdl.mjs')
|
|
15
|
-
}
|
|
17
|
+
}
|
|
18
|
+
catch (_) {
|
|
16
19
|
console.log("failed to download sdl")
|
|
17
20
|
await import('./build-sdl.mjs')
|
|
18
21
|
}
|
package/scripts/util/fetch.js
CHANGED
|
@@ -30,7 +30,8 @@ const fetch = async (_url, options = {}) => {
|
|
|
30
30
|
if (body?.length) {
|
|
31
31
|
if (!Buffer.isBuffer(body)) { body = Buffer.from(body) }
|
|
32
32
|
body = Promise.resolve(body)
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
34
35
|
body = _consume(body)
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -54,8 +55,10 @@ const fetch = async (_url, options = {}) => {
|
|
|
54
55
|
|
|
55
56
|
if (!(200 <= statusCode && statusCode < 300)) {
|
|
56
57
|
let responseBody
|
|
57
|
-
try { responseBody = (await _consume(response)).toString() }
|
|
58
|
-
|
|
58
|
+
try { responseBody = (await _consume(response)).toString() }
|
|
59
|
+
catch (_) {}
|
|
60
|
+
try { responseBody = JSON.parse(responseBody) }
|
|
61
|
+
catch (_) {}
|
|
59
62
|
throw Object.assign(new Error(`bad status code ${statusCode}`), {
|
|
60
63
|
statusCode,
|
|
61
64
|
responseBody,
|