#How do I get a usable OpenGL Context that will draw into an HTML element?

13 messages · Page 1 of 1 (latest)

chrome nexus
#

I would like to write an extension to link against electron that will provide me with an OpenGL context that lets me draw into a canvas, div, or some other HTML element. I do not want to use webgl, I don't want to write something and compile it to WASM. What might be the best way to do this? I'm not strictly against starting a subprocess with a headless opengl session and copying the buffer into the element using shared memory or something, but I would really prefer something more efficient. Ideally I get a real context that really paints into the section of the window corresponding to this element. Any ideas?

#

Vulkan is also totally acceptable

unreal raptor
#

three.js should do the trick

it's an old library though, this means that it's well aged, plus it's still being updated, meaning it's up to date

also, if you don't mind Vulkan, just go for Vulkan ahrinodhyper

chrome nexus
#

that's not what I want. I want to draw into the electron window from an opengl context

#

an actual real raw opengl context

#

three.js is a 3d library for javascript

#

I don't want an opengl context in javascript

#

I want a real, unsandboxed opengl context in a native library I've written

#

the closest I've found is obs-studio has something like this where you use getNativeWindowHandle and then suss out the bounding box

#

and basically draw on top

#

I think.

unreal raptor
#

oooh, you're going for a complex approach, too complex for me aswell, sorry mate i wouldn't be able to help out with this one then D:

chrome nexus
#

Yeah this is braindead easy in Qt or with the now deprecated PPAPI