Advertisement

WebGL for DirectX

Started by November 10, 2021 04:28 AM
2 comments, last by h8CplusplusGuru 3 years ago

OpenGL and DirectX have equivalents. What I mean is, for example:

OpenGL has equivalent Direct3D
OpenAL has equivalent DirectXAudio2
GLSL compute shaders - HLSL compute shaders
GLFW(which is not from Khronos, however is often used with OpenGL) has equivalent DirectXInput
Khronos has WebGL which Microsoft's DirectX lacks, which is understandable since it is targeting windows users exclusively. The question is:


I made a DirectX11 app, exported for windows and I want to make it html5 also. DirectX being Windows exclusive it can't run on browsers installed on MacOS and Linux, however most of common used Browsers support DirectX where possible. How to make a WebGL app from DirectX11?



Advertisement

There is no direct way to make your app run in a browser. You would need to re-write it to target WebGL using JavaScript (or another language that can be cross-compiled into JavaScript).

actually, if you want your app to run in a browser, you can make your own browser. you can use CEF3 to integrate chromium into your application. I do this with my game and use html5 gui with javascripting, being a c++ game engine/game, You can render whatever you want however you want, c++ side, and can use anything program or chrome side to do things. Chrome has webgl like you said, and I have ran webgl from a c++ program using CEF3.

This topic is closed to new replies.

Advertisement