News for hackers. Stuff that matters.
Re:Learning Modern 3D Graphics Programming (2012) by bmitc on Wednesday December 28, 2022 @05:01PM (#34166591)
If you were designing a new application from scratch, meant to be cross-platform on Windows, macOS, and Linux, what 2D graphics library would you use? I have been operating under the assumption that Skia is that library but would like to hear thoughts.

What about 3D?

This is all assuming one wants something packaged and does not want to write OpenGL or Vulkan code.

Re:Learning Modern 3D Graphics Programming (2012) by pak9rabid on Wednesday December 28, 2022 @05:20PM (#34166809)
Maybe check out QT?
Re:Learning Modern 3D Graphics Programming (2012) by 0xfeba on Wednesday December 28, 2022 @06:00PM (#34167191)
LibGDX - https://libgdx.com/

I used that a few years ago -- not sure how it's held up.

Re:Learning Modern 3D Graphics Programming (2012) by gilmore606 on Wednesday December 28, 2022 @07:19PM (#34167855)
I just started another libGDX project a few months ago (2D only), in Kotlin; it still works as well as it ever did. Have had no issues running on Win/Mac/Linux. Could not find any reason not to use openGL.

I have a feeling GLSL shaders will never die and I'll be writing them when I'm 80.

Re:Learning Modern 3D Graphics Programming (2012) by hutzlibu on Wednesday December 28, 2022 @06:03PM (#34167224)
"meant to be cross-platform on Windows, macOS, and Linux, what 2D graphics library would you use? "

It really depends what you want to do, but in general I would say: the HTML Canvas and the web in general. WebGL for 3D, or rather a framework like threejs or babylonjs.

Doing it not on the web, but still cross-platform makes only sense, if you need the maximum performance, or if you already have a working toolchain you are familiar with. But since you don't want to write OpenGL or Vulkan code and you are not familiar with it - I think you are up for great adventures by diving into Skia and co. There is a reason the web became sort of standard for cross platform despite its numerous flaws - the alternative is likely more pain. But maybe not, depending on your skill set. But since you did not mention Qt, I would assume you are new in the area in general? Then I really recommend the web.

Re:Learning Modern 3D Graphics Programming (2012) by bmitc on Wednesday December 28, 2022 @06:47PM (#34167610)
I should have stated that I am looking for desktop only. The reasons are performance, window management (I want to be able to manage multiple windows in a single application, easily), and OS integration.

I'm not necessarily new to the area, but I have already yak shaved down to the level of writing my own windowing framework, based on GLFW, and then graphics/GUI framework using Skia. Summary: GLFW (windowing) + Skia (2D graphics). I was curious if there is some other choice. Qt, GTK, Wx, etc. are all too complicated, tightly coupled to OOP, and are generally not fully portable between OS. I dislike their application frameworks, and I don't want to use their widgets. I've already taken on all this because of that, but you are correct that it is indeed pain. Bugs in Skia or GLFW or drivers or what-have-you are frustrating and blocking.

Let's say I have a desktop windowing framework (which I essentially do with GLFW, although I've threatened to throw my bindings for it out and write my own bindings against Win32, X11, Wayland, and Cocoa), and I'd like to draw to the window. Is there a better option than Skia? Is there a WebAssembly (wasm) or WebGPU (wgpu) or some HTML Canvas abstraction available?

Flutter is basically the only solution like this, but desktop is not its primary support target, it currently lacks multiple window support, and it requires Dart.

Skia is actually pretty nice and not hard to use, but I was curious if there is something more simple and lightweight but still featureful.

Re:Learning Modern 3D Graphics Programming (2012) by yw3410 on Wednesday December 28, 2022 @09:54PM (#34168916)
Honestly, if it's a desktop application and you're not using heavy 3D graphics, why not use wgpu with Cairo? With some smart region tracking it should be plenty performant.
Re:Learning Modern 3D Graphics Programming (2012) by jffhn on Thursday December 29, 2022 @09:32AM (#34172919)
>I am looking for desktop only.

>I have already yak shaved down to the level of writing my own windowing framework.

>Qt, GTK, Wx, etc. are all too complicated (...) I dislike their application frameworks, and I don't want to use their widgets.

>Bugs in Skia or GLFW or drivers or what-have-you are frustrating and blocking.

I'm subject to similar simplicity and dependencies-averse tendencies, and made that: https://github.com/jeffhain/jolikit/blob/master/README-BWD.m...

PS: I've been building a toolkit on top of that, which I use for a file explorer/editor, but it's not stable yet, still many little design points to think more thoroughly.

Re:Learning Modern 3D Graphics Programming (2012) by cshenton on Wednesday December 28, 2022 @06:47PM (#34167600)
For 3D, use a game engine. Unity, Unreal, maybe Godot depending on your perf requirements.
Re:Learning Modern 3D Graphics Programming (2012) by bmitc on Wednesday December 28, 2022 @06:48PM (#34167623)
Thanks. That seems to be the case. My project is currently on top of .NET, so Godot and Stride have been the two I've looked at, although Stride is the only one supporting .NET Core (i.e., .NET 5+). Godot and Unity require Mono still.
Re:Learning Modern 3D Graphics Programming (2012) by SimDeBeau on Wednesday December 28, 2022 @07:08PM (#34167785)
SFML isn’t perfect, but for 2D in the c++ space, that’s what I have reached for
Re:Learning Modern 3D Graphics Programming (2012) by jcelerier on Wednesday December 28, 2022 @08:57PM (#34168573)