Replies: 3 comments 14 replies
-
|
Would this add rust as a dependency to raylib? |
Beta Was this translation helpful? Give feedback.
-
|
Reasons against changing raylib to accommodate this proposal: |
Beta Was this translation helpful? Give feedback.
-
|
I once thought of implementing a raylib platform backend (similar to GLFW, SDL2, RGFW) with sokol. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
WebGPUis a new graphics API that aims to be a modern graphics API on the web.wgpuis one of the available implementations ofWebGPU, written in Rust, and used internally in Firefox.wgpucurrently translates WebGPU calls toDirectX 11,DirectX 12,Vulkan,Metal, andOpenGL/GLES/WebGL.wgpu-nativeis the C binding library forwgpu, usable from C / C++.As an exercise, I attempt to port raylib to use
wgpu. This proves to be a challenge since raylib is deeply dependent onrlglandOpenGLitself. Virtually, every raylib core module usesrlgl. My goal is to split the core modules from the graphics backend and write a newwgpugraphics backend. This can help future-proofing raylib, while still supporting it on older systems. I do not intend to replacerlglcompletely.How?
To write a new graphics backend, I probably need to split/abstract the graphics initialization.
Some ideas I had in mind:
rcore_desktop_glfw_wgpu) This approach is similar to whatImGuidoes, by letting the user include the right combination of window platform and rendering backend. This approach might not fully work since raylib is tightly integrated withOpenGL.rlglbackend. Make allraylib.h's functions not depend onrlgldirectly, but rather select the correct graphics backend based on the build configuration.rlglfunctions inwgpu. To be honest, I am not sure about that solution. Mapping old-styleOpenGLcalls to modern graphics APIs can lead to suboptimal usage/performance.This proves to be an extremely critical decision from a developer experience and simplicity standpoint.
I need help
I opened this discussion to gain some feedback and start a discussion.
For now, I modified the CMake scrips to download
wgpu-nativeand build it from source. You can view the changes here: https://github.com/AregevDev/raylib/tree/wgpu.Beta Was this translation helpful? Give feedback.
All reactions