Thanks for the hint :)
makeContextCurrent: function(contextHandle) {
> var context = GL.contexts[contextHandle];
> if (!context) return false;
> GLctx = Module.ctx = context.GLctx; // Active WebGL context object.
> GL.currentContext = context; // Active Emscripten GL layer context object.
> return true;
> },
Should i understand :
* GL is a global object
* GL contains all created contextes, referenced by their handle
Therefore i should be able to :
* Use EMSCRIPTEN_WEBGL_CONTEXT_HANDLE
<https://kripken.github.io/emscripten-site/docs/api_reference/html5.h.html#c.EMSCRIPTEN_WEBGL_CONTEXT_HANDLE>
emscripten_webgl_get_current_context() in C++ side to get context handle
* Inform my JS library about the current context handle
* Retrieve from my JS library the current WebGLRenderingContext thantks to
the handle
Am i right ?
Regards,
Harold
2016-09-01 18:39 GMT+02:00 Alon Zakai <[email protected]>:
> Look in src/library_gl.js (makeContextCurrent), I believe the GL context
> is stored in Module.ctx.
>
> On Thu, Sep 1, 2016 at 2:24 AM, Harold Comere <[email protected]>
> wrote:
>
>> Hi,
>>
>> I am trying to grab HTML5 video/webcam frames into a WebGL texture.
>>
>> Old threads demonstrate that it is straightforward to do it in pure JS :
>>
>> * https://github.com/kripken/emscripten/issues/1434#issuecomment-48155712
>> * https://groups.google.com/forum/#!searchin/emscripten-disc
>> uss/video|sort:relevance/emscripten-discuss/eKNQofq-d0E/V2sok6GoQUMJ
>>
>> I my case, the WebGL context is created using native OpenGLES 2.0 API and
>> i have an embedded JS library which is responsible of all getUserMedia
>> stuff.
>> Therefore i need to retrieve the current WebGLRenderingContext object
>> from my JS library code to be able to call texImage2D with video element as
>> pixel source.
>>
>> After some researches, i was not able to find out how to do it :(
>>
>> Does anyone has insights about how to retrieve the current
>> WebGLRenderingContext from JS ?
>>
>> Regards,
>> Harold
>>
>>
>>
>>
>>
>> --
>> 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 [email protected].
>> 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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.