Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Metal, DirectX, GX2, LibGNMX prove otherwise.


Do they?

DirectX is only barely C++. It's structs and virtual interfaces. They actually provide a full C interface. The API itself is exceptionally C-like IMHO. It does not, for example, return unique_ptr or vectors. There's no std::string or std::function. In fact there's no std:: anything.

Don't get me wrong I like namespaces, constructors, and methods over C-style "namespace", no constructors, and an ocean of loose functions. If people want to create and use C++ wrappers around C APIs that's great. But OP's question was "Why does OpenGL persist with a C style API instead of a more expressive one?".

Writing a C API and wrapping with C++ is very different than writing an "expressive" C++ interface imho.


Yes they do.

COM is language agnostic and definitly not C.

A C++ wrapper doesn't need std::anything to be C++.

Barely C++ is still an improvement over bare bones C.

LibGNM(X) and GX2 are also not std::whatever_else, but again build up on not being a bare bones C API stuck in the days of IrisGL.

Finally Metal is a mix of Objective-C and C++, both definitly an improvment.

Then there is the whole issue of they are proper frameworks, not "here is a specification and now go hunting how to load fonts, models, materials" that Khronos does.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: