Skip to main content
GameDev.net gamedev.net
🔒 Locked

WebGL for DirectX

Started by bogdan7 Nov 10, 2021 at 4:28 AM 2 replies 8.9k views
Original Post
bogdan7
bogdan7

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?



MJP
MJP

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).

h8CplusplusGuru
h8CplusplusGuru

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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.