If you're looking to do WebGL without SDL, X11 or GLFW, you can look at the
Emscripten html5.h include, which has "native web" functions for creating a
WebGL context, after which you can interact with the WebGL context via
functions exposed by the GLES2 headers. See functions
emscripten_webgl_create_context() and
emscripten_webgl_make_context_current(). Here is one test snippet that does
WebGL directly without the other libraries:
https://github.com/kripken/emscripten/blob/master/tests/gl_textures.cpp.


2016-11-10 20:35 GMT+02:00 Alon Zakai <alonza...@gmail.com>:

> All the SDL1 bindings are in JS, yes. The same for glut, glfw, etc.
> However, if you want an example of another approach, the SDL2 port uses C
> code (with EM_ASM blocks in it in order to call into JS to create the
> canvas context etc., or emscripten_* API calls in C).
>
> On Wed, Nov 9, 2016 at 11:51 PM, Heero Yui <yui.he...@gmail.com> wrote:
>
>> If I well understand the mecanims, The code is interpreted by clang that
>> generate a js file. all the SDL binding is done in native JS and not in a
>> wrapper in C. then use SDL or an other does not real change performance ?
>>
>>
>> Le mercredi 2 novembre 2016 08:29:03 UTC+1, Heero Yui a écrit :
>>>
>>> Thank, you I will try this ....
>>>
>>> Le mercredi 2 novembre 2016 00:28:29 UTC+1, Alon Zakai a écrit :
>>>>
>>>> You can look at src/library_sdl.js and glfw, glut, etc. to see how to
>>>> set up the canvas and context and so forth. Compiling one of the simple
>>>> tests in test/, like tests/sdl_canvas.c, and looking in the generated JS,
>>>> might be helpful too.
>>>>
>>>> On Mon, Oct 31, 2016 at 2:23 PM, Heero Yui <yui....@gmail.com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I write an openGL framework (http://github.com/atria-soft/game), that
>>>>> bind directly the low level interface graphic (like the SDL). Then It is
>>>>> possible to directly bing the WebGL view without using SDL or X11 ?
>>>>>
>>>>> if it is possible, some sample code????
>>>>>
>>>>> Thank you.
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "emscripten-discuss" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to emscripten-discuss+unsubscr...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to emscripten-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to