|
|
|
|
|
by chrismorgan
917 days ago
|
|
That’s still only part of what you need. You could pretend the native window client area was a <canvas> and give the code a GPUCanvasContext that renders to it, but you still need to do something about handling user input, what happens when the window size changes, &c. &c. And if you’re working with such minimal primitives, you won’t be able to make something that looks or feels even vaguely native. The browser gives you a lot of valuable functionality. |
|
Rendering an UI that even remotely looks "native" is harder with HTML+CSS than a handful of straightforward rendering primitives which can be implemented on top of WebGPU.
High quality text rendering is a bit non-trivial of course, but that's also only an issue if you want to do a native-looking UI (but mostly irrelevant for games).