generated from sigonasr2/CProjectTemplate
Include emscripten build script
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
c049e41a5e
commit
9ce1560a91
@ -1,2 +1,4 @@
|
|||||||
build.sh
|
build.sh
|
||||||
commit.sh
|
commit.sh
|
||||||
|
update.sh
|
||||||
|
web.sh
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
build.sh:50a30b43fe30f45d4b7776f1929f359e -
|
build.sh:50a30b43fe30f45d4b7776f1929f359e -
|
||||||
commit.sh:89783d2e6a165aa9612c79cfbd804a35 -
|
commit.sh:89783d2e6a165aa9612c79cfbd804a35 -
|
||||||
|
update.sh:7fda194f24fbd8779221066cbbc04b3f -
|
||||||
|
web.sh:3fdcf079bbabf079cc24c32fa7133c40 -
|
||||||
|
3
C++/scripts/update.sh
Normal file
3
C++/scripts/update.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#Pulls the latest version of the repository.
|
||||||
|
#
|
||||||
|
git pull
|
9
C++/scripts/web.sh
Executable file
9
C++/scripts/web.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#Compiles emscripten instance of this project for the web.
|
||||||
|
#C++
|
||||||
|
if [ -d "assets" ]; then
|
||||||
|
em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp") -o ${PROJECT_NAME}.html -I pixelGameEngine.h --preload-file ./assets
|
||||||
|
else
|
||||||
|
em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp") -o ${PROJECT_NAME}.html -I pixelGameEngine.h
|
||||||
|
fi
|
||||||
|
|
||||||
|
emrun ${PROJECT_NAME}.html
|
BIN
CPlusPlusProjectTemplate.data
Normal file
BIN
CPlusPlusProjectTemplate.data
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 KiB |
1
CPlusPlusProjectTemplate.html
Normal file
1
CPlusPlusProjectTemplate.html
Normal file
File diff suppressed because one or more lines are too long
1
CPlusPlusProjectTemplate.js
Normal file
1
CPlusPlusProjectTemplate.js
Normal file
File diff suppressed because one or more lines are too long
BIN
CPlusPlusProjectTemplate.wasm
Executable file
BIN
CPlusPlusProjectTemplate.wasm
Executable file
Binary file not shown.
BIN
CProjectTemplate
BIN
CProjectTemplate
Binary file not shown.
BIN
assets/78Yazawa-Nico-R-oi0NOy.png
Normal file
BIN
assets/78Yazawa-Nico-R-oi0NOy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 KiB |
3
main.cpp
3
main.cpp
@ -17,6 +17,9 @@ public:
|
|||||||
for (int x = 0; x < ScreenWidth(); x++)
|
for (int x = 0; x < ScreenWidth(); x++)
|
||||||
for (int y = 0; y < ScreenHeight(); y++)
|
for (int y = 0; y < ScreenHeight(); y++)
|
||||||
Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255));
|
Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255));
|
||||||
|
for (int x = 50; x < ScreenWidth(); x++)
|
||||||
|
for (int y = 50; y < ScreenHeight(); y++)
|
||||||
|
Draw(x, y, olc::Pixel(255, 0, 0, 128));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
sig
4
sig
@ -2,8 +2,8 @@ export AUTO_UPDATE=true
|
|||||||
|
|
||||||
source utils/define.sh
|
source utils/define.sh
|
||||||
|
|
||||||
define PROJECT_NAME "CProjectTemplate"
|
define PROJECT_NAME "CPlusPlusProjectTemplate"
|
||||||
define CUSTOM_PARAMS "-lpng -lGL -lX11"
|
define CUSTOM_PARAMS "-lX11 -lGL -lpthread -lpng -lstdc++fs -std=c++17"
|
||||||
define LANGUAGE "C++"
|
define LANGUAGE "C++"
|
||||||
|
|
||||||
source utils/main.sh
|
source utils/main.sh
|
Loading…
x
Reference in New Issue
Block a user