emscripten

Using Boost with Emscripten

孤者浪人 提交于 2019-11-28 16:43:37
I have a c++ project I would like to convert to a web application. For this purpose, I would like to use Emscripten to build the project. The project uses some external libraries. I managed to compile or find the JavaScript version of most libraries and now I am stuck with the Boost ones. Actually I do not even know how to start for Boost: they use a boostrap script to generate the files to build the libraries. It is possible to pass the toolset to this script but Emscripten is obviously not supported. My project uses the following parts of Boost: Thread, Regex, FileSystem, Signals, System.

How to handle passing/returning array pointers to emscripten compiled code?

狂风中的少年 提交于 2019-11-28 04:22:25
I am new to Emscripten/javascript as well as this Overstack community. I apologize, in advance, if my situation has already been addressed. From a windows 7 environment, I've used emcc to compile a simple c program which accepts an array and modifies it (see below). double* displayArray(double *doubleVector) { for (int cnt = 0; cnt < 3; cnt++) printf("doubleVector[%d] = %f\n", cnt, doubleVector[cnt]); doubleVector[0] = 98; doubleVector[1] = 99; doubleVector[2] = 100; for (int cnt1 = 0; cnt1 < 3; cnt1++) printf("modified doubleVector[%d] = %f\n", cnt1, doubleVector[cnt1]); return doubleVector;

Using libraries with emscripten

ε祈祈猫儿з 提交于 2019-11-27 18:41:17
问题 I have just started using Emscripten and would like to start using GLFW and other libraries. I am completely lost on how to build, link, and use other libraries with Emscripten. I have tried following the instructions on the Emscripten site but have they haven't helped me any. http://kripken.github.io/emscripten-site/docs/compiling/Building-Projects.html#using-libraries Is there any place with detailed instructions on how to use libraries with Emscripten? Or specifically GLFW? 回答1: Emscripten

Alpha rendering difference between OpenGL and WebGL

孤街浪徒 提交于 2019-11-27 09:42:24
I'm rendering the same scene using the same exact C++ code, once to native OpenGL on windows and once using Emscripten to WebGL. Everything in the scene looks exactly the same, except when I'm rendering something with alpha != 1.0. The difference looks like this: The blue cube color is (0.0, 0.0, 1.0, 0.5) The shader used for rendering the cube does nothing except draw the color. On the right is how it looks with OpenGL and is the expected result, just blue with half transparency. On the left is how it looks with Emscripten+WebGL. It looks like the color which is rendered is actually (0.5, 0.5

How to handle passing/returning array pointers to emscripten compiled code?

不想你离开。 提交于 2019-11-27 05:19:28
问题 I am new to Emscripten/javascript as well as this Overstack community. I apologize, in advance, if my situation has already been addressed. From a windows 7 environment, I've used emcc to compile a simple c program which accepts an array and modifies it (see below). double* displayArray(double *doubleVector) { for (int cnt = 0; cnt < 3; cnt++) printf("doubleVector[%d] = %f\n", cnt, doubleVector[cnt]); doubleVector[0] = 98; doubleVector[1] = 99; doubleVector[2] = 100; for (int cnt1 = 0; cnt1 <

How to access WebAssembly linear memory from C/C++

不羁岁月 提交于 2019-11-27 01:12:07
问题 I'm writing a small C program intended to be compiled to wasm w/ emcc and run in a web browser. Because wasm exported functions can only accept simple number values as parameter inputs and return values, I need to share memory between the JavaScript API and the compiled WebAssembly code in order to access more complex data types like strings or char arrays. The problem is that I can't for the life of me figure out how to access WebAssembly linear memory from inside of my C program. My

Using Boost with Emscripten

南楼画角 提交于 2019-11-27 00:14:26
问题 I have a c++ project I would like to convert to a web application. For this purpose, I would like to use Emscripten to build the project. The project uses some external libraries. I managed to compile or find the JavaScript version of most libraries and now I am stuck with the Boost ones. Actually I do not even know how to start for Boost: they use a boostrap script to generate the files to build the libraries. It is possible to pass the toolset to this script but Emscripten is obviously not