SDL? Has ports for more obscure platforms, too
SDL_Window *window;
SDL_Renderer *renderer;
SDL_CreateWindowAndRenderer(800, 600, 0, &window, &renderer);
SDL_RenderDrawPoint(renderer, 400, 300); //Renders on middle of screen.
SDL_RenderPresent(renderer);
There's also SDL bindings in a bunch of languages, a few official ones hereUnfortunately, we now have "diet graphics", which consists of stuffing WebKit into C++ and calling it a day [1], so, looking forward to where that goes! [2]
[0] https://www.reddit.com/r/cpp/comments/89q6wr/sg13_2d_graphic...
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p110...
[2] Hopefully into the bin.
Personally I think Web compatibility is so useful that wasm off the Web should use Web APIs, instead of the direction WASI is going.
WASI is an effort to create a new OS API layer from scratch, without the baggage of POSIX or the Web or such. That's definitely interesting, and may be a big deal in the long run, but it has risks (it will take a lot longer, in particular) and it has downsides for the Web (which is personally the platform I care most about).
Because if you "blit a bunch of pixels to the screen", you don't care about performance regardless.
PS: I think there's some confusion about WASM running in browsers, vs WASM running on top of WASI. WASI is all about running WASM outside the browser: https://wasi.dev/
That this is not a good way for doing more complex rendering tasks seems quite obvious (e.g. in the long run this cannot be the only API for covering all sorts of rendering, but it happens to be a good sweet spot for getting anything on screen at all, and not having to deal with an overly complex rendering API just to get some 2D image data rendered).
Are we really going back 30 years?
For 3D rendering, WebGPU would be the better option to support in WASI because it has standalone native implementations:
https://dawn.googlesource.com/dawn
https://github.com/gfx-rs/wgpu
But for blitting CPU-generated 2D image data to the screen WebGPU is also sort of overkill (of course it would be possible to create a much simplified wrapper library in WASM).
Dawn and wgpu are also collaborating on a common set of native headers (https://github.com/webgpu-native/webgpu-headers) to make it easy to switch between implementations.
Regardless it's the closest portable solution at the moment, and it will continue to add capabilities. The WebGPU CG has already had public meetings with Khronos to talk about running WebGPU on top of Vulkan, and running Vulkan Portability on top of WebGPU. So I think there's a lot of interest in making WebGPU succeed on both web and native targets.
If WebGPU ends up being as castrated as WebGL, then we either keep using OpenGL, or change to modern middleware engines (which is what most are doing), with the added benefit that they make the actual 3D API less relevant, it is just a checkbox.
They haven't supported OpenGL for years anyway, so the fact they deprecate it now is irrelevant.
In any case, abstraction layers for macOS already exist.
And, going by your definition, if Apple only allows Metal, then no API will be cross-platform ever anyway.
---
* Removal of components which have been replaced by new standalone tools:
* FrameAnalysis - use https://github.com/GPUOpen-Tools/Radeon-GPUProfiler
---
...that Radeon-GPUProfiler is that tool which has only D3D12 and Vulkan support.
Look around for AMD's OpenGL activity more recently, there's not much, which isn't surprising because they've been lagging behind NVIDIA with their GL drivers since forever. I bet they're eager to close that chapter.
NVIDIA seems more committed to GL still, but without having all GPU vendors on board to continue supporting OpenGL, Khronos won't be able to do much to keep it alive.
Please don't make things up. OpenGL 4.6 was released in July 2017. According to Wikipedia, modern AMD and NVIDIA cards both gained driver support for it in April 2018. Intel drivers have support since May 2019.
That is not news, and that has nothing to do with the state of OpenGL.
Please, stop spreading misinformation about OpenGL.
Just leave it to die.
Then there is WebGL and OpenGL ES, widely used everywhere too.
So, no, it is not going anywhere. In fact, Khronos themselves have said so.
Also I think it's obvious but I'll say it anyway; it's not up to khronos it's up to developers. It doesn't matter if they continue to support OpenGL if developers move to some combination of dx11/12, Vulkan, and Metal.
WebGL and OpenGL ES aren't OpenGL. Their uptake or lack thereof in other arenas is orthogonal to whether people are moving away from OpenGL for game development.
WebGL and OpenGL ES are pretty much OpenGL. Formally they are different standards, but they are based all in OpenGL: if you know one, you know the others pretty well, which is what is important for developers as you agree in the second paragraph.
If it were true that lots of games were picking OpenGL, why is it so hard to make a long list of them? It's easy to make such a list for vulkan.
That's why Godot is moving to Vulkan, that can also run on Metal: https://godotengine.org/article/retrospective-and-future
For Godot game developers, this will not be visible in any way, it's under the hood change to engine.
For other apps, there is in progress development to run full OpenGL on top of Vulkan with Zink. There is a blogpost about it here: https://www.collabora.com/news-and-blog/blog/2018/10/31/intr...
There is also a talk about it at The X.Org Developer's Conference 2019-10-02 here, for example Blender seems to work already: https://youtu.be/rV0P1ChE_5o?t=3970
All conference recordings are listed at conference website: https://xdc2019.x.org/
Today, with Vulkan and soon WebGPU available, there really is very little reason to hang on to OpenGL for anything but legacy.
OpenGL is not simple if you want to actually do useful things with it.
You cannot create a window or handle input with OpenGL.
I'm sure over time, and if desired, WASI will get a set of higher level platform-wrapper APIs for rendering, audio, input and networking, but the requirements are somewhat different from traditional "native" APIs, for instance, compatibility with web APIs is useful. So we'll probably see the WebGPU API for 3D rendering, instead of Vulkan, D3D12 or Metal.