D, Game Development, GLSL, Math

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 1 17:15:55 PDT 2017


On Saturday, 1 July 2017 at 19:23:57 UTC, Void-995 wrote:
> On Saturday, 1 July 2017 at 19:16:12 UTC, drug wrote:
>> 01.07.2017 22:07, Void-995 пишет:
>>> (Void-995) Hi, everyone. I'm pretty excited with what have D 
>>> to offer for game development, especially meta programming, 
>>> traits, object.factory, signals and bunch of other neat 
>>> things that may save a lot of time. Also, i saw support for 
>>> vector data types and simd, which sounds awesome. The 
>>> question is, can i use simd as base to extend it's syntax for 
>>> making something like GLM for C++? I mean extending existing 
>>> types with new operators and such to have GLSL/HLSL like 
>>> syntax for basis math operation in D? Maybe someone did that 
>>> already?
>> Look at gfm
>> https://code.dlang.org/packages/gfm
>
> Looking good, but I'm thinking more about 1:1 GLSL syntax (main 
> reason - rapid prototype of GLSL/HLSL/OpenCL in D and code 
> portability back and forward basing on usage) and heavy 
> depending on SIMD. Just math and nothing else. Also may be a 
> nice excersise for myself.

"Changing the syntax" can be done (e.g. 
https://github.com/p0nce/intel-intrinsics)
You'll want to look at the operator overloading that can be done 
in D (spec https://dlang.org/spec/operatoroverloading.html)

As a side note: I'll soon be starting work on DCompute[1] again 
(Honours thesis due tomorrow), integrating John Colvin's CLWrap 
among many other things.

[1]https://github.com/libmir/dcompute


More information about the Digitalmars-d-learn mailing list