From 38e7db7c7f38ad065c32b98396be71bed21ed611 Mon Sep 17 00:00:00 2001 From: Sean Boettger Date: Fri, 17 May 2024 23:56:08 +1000 Subject: [PATCH 1/3] docs: documentation on SplashKit API support in SplashKit Online --- astro.config.mjs | 6 ++ .../research-and-findings/APISupportTests.md | 75 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md diff --git a/astro.config.mjs b/astro.config.mjs index 41139d5..9c3226b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -458,6 +458,12 @@ export default defineConfig({ }, ] }, + { + label: "Research and Findings", + autogenerate: { + directory: "products/splashkit/documentation/splashkit-online/research-and-findings", + }, + }, ] }, ], diff --git a/src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md b/src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md new file mode 100644 index 0000000..cfa779c --- /dev/null +++ b/src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md @@ -0,0 +1,75 @@ +--- +title: API Support Tests +description: + The results of running tests to check support for parts of the SplashKit API, across the two + currently supported languages. +--- + +# Report on SplashKit API functionality in SplashKit Online + +### Overview + +While much of the SplashKit API already works in the browsers thanks to Emscripten, there are still +areas of functionality that do not. This report will outline what is working, what isn't, and the +general reason why. + +### SplashKit Tests + +It was decided that the most efficient way to test SplashKit's functionality was to use the existing +suite of tests that exist inside `splashkit-core`. To test the JavaScript language backend, these +tests had to be converted. To assist with this, a small C++ to JavaScript conversion utility was +written; the result of this was then patched up manually. For C++, a few of the tests had to be +slightly modified, but all in all are practically identical to their original source. + +The project file containing these tests will be added to the SplashKit Online DemoProjects folder +for reproducibility. Here are the results grouped by API category. + +| Field | JavaScript | C++ | Details | +| ---------------- | ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Animations | Full Support | Full Support | | +| Audio | Near Full Support | Near Full Support | No FLAC support or MOD support. C++ backend doesn't support playing audio while `delay`ing. | +| Camera | Full Support | Full Support | | +| Color | Full Support | Full Support | | +| Geometry | Full Support | Full Support | | +| Graphics | Full Support | Near Full Support | C++ backend doesn't support reading pixels currently (so no `take_screenshot`, etc). | +| Input | Near Full Support | Near Full Support | IME doesn't show up when using `Start Reading Text`. | +| Json | Full Support | Full Support | | +| Logging | Full Support | Full Support | | +| Networking | No Support | No Support | All networking functionality is replaced with stubs currently, due to no cURL support. | +| Physics | Full Support | Full Support | | +| Raspberry | No Support | No Support | Disabled during build. | +| Resource Bundles | Full Support | Full Support | | +| Resources | Full Support | Full Support | | +| Sprites | Full Support | Full Support | | +| Terminal | Partial Support | Limited Support | **JavaScript**: it all _works_, but no terminal input bar. 'Input' _popup_ appears, that has confusing behaviour of only sending data once _cancelled_. This may be fixed very shortly however.
**C++**: all the _read_ functions return immediately with no input. | +| Timers | Full Support | Full Support | | +| Utilities | Near Full Support | Near Full Support | [Display Dialog](http://localhost:4321/api/utilities/#display-dialog) does not work, as it enters a busy loop that freezes the page. | +| Windows | Partial Support | Partial Support | No support for multiple windows, or for moving the window. No way to close the current window. | + +And here are the results specific to each test - some tests test multiple things unfortunately, so +some of these results aren't very helpful. + +| Test | JavaScript | C++ | Details | +| ------------------- | ---------------- | ------------------ | -------------------------------------------------------------- | +| Animations | Works fully | Works fully | | +| Audio | Partially works | Partially works | Cannot download test audio. | +| Bundles | Works fully | works mostly | | +| Camera | Works fully | Works fully | | +| Geometry | Works fully | Works fully (Note) | Cannot close the first screen - replaced with delay | +| Graphics | Fails | Fails | | +| Input | Partially works | Partially works | Only support for one window currently | +| Logging | Works fully | Works fully | | +| Physics | Works fully | Fails | Due to use of read pixel | +| Resources | Works fully | Works fully | | +| Shape drawing | Works fully | Mostly works | Have to disable `take_screenshot` usage for C++ backend | +| Sprite tests | Works fully | Works fully | | +| Terminal | Possible failure | Possible failure | Slightly unsure what the behaviour should be | +| Text | Mostly Works | Mostly Works | Just fails to download font | +| Timers | works | Works fully | | +| Windows | Fails | Fails | Fails due to use of unpatched process events in Display Dialog | +| Cave Escape | Works fully | Works fully | | +| Web Server | Fails | Fails | | +| RESTful Web Service | Fails | Fails | | +| UDP Networking Test | Fails | Fails | | +| TCP Networking Test | Fails | Fails | | +| JSON Unit Test | Works fully | Works fully | | From 4070dd7a313fbc589677a016e62d2c810c7e76c9 Mon Sep 17 00:00:00 2001 From: WhyPenguins Date: Mon, 20 May 2024 23:01:11 +1000 Subject: [PATCH 2/3] docs: add trailing commas after lists --- astro.config.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 35cb730..3d61746 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -464,9 +464,9 @@ export default defineConfig({ directory: "products/splashkit/documentation/splashkit-online/code-documentation/other", }, }, - ] + ], }, - ] + ], }, { label: "Research and Findings", @@ -474,7 +474,7 @@ export default defineConfig({ directory: "products/splashkit/documentation/splashkit-online/research-and-findings", }, }, - ] + ], }, { label: "Issues and Resolutions", From 4ad8cfb5c75a1d40ddb9d7092931195895446cdd Mon Sep 17 00:00:00 2001 From: WhyPenguins Date: Mon, 20 May 2024 23:16:45 +1000 Subject: [PATCH 3/3] docs: update SplashKit Online test results --- .../research-and-findings/APISupportTests.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md b/src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md index cfa779c..496b128 100644 --- a/src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md +++ b/src/content/docs/products/splashkit/documentation/splashkit-online/research-and-findings/APISupportTests.md @@ -9,7 +9,7 @@ description: ### Overview -While much of the SplashKit API already works in the browsers thanks to Emscripten, there are still +While much of the SplashKit API already works in browsers thanks to Emscripten, there are still areas of functionality that do not. This report will outline what is working, what isn't, and the general reason why. @@ -27,7 +27,7 @@ for reproducibility. Here are the results grouped by API category. | Field | JavaScript | C++ | Details | | ---------------- | ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Animations | Full Support | Full Support | | -| Audio | Near Full Support | Near Full Support | No FLAC support or MOD support. C++ backend doesn't support playing audio while `delay`ing. | +| Audio | Near Full Support | Near Full Support | No FLAC support or MOD support. | | Camera | Full Support | Full Support | | | Color | Full Support | Full Support | | | Geometry | Full Support | Full Support | | @@ -43,33 +43,33 @@ for reproducibility. Here are the results grouped by API category. | Sprites | Full Support | Full Support | | | Terminal | Partial Support | Limited Support | **JavaScript**: it all _works_, but no terminal input bar. 'Input' _popup_ appears, that has confusing behaviour of only sending data once _cancelled_. This may be fixed very shortly however.
**C++**: all the _read_ functions return immediately with no input. | | Timers | Full Support | Full Support | | -| Utilities | Near Full Support | Near Full Support | [Display Dialog](http://localhost:4321/api/utilities/#display-dialog) does not work, as it enters a busy loop that freezes the page. | +| Utilities | Near Full Support | Full Support | [Display Dialog](https://splashkit.io/api/utilities/#display-dialog) does not work in JavaScript backend, as it enters a busy loop that freezes the page. | | Windows | Partial Support | Partial Support | No support for multiple windows, or for moving the window. No way to close the current window. | And here are the results specific to each test - some tests test multiple things unfortunately, so some of these results aren't very helpful. -| Test | JavaScript | C++ | Details | -| ------------------- | ---------------- | ------------------ | -------------------------------------------------------------- | -| Animations | Works fully | Works fully | | -| Audio | Partially works | Partially works | Cannot download test audio. | -| Bundles | Works fully | works mostly | | -| Camera | Works fully | Works fully | | -| Geometry | Works fully | Works fully (Note) | Cannot close the first screen - replaced with delay | -| Graphics | Fails | Fails | | -| Input | Partially works | Partially works | Only support for one window currently | -| Logging | Works fully | Works fully | | -| Physics | Works fully | Fails | Due to use of read pixel | -| Resources | Works fully | Works fully | | -| Shape drawing | Works fully | Mostly works | Have to disable `take_screenshot` usage for C++ backend | -| Sprite tests | Works fully | Works fully | | -| Terminal | Possible failure | Possible failure | Slightly unsure what the behaviour should be | -| Text | Mostly Works | Mostly Works | Just fails to download font | -| Timers | works | Works fully | | -| Windows | Fails | Fails | Fails due to use of unpatched process events in Display Dialog | -| Cave Escape | Works fully | Works fully | | -| Web Server | Fails | Fails | | -| RESTful Web Service | Fails | Fails | | -| UDP Networking Test | Fails | Fails | | -| TCP Networking Test | Fails | Fails | | -| JSON Unit Test | Works fully | Works fully | | +| Test | JavaScript | C++ | Details | +| ------------------- | ---------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Animations | Works fully | Works fully | | +| Audio | Partially works | Partially works | Cannot download test audio. | +| Bundles | Works fully | works mostly | | +| Camera | Works fully | Works fully | | +| Geometry | Works fully | Works fully (Note) | Cannot close the first screen - replaced with delay | +| Graphics | Fails | Fails | | +| Input | Partially works | Partially works | Only support for one window currently | +| Logging | Works fully | Works fully | | +| Physics | Works fully | Fails | Due to use of read pixel | +| Resources | Works fully | Works fully | | +| Shape drawing | Works fully | Mostly works | Have to disable `take_screenshot` usage for C++ backend | +| Sprite tests | Works fully | Works fully | | +| Terminal | Possible failure | Possible failure | Slightly unsure what the behaviour should be | +| Text | Mostly Works | Mostly Works | Just fails to download font | +| Timers | works | Works fully | | +| Windows | Fails | Fails | JavaScript backend freezes (due to Display Dialog). C++ fails after clicking okay, with `Cannot read properties of null (reading 'createTexture')` in console - works if `display_dialog(...)` line is removed. | +| Cave Escape | Works fully | Works fully | | +| Web Server | Fails | Fails | | +| RESTful Web Service | Fails | Fails | | +| UDP Networking Test | Fails | Fails | | +| TCP Networking Test | Fails | Fails | | +| JSON Unit Test | Works fully | Works fully | |