FAQ Database Discussion Community


GLFW with GLES in simple C++ Emscripten file wont build

webgl,opengl-es-2.0,glfw,emscripten
I'm trying to setup an OpenGL Context with a window and viewport using the minimum code to do this with emscripten. I've started coding, this with the following code: #include<stdio.h> #include<stdlib.h> #include<GLES2/gl2.h> #include<GL/glfw.h> #include<emscripten/emscripten.h> int init_gl() { const int width = 480, height = 800; if (glfwInit() != GL_TRUE) {...

Struct operations in Javascript through Emscripten

javascript,c,struct,unsigned,emscripten
I am having quite a lot of problems with emscripten inter-operating between C and Javascript. More specifically, I am having trouble accessing a struct created in C in javascript, given that the pointer to the struct is passed into javascript as an external library. Take a look at the following...

Can Emscripten compile LLVM to JavaScript for a webbased program language

javascript,c++,c,llvm,emscripten
I'm working on my own program language which can be created in a web based editor. I want to translate my code to LLVM-IR on client side. The IR code will be transfer, translate to instruction set and execute on an embedded device. Well, my plan is to create a...

Sending an array from a C pointer to a JS function without copying

javascript,c,emscripten
I'd like to send a data pointer to a JS function at a very high rate (in order to render it on a canvas). What is the best way to do this with Emscripten, without copying the actual data ? Is the following correct? void send(void const * data, unsigned...

Use emscripten from Clang compiled executable

c++,c,clang,emscripten
Is it possible to execute emcc (from emscripten) on a clang compiled executable ? I tried but the result is: ERROR root: pdfium_test: Input file has an unknown suffix, don't know what to do with it! I try that because I'm not able to find a solution to compile PDFium...

Emscripten and ASMjs

javascript,emscripten,asm.js
Is Emscripten (or llvm compilers or transpilers) single purpose specifically used to convert c/c++ programs to JavaScript(ASMjs). Im reading places how ASMjs is going to be faster than direct JavaScript. And in my eyes therefore better than coding in straight javascript. But how will the program be faster than writing...

CMake custom builds issues

build,cmake,emscripten
I am trying to use CMake to build a custom project, which involves using emscripten to provide javascript binding for my C++ library. This is what I want my CMakeLists.txt file to achieve Specify source locations for my files (DONE) Set up relevant COMPILERS to use as well as compiler...

Emscripten and conversion from std::bind to std::function

c++,c++11,stl,emscripten
I'm trying to compile my project with emscripten. Natively in Visual Studio 2013 everything is ok. I store functions in this: template<typename Return, typename ...Arguments> using CBFunction = std::function<Return(Arguments...)>; typedef unsigned int CBID; template<typename Return, typename ...Arguments> class CBCollection { std::map<CBID, CBFunction<Return, Arguments...>> cbs; public: CBID addCB(CBFunction<Return, Arguments...> cb) {...

Changing the default namespace 'Module' in emscripten

javascript,emscripten
I am using emscripten to provide Javascript bindings for some libraries. Emsripten packages the code into a namespace (global var), called 'Module'. I want to change the naming so that I can use a name that reflects what the library is used for, and also to prevent variable name collisions...