3 ms·
I'm writing OpenGL code. I know lots of languages claim support for OpenGL, but in my opinion dealing with gpu stuff is something best written in C or C++. All
by levemi 11y ago
I'm writing OpenGL code. I know lots of languages claim support for OpenGL, but in my opinion dealing with gpu stuff is something best written in C or C++. All the guides, all the answers to questions, all the popular books, everything out there assumes you're using C or C++ when you're working with GPU code. It's fine. I like using C++ for this. OpenGL in any other language and you're a second class citizen at best.
- giancarlostoro 11y agoD much like C++ interfaces to C see: https://dlang.org/spec/interfaceToC.html https://dlang.org/spec/interfaceToC.html D was at one point a C++ compiler but Walter Bright decided to break backward compatibility with C syntactically to allow the language to evolve in ways that C restricts, while still allowing it to interface with C. Sorry if I worded this poorly, but you may want to reconsider D and see for yourself if it feels like a second class citizen or what? There are sample projects interfacing to C projects (LuaD comes to mind).
- hauleth 11y agoHave you tried https://github.com/tomaka/glium https://github.com/tomaka/glium?
- douche 11y agoI first heard about D from Gamedev.net, so you can certainly do OpenGL with it. I believe there have even been commercial games written in D.
- david-given 11y agoKenta Cho's shooter _Torus Trooper_ is written in D and might make a good example. (It's a damn good game, too.) https://www.youtube.com/watch?v=PJMTQmqxBqg https://www.youtube.com/watch?v=PJMTQmqxBqg http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html Also, ported to Linux: http://www.emhsoft.com/ttrooper/ http://www.emhsoft.com/ttrooper/