www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D game engine from scratch

reply Andi <cadetschimmel gmail.com> writes:
hi everyone.

im a big fan of D since uh, i guess it was around 2014 but i 
never had the time to dig really deep into it. ~4 weeks ago i 
started to write my game engine (not the first time haha) but in 
D, and im so extremely amazed how frictionless this whole process 
was so far. I dont understand why this language hasnt more 
widespread adoption, its awesome <3

greetings!

ps.: 400 unit tests so far, i love this! 
https://www.youtube.com/watch?v=unZW1Bqin5c
Apr 04
next sibling parent reply Andi <cadetschimmel gmail.com> writes:
On Saturday, 4 April 2026 at 20:14:23 UTC, Andi wrote:
 hi everyone.

 im a big fan of D since uh, i guess it was around 2014 but i 
 never had the time to dig really deep into it. ~4 weeks ago i 
 started to write my game engine (not the first time haha) but 
 in D, and im so extremely amazed how frictionless this whole 
 process was so far. I dont understand why this language hasnt 
 more widespread adoption, its awesome <3

 greetings!

 ps.: 400 unit tests so far, i love this! 
 https://www.youtube.com/watch?v=unZW1Bqin5c
oh an maybe to point out, every pixel in that video is via D and software rendered, no win11 crap either, i just copied the icons because i like them (sorry)
Apr 04
next sibling parent reply madwebness <qount25 protonmail.com> writes:
On Saturday, 4 April 2026 at 20:16:58 UTC, Andi wrote:
 On Saturday, 4 April 2026 at 20:14:23 UTC, Andi wrote:
 hi everyone.

 im a big fan of D since uh, i guess it was around 2014 but i 
 never had the time to dig really deep into it. ~4 weeks ago i 
 started to write my game engine (not the first time haha) but 
 in D, and im so extremely amazed how frictionless this whole 
 process was so far. I dont understand why this language hasnt 
 more widespread adoption, its awesome <3

 greetings!

 ps.: 400 unit tests so far, i love this! 
 https://www.youtube.com/watch?v=unZW1Bqin5c
oh an maybe to point out, every pixel in that video is via D and software rendered, no win11 crap either, i just copied the icons because i like them (sorry)
So you probably saw my thread about text-editor from scratch. I use Raylib for my editor's rendering, but I was also thinking of maybe making it easier to later swap backends and also allow software rendering, like GOP for example. What's your experience with software rendering, how do you draw pixels on screen? Because I initially considered specifically that, but on Linux/BSD/X11 it was extremely difficult, for some reason, to just open a window and draw one pixel - I eventually managed to do it, but it was a lot of boilerplate, whereas with Raylib "it just werks" (tm) and is pretty portable. I also do wonder why haven't you used Raylib yourself (D has a nice binding!).
Apr 04
parent Andi <cadetschimmel gmail.com> writes:
On Sunday, 5 April 2026 at 00:25:37 UTC, madwebness wrote:
 On Saturday, 4 April 2026 at 20:16:58 UTC, Andi wrote:
 On Saturday, 4 April 2026 at 20:14:23 UTC, Andi wrote:
 hi everyone.

 im a big fan of D since uh, i guess it was around 2014 but i 
 never had the time to dig really deep into it. ~4 weeks ago i 
 started to write my game engine (not the first time haha) but 
 in D, and im so extremely amazed how frictionless this whole 
 process was so far. I dont understand why this language hasnt 
 more widespread adoption, its awesome <3

 greetings!

 ps.: 400 unit tests so far, i love this! 
 https://www.youtube.com/watch?v=unZW1Bqin5c
oh an maybe to point out, every pixel in that video is via D and software rendered, no win11 crap either, i just copied the icons because i like them (sorry)
So you probably saw my thread about text-editor from scratch. I use Raylib for my editor's rendering, but I was also thinking of maybe making it easier to later swap backends and also allow software rendering, like GOP for example. What's your experience with software rendering, how do you draw pixels on screen? Because I initially considered specifically that, but on Linux/BSD/X11 it was extremely difficult, for some reason, to just open a window and draw one pixel - I eventually managed to do it, but it was a lot of boilerplate, whereas with Raylib "it just werks" (tm) and is pretty portable. I also do wonder why haven't you used Raylib yourself (D has a nice binding!).
I wanted to write everything from scratch and use as little third party code as possible. so I wrote my own UI system which i simply call "widget". and writing the software renderer for it was really fun and a huge learning experience. aside from rasterizing and only updating the pixels which actually changed, multit hreading the drawing loop gave the biggest performance boost and D made that super simple to implement
Apr 04
prev sibling parent reply matheus <matheus gmail.com> writes:
On Saturday, 4 April 2026 at 20:16:58 UTC, Andi wrote:
 ...
 oh an maybe to point out, every pixel in that video is via D 
 and software rendered, no win11 crap either, i just copied the 
 icons because i like them (sorry)
Since there is no source linked, in this is Software Rendering, you draw every pixel on a buffer (RAM) and then send/swap with the video buffer? So you are using only CPU? Matheus.
Apr 04
parent Andi <cadetschimmel gmail.com> writes:
On Sunday, 5 April 2026 at 00:38:17 UTC, matheus wrote:
 On Saturday, 4 April 2026 at 20:16:58 UTC, Andi wrote:
 ...
 oh an maybe to point out, every pixel in that video is via D 
 and software rendered, no win11 crap either, i just copied the 
 icons because i like them (sorry)
Since there is no source linked, in this is Software Rendering, you draw every pixel on a buffer (RAM) and then send/swap with the video buffer? So you are using only CPU? Matheus.
hi, yes both the UI and the raymarcher write to a byte[] which i just hand over to the OS.
Apr 04
prev sibling parent reply Kapendev <alexandroskapretsos gmail.com> writes:
On Saturday, 4 April 2026 at 20:14:23 UTC, Andi wrote:
 hi everyone.

 im a big fan of D since uh, i guess it was around 2014 but i 
 never had the time to dig really deep into it. ~4 weeks ago i 
 started to write my game engine (not the first time haha) but 
 in D, and im so extremely amazed how frictionless this whole 
 process was so far. I dont understand why this language hasnt 
 more widespread adoption, its awesome <3

 greetings!

 ps.: 400 unit tests so far, i love this! 
 https://www.youtube.com/watch?v=unZW1Bqin5c
Looks like a fun project. Great work!
Apr 06
parent reply Andi <cadetschimmel gmail.com> writes:
On Monday, 6 April 2026 at 08:47:01 UTC, Kapendev wrote:
 On Saturday, 4 April 2026 at 20:14:23 UTC, Andi wrote:
 hi everyone.

 im a big fan of D since uh, i guess it was around 2014 but i 
 never had the time to dig really deep into it. ~4 weeks ago i 
 started to write my game engine (not the first time haha) but 
 in D, and im so extremely amazed how frictionless this whole 
 process was so far. I dont understand why this language hasnt 
 more widespread adoption, its awesome <3

 greetings!

 ps.: 400 unit tests so far, i love this! 
 https://www.youtube.com/watch?v=unZW1Bqin5c
Looks like a fun project. Great work!
it totally is! the only issue i have is with vscode + code-d. its less usable than im used to from other IDEs/languages. do you have a suggestions for me on how i could improve that situation or is that just something i have to deal with (the D tax :P ) im using github copilot for autocomplete and refactoring help, so it hides some of the shortcomings.
Apr 08
parent reply Kapendev <alexandroskapretsos gmail.com> writes:
On Wednesday, 8 April 2026 at 14:00:42 UTC, Andi wrote:
 it totally is! the only issue i have is with vscode + code-d. 
 its less usable than im used to from other IDEs/languages. do 
 you have a suggestions for me on how i could improve that 
 situation or is that just something i have to deal with (the D 
 tax :P ) im using github copilot for autocomplete and 
 refactoring help, so it hides some of the shortcomings.
I only code with syntax highlighting :) Sometimes I also use grep to find things.
Apr 08
parent Andi <cadetschimmel gmail.com> writes:
On Wednesday, 8 April 2026 at 19:06:22 UTC, Kapendev wrote:
 On Wednesday, 8 April 2026 at 14:00:42 UTC, Andi wrote:
 it totally is! the only issue i have is with vscode + code-d. 
 its less usable than im used to from other IDEs/languages. do 
 you have a suggestions for me on how i could improve that 
 situation or is that just something i have to deal with (the D 
 tax :P ) im using github copilot for autocomplete and 
 refactoring help, so it hides some of the shortcomings.
I only code with syntax highlighting :) Sometimes I also use grep to find things.
i remember the times without syntax highlighting :P but im glad about modern IDE features, im getting old remembering all the apis im using
Apr 10