Giter VIP home page Giter VIP logo

cinder-emscripten's Introduction

Cinder 0.9.1dev: libcinder.org

Cinder Logo



Welcome to the very experimental and unofficial port of Cinder to Emscripten. This is a 'for messing around with' port. It should not be used for production. Use at your own risk. :)

You can find some demos that have been built with Cinder Emscripten here: http://chaoticbob.github.io/Cinder-Emscripten.

You are welcome to report any issues here - on this repo. You are also welcome to make any Pull Requests against this repo.

Installing Emscripten

This requires the incoming version of Emscripten and CMake 3.1. It does not work with latest as far as I know. So grab the Emscripten portable SDK from here. Linux or OS X is hightly recommended! This has not been tested on Windows. Once you have it installed and are ready to go:

cd ${YOUR_EMSCRIPTEN_DIR}
./emsdk update
./emsdk install --build=Release sdk-incoming-64bit
./emsdk activate --build=Release sdk-incoming-64bit

Building Cinder

Source the emsdk_env.sh before you do anything:

source ${YOUR_EMSCRIPTEN_DIR}/emsdk_env.sh

Once that is done, you're ready to build:

cd ${YOUR_CINDER_DIR}/emscripten
./cibuild

This should fire off the build process using Clang 3.8 (or later).

Building BasicApp

Source the emsdk_env.sh before you do anything:

source ${YOUR_EMSCRIPTEN_DIR}/emsdk_env.sh

Once that is done, you're ready to build:

cd ${YOUR_CINDER_DIR}/samples/BasicApp/emscripten
./cibuild

Running BasicApp

Lets use the SimpleHTTPServer that comes with Python:

cd ${YOUR_CINDER_DIR}/samples/BasicApp/emscripten/Debug/es2
python -m SimpleHTTPServer 8000

Now open up your browser and goto: http://localhost:8000 or ```http://127.0.0.1:8000``. Click on the BasicApp.html file. You should see BasicApp in your browser.

Building _opengl/Cube

Source the emsdk_env.sh before you do anything:

source ${YOUR_EMSCRIPTEN_DIR}/emsdk_env.sh

Once that is done, you're ready to build:

cd ${YOUR_CINDER_DIR}/samples/_opengl/Cube/emscripten
./cibuild

Running _opengl/Cube

Lets use the SimpleHTTPServer that comes with Python:

cd ${YOUR_CINDER_DIR}/samples/_opengl/Cube/emscripten/Debug/es2
python -m SimpleHTTPServer 8000

Now open up your browser and goto: http://localhost:8000 or ```http://127.0.0.1:8000``. Click on the Cube.html file. You should see a spinning Cube in your browser.



FAQ

  • Which samples currently work?
  • Samples that can render using ES2 and do not have any direct hardware dependency.
  • Noticed that es is in the path for the samples - do any of the ES3 samples work?
  • Yes. You'll need to use FireFox nightly or Chrome Canary with WebGL2 enabled.
  • Does audio work?
  • Not yet. Feel free to make a PR.
  • Does video playback work?
  • Not yet. Feel free to make a PR.
  • What about all the stuff from the HTML5 api?
  • These will get added as time allows. Feel free to make a PR.



Also be sure to check the User Forum.

cinder-emscripten's People

Contributors

adamfratino avatar andrewfb avatar bantherewind avatar bartleyryan avatar cinder avatar clinthidinger avatar drewish avatar fieldofview avatar flight404 avatar gaborpapp avatar gregkepler avatar justinmaurer avatar lucasvickers avatar matchingponies avatar mhintz avatar mikegitb avatar mikeocool avatar notlion avatar nselikoff avatar num3ric avatar patrickfuerst avatar petroskataras avatar philcn avatar pizthewiz avatar richardeakin avatar sansumbrella avatar sethgibson avatar simongeilfus avatar stammen avatar steven-chith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cinder-emscripten's Issues

Undefined symbol error _Znaj/_Znwj

When I compile I get this error:


MacBook-Pro:emscripten alexander$ ./cibuild
Building a app...
Cleaning Debug ...
...deleted dir: /Users/alexander/Cinder-Emscripten/samples/_opengl/CubeMapping/emscripten/Debug/es2
---------------------------------------------------------------------------------
Building Cinder in Debug mode with 8 compile processes
...created dir: /Users/alexander/Cinder-Emscripten/samples/_opengl/CubeMapping/emscripten/Debug/es2
CMAKE COMMAND: cmake .. -DCMAKE_TOOLCHAIN_FILE=/Users/alexander/emsdk/emscripten/1.38.30/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Debug -DCINDER_GL_ES_2=1 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/alexander/Cinder-Emscripten/samples/_opengl/CubeMapping/emscripten/Debug/es2
Scanning dependencies of target CubeMapping
[ 50%] Building CXX object CMakeFiles/CubeMapping.dir/Users/alexander/Cinder-Emscripten/samples/_opengl/CubeMapping/src/CubeMappingApp.cpp.o
[100%] Linking CXX executable CubeMapping.html
warning: unexpected argument type i64 at index 1 in call to '__fseeko', should be i32
warning: unexpected return type i64 in call to '__ftello', should be i32
warning: unexpected argument type i64 at index 1 in call to '__fseeko', should be i32
warning: unexpected argument type i64 at index 1 in call to '__fseeko', should be i32
error: undefined symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcj
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
error: undefined symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEjj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEjjjjjj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_jjRKS4_
error: undefined symbol: _Znaj
error: undefined symbol: _Znwj
Error: Aborting compilation due to previous errors
shared:ERROR: '/Users/alexander/emsdk/node/8.9.1_64bit/bin/node /Users/alexander/emsdk/emscripten/1.38.30/src/compiler.js /tmp/tmpgu4jy_.txt /Users/alexander/emsdk/emscripten/1.38.30/src/library_pthread_stub.js' failed (1)
make[2]: *** [CubeMapping.html] Error 1
make[1]: *** [CMakeFiles/CubeMapping.dir/all] Error 2
make: *** [all] Error 2

The error is reproducible:

  • emscripten version 1.38.30 or incoming
  • OS version linux(ubuntu 16) or mac (mojave)

How I can resolve this? Help me, please

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.