Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ Finally this binary is executed securely in an asynchronous WebWorker. The WebWo
## "Backend" Development

### SplashKit Wasm Library Manual Compilation (JavaScript backend)

First you'll need to install Emscripten, which will be used to compile SplashKit to Wasm so it can be used in the browser. The easiest way to do this is via the `emsdk`. Installation instructions are here - [Getting Started](https://emscripten.org/docs/getting_started/downloads.html)
First, install Emscripten version 3.1.48, which is required to successfully build the SplashKit core and compile it to Wasm for browser use. The easiest way to do this is via the `emsdk`. Installation instructions are here - [Getting Started](https://emscripten.org/docs/getting_started/downloads.html)

Once you've got Emscripten installed and activated, you can compile the SplashKit Wasm library! We've included SplashKit's source code as a submodule, along with the scripts to compile it as a Wasm library, directly in this repo.

Expand All @@ -111,6 +110,8 @@ emmake make

If all goes well, you should find the three files built and copied to inside `Browser_IDE/runtimes/javascript/bin/` and `Browser_IDE/splashkit/` - if so, you're done!

**Note:** Placing the project in a path with spaces can lead to errors during the build process.

### SplashKit Compiler Library Manual Compilation (C++ backend)

It is also possible to use C++ within SplashKit Online! This is still experimental, and as such is missing some features and can be a bit unstable. However, the majority of graphics, audio, and input functionality works, and you can use it to compile and test regular C++ programs too!
Expand Down
4 changes: 3 additions & 1 deletion SplashKitWasm/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ file(GLOB SOURCE_FILES
"${SK_EXT}/sqlite/sqlite3.c"
"${SK_EXT}/hash-library/*.cpp"
"${SK_EXT}/easyloggingpp/*.cc"
"${SK_EXT}/microui/src/*.c"
)

if (EMSCRIPTEN)
Expand Down Expand Up @@ -204,6 +205,7 @@ include_directories("${SK_EXT}/hash-library")
include_directories("${SK_EXT}/json")
include_directories("${SK_EXT}/sqlite")
include_directories("${SK_EXT}/catch")
include_directories("${SK_EXT}/microui/src")
include_directories("${SK_WASMEXT}/src/lib")

# MAC OS AND WINDOWS DIRECTORY INCLUDES
Expand Down Expand Up @@ -345,7 +347,7 @@ set_target_properties(SplashKitBackendCXX
if (EMSCRIPTEN)
if (ENABLE_JS_BACKEND)
add_executable(SplashKitBackendWASM "${SK_WASMEXT}/generated/SplashKitWasmGlue.cpp")
set_target_properties(SplashKitBackendWASM PROPERTIES LINK_FLAGS "-sALLOW_TABLE_GROWTH -s MAXIMUM_MEMORY=1gb -sALLOW_MEMORY_GROWTH -s EXPORTED_RUNTIME_METHODS=addFunction -s EXPORTED_FUNCTIONS=\"['_malloc','stackAlloc','stackSave','stackRestore','_free']\" -s EXPORT_ALL=1 -sFS_DEBUG --post-js ${SK_WASMEXT}/generated/SplashKitWasmGlue.js")
set_target_properties(SplashKitBackendWASM PROPERTIES LINK_FLAGS "-sALLOW_TABLE_GROWTH -s MAXIMUM_MEMORY=1gb -sALLOW_MEMORY_GROWTH -s EXPORTED_RUNTIME_METHODS=addFunction -s EXPORTED_FUNCTIONS=\"['_malloc','stackAlloc','stackSave','stackRestore','_free']\" -s EXPORT_ALL=1 -sFS_DEBUG --post-js \"${SK_WASMEXT}\"/generated/SplashKitWasmGlue.js")
target_link_libraries(SplashKitBackendWASM SplashKitBackend) #NOTE: deliberately using SplashKitBackend rather than SplashKitBackendCXX - we don't care about the final linked output, we just want Emscripten to give us its JS runtime
set_target_properties(SplashKitBackendWASM
PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion SplashKitWasm/external/splashkit-core
Submodule splashkit-core updated 72 files
+1 −0 .github/workflows/test-linux.yml
+9 −7 .github/workflows/test-macos.yml
+4 −2 .github/workflows/test-windows.yml
+1 −1 coresdk/external
+6 −6 coresdk/src/backend/audio_driver.cpp
+4 −4 coresdk/src/backend/audio_driver.h
+3 −0 coresdk/src/backend/core_driver.cpp
+277 −0 coresdk/src/backend/graphics_driver.cpp
+7 −0 coresdk/src/backend/graphics_driver.h
+28 −0 coresdk/src/backend/input_driver.cpp
+933 −0 coresdk/src/backend/interface_driver.cpp
+116 −0 coresdk/src/backend/interface_driver.h
+1,020 −0 coresdk/src/backend/interface_driver_atlas.h
+14 −0 coresdk/src/backend/text_driver.cpp
+1 −0 coresdk/src/backend/text_driver.h
+4 −0 coresdk/src/backend/utility_functions.cpp
+2 −0 coresdk/src/backend/utility_functions.h
+48 −0 coresdk/src/coresdk/basics.cpp
+47 −0 coresdk/src/coresdk/basics.h
+31 −1 coresdk/src/coresdk/circle_geometry.cpp
+36 −0 coresdk/src/coresdk/circle_geometry.h
+1,486 −0 coresdk/src/coresdk/interface.cpp
+810 −0 coresdk/src/coresdk/interface.h
+5 −2 coresdk/src/coresdk/line_geometry.cpp
+3 −3 coresdk/src/coresdk/music.cpp
+3 −3 coresdk/src/coresdk/music.h
+13 −0 coresdk/src/coresdk/random.cpp
+4 −4 coresdk/src/coresdk/sound.cpp
+4 −4 coresdk/src/coresdk/sound.h
+2 −2 coresdk/src/coresdk/sprites.cpp
+35 −0 coresdk/src/coresdk/text.cpp
+9 −0 coresdk/src/coresdk/text.h
+21 −0 coresdk/src/coresdk/types.h
+0 −2 coresdk/src/coresdk/utils.cpp
+2 −2 coresdk/src/coresdk/vector_2d.cpp
+1 −1 coresdk/src/coresdk/vector_2d.h
+114 −0 coresdk/src/test/test_geometry.cpp
+8 −1 coresdk/src/test/test_main.cpp
+1 −0 coresdk/src/test/test_main.h
+32 −2 coresdk/src/test/test_text.cpp
+211 −0 coresdk/src/test/test_ui.cpp
+82 −0 coresdk/src/test/unit_tests/unit_test_bitmap.cpp
+6 −0 coresdk/src/test/unit_tests/unit_test_main.cpp
+101 −0 coresdk/src/test/unit_tests/unit_test_music.cpp
+183 −0 coresdk/src/test/unit_tests/unit_test_network.cpp
+90 −0 coresdk/src/test/unit_tests/unit_test_sound_effect.cpp
+765 −0 coresdk/src/test/unit_tests/unit_test_utilities.cpp
+38 −32 generated/clib/lib_type_mapper.cpp
+6 −3 generated/clib/lib_type_mapper.h
+456 −17 generated/clib/sk_clib.cpp
+102 −15 generated/clib/sk_clib.h
+41 −35 generated/cpp/adapter_type_mapper.cpp
+6 −4 generated/cpp/adapter_type_mapper.h
+5 −0 generated/cpp/basics.h
+3 −0 generated/cpp/circle_geometry.h
+94 −0 generated/cpp/interface.h
+3 −3 generated/cpp/music.h
+4 −4 generated/cpp/sound.h
+505 −23 generated/cpp/splashkit.cpp
+1 −0 generated/cpp/splashkit.h
+1 −0 generated/cpp/text.h
+8 −0 generated/cpp/types.h
+1 −1 generated/cpp/vector_2d.h
+1,332 −312 generated/csharp/SplashKit.cs
+9,783 −4,581 generated/docs/api.json
+1,121 −150 generated/pascal/splashkit.pas
+628 −80 generated/python/splashkit.py
+4,301 −386 generated/translator_cache.json
+18 −33 projects/cmake/CMakeLists.txt
+3 −0 tools/scripts/cmake/libsplashkit/CMakeLists.txt
+2 −2 tools/scripts/deploy.sh
+1 −1 tools/translator
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "web_client.h"
#include "web_server.h"
#include "window_manager.h"
#include "interface.h"

#include <cstring>
#include <emscripten.h>
Expand Down
Loading