Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 50186d2

Browse files
Version 2.0.5
- Static bitcode version included for custom WebAssembly builds. - "statictest" example project for the static bitcode version.
1 parent 44b7477 commit 50186d2

File tree

9 files changed

+76
-4
lines changed

9 files changed

+76
-4
lines changed

‎.gitattributes‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎statictest/build.sh‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
echo "Don't forget to run this before using this terminal window:"
2+
echo "source /PATH/TO/emsdk_env.sh --build=Release"
3+
echo
4+
echo "You might need to run this using sudo as well."
5+
6+
em++ --bind \
7+
./main.cpp \
8+
../superpowered.bc \
9+
-I../../SuperpoweredSDK/Superpowered \
10+
-s WASM=1 \
11+
-s MODULARIZE=1 \
12+
-s SINGLE_FILE=1 \
13+
-s EXPORT_NAME="'TestModule'" \
14+
-O3 -g0 \
15+
-o testmodule.js
16+
17+
# EXPORT_ES6 option does not work as described at
18+
# https://github.com/kripken/emscripten/issues/6284, so we have to
19+
# manually add this by '--post-js' setting when the Emscripten compilation.
20+
echo "export default TestModule;" >> ./testmodule.js

‎statictest/index.html‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Superpowered Static WASM Include Demo</title>
8+
</head>
9+
<body>
10+
<script src="main.js" type="module"></script>
11+
</body>
12+
</html>

‎statictest/main.cpp‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "Superpowered.h"
2+
#include "SuperpoweredSimple.h"
3+
#include <emscripten.h>
4+
#include <emscripten/bind.h>
5+
6+
static unsigned int testFunction() {
7+
Superpowered::Initialize("ExampleLicenseKey-WillExpire-OnNextUpdate", false, false, false, false, false, false, false);
8+
return Superpowered::Version();
9+
}
10+
11+
EMSCRIPTEN_BINDINGS (TEST) {
12+
emscripten::function("testFunction", &testFunction);
13+
}

‎statictest/main.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import TestModule from './testmodule.js'
2+
3+
var test = TestModule({
4+
postRun: function() {
5+
document.write(test.testFunction());
6+
}
7+
});

‎statictest/testmodule.js‎

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎superpowered-worker.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎superpowered.bc‎

429 KB
Binary file not shown.

‎superpowered.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /