www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - DirectX bindings

reply "evilrat" <evilrat666 gmail.com> writes:
Greetings,
many of you may notice lack of (up-to-date and working) DirectX 
bindings, one may also seen my activity on d.learn sub forum. so 
let me announce yet another bindings for DirectX which one may 
fork right now from github!

https://github.com/evilrat666/directx-d

please be careful though, as it is only in alpha stage and 
missing some stuff. current version is June 2010 SDK, but i 
update it(to win8 sdk version) once i had win8 machine(i'm still 
don't have a PC at home).

also, there is no d3d9 and d3d10 stuff as i consider it outdated 
now, but i would appreciate pull requests for them anyway :)
Nov 02 2013
next sibling parent reply "ponce" <contact gam3sfrommars.fr> writes:
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 Greetings,
 many of you may notice lack of (up-to-date and working) DirectX 
 bindings, one may also seen my activity on d.learn sub forum. 
 so let me announce yet another bindings for DirectX which one 
 may fork right now from github!

 https://github.com/evilrat666/directx-d

 please be careful though, as it is only in alpha stage and 
 missing some stuff. current version is June 2010 SDK, but i 
 update it(to win8 sdk version) once i had win8 machine(i'm 
 still don't have a PC at home).

 also, there is no d3d9 and d3d10 stuff as i consider it 
 outdated now, but i would appreciate pull requests for them 
 anyway :)
Hi, Good work. While porting header to D you can use: alias int _D3D_SHADER_INPUT_FLAGS enum : _D3D_SHADER_INPUT_FLAGS { D3D_SIF_USERPACKED = 1, // others... } instead of: enum _D3D_SHADER_INPUT_FLAGS { D3D_SIF_USERPACKED = 1, // others... } That way using the enum won't force to use a namespace.
Nov 03 2013
parent "evilrat" <evilrat666 gmail.com> writes:
On Sunday, 3 November 2013 at 08:42:52 UTC, ponce wrote:
 Hi,

 Good work.
 While porting header to D you can use:

   alias int _D3D_SHADER_INPUT_FLAGS
   enum : _D3D_SHADER_INPUT_FLAGS
   {
       D3D_SIF_USERPACKED        = 1,
       // others...
   }

 instead of:

   enum _D3D_SHADER_INPUT_FLAGS
   {
       D3D_SIF_USERPACKED        = 1,
       // others...
   }

 That way using the enum won't force to use a namespace.
thanks for notice, i'll need to try it first on something bigger than simple example first. most likely i had been doing this by default if i were work with real C++ DirectX projects, unfortunately i only used OpenGL until now :(
Nov 03 2013
prev sibling next sibling parent reply "evilrat" <evilrat666 gmail.com> writes:
i have added dub package to this bindings, need testing. i don't 
have an idea how it works since dub lacks documentation.
Nov 06 2013
parent reply Mike Parker <aldacron gmail.com> writes:
On 11/6/2013 6:29 PM, evilrat wrote:
 i have added dub package to this bindings, need testing. i don't have an
 idea how it works since dub lacks documentation.
http://code.dlang.org/about http://code.dlang.org/package-format
Nov 06 2013
parent reply "evilrat" <evilrat666 gmail.com> writes:
On Wednesday, 6 November 2013 at 14:25:46 UTC, Mike Parker wrote:
 On 11/6/2013 6:29 PM, evilrat wrote:
 i have added dub package to this bindings, need testing. i 
 don't have an
 idea how it works since dub lacks documentation.
http://code.dlang.org/about http://code.dlang.org/package-format
i know about this, i mean there is no such info like dub .lib search paths for testing - i don't want to modify sc.ini every time. there was some other things too, but i can't remember anything else atm. also if you look at my repo u can see it has examples subfolder, should i put package.json there too or it would be simpler to add custom build script for building all this examples?
Nov 06 2013
parent reply "Dicebot" <public dicebot.lv> writes:
On Wednesday, 6 November 2013 at 14:35:07 UTC, evilrat wrote:
 also if you look at my repo u can see it has examples 
 subfolder, should i put package.json there too or it would be 
 simpler to add custom build script for building all this 
 examples?
I think former is expected as it is how Sonke (dub author) does it for vibe.d : https://github.com/rejectedsoftware/vibe.d/tree/master/examples
Nov 06 2013
parent "evilrat" <evilrat666 gmail.com> writes:
On Wednesday, 6 November 2013 at 14:44:59 UTC, Dicebot wrote:
 On Wednesday, 6 November 2013 at 14:35:07 UTC, evilrat wrote:
 also if you look at my repo u can see it has examples 
 subfolder, should i put package.json there too or it would be 
 simpler to add custom build script for building all this 
 examples?
I think former is expected as it is how Sonke (dub author) does it for vibe.d : https://github.com/rejectedsoftware/vibe.d/tree/master/examples
ah ok, thats fine, thanks.
Nov 06 2013
prev sibling next sibling parent "evilrat" <evilrat666 gmail.com> writes:
i have finished dub transition, git repo should pop up on dub 
registry soon.
Nov 07 2013
prev sibling next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 11/3/13, evilrat <evilrat666 gmail.com> wrote:
 https://github.com/evilrat666/directx-d
Nice! I tried porting one of the samples from the SDK but it uses D3DX11CompileFromFile which is missing in the bindings. MSDN says they recommend not using it (well.. why are they using it in the samples then?: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476261%28v=vs.85%29.aspx So maybe it's not worth binding it? No idea. :)
Nov 07 2013
next sibling parent reply "evilrat" <evilrat666 gmail.com> writes:
On Friday, 8 November 2013 at 02:57:25 UTC, Andrej Mitrovic wrote:
 On 11/3/13, evilrat <evilrat666 gmail.com> wrote:
 https://github.com/evilrat666/directx-d
Nice! I tried porting one of the samples from the SDK but it uses D3DX11CompileFromFile which is missing in the bindings. MSDN says they recommend not using it (well.. why are they using it in the samples then?: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476261%28v=vs.85%29.aspx So maybe it's not worth binding it? No idea. :)
its already in the bindings https://github.com/evilrat666/directx-d/blob/master/src/directx/d3dx11async.d#L79 however i may forgot to add public import this module in d3dx11.
Nov 07 2013
parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 11/8/13, evilrat <evilrat666 gmail.com> wrote:
 its already in the bindings
 https://github.com/evilrat666/directx-d/blob/master/src/directx/d3dx11async.d#L79

 however i may forgot to add public import this module in d3dx11.
Ah, I forgot to check for updates. Awesome, there's a triangle example now. Thanks!
Nov 07 2013
prev sibling parent "evilrat" <evilrat666 gmail.com> writes:
On Friday, 8 November 2013 at 02:57:25 UTC, Andrej Mitrovic wrote:
 On 11/3/13, evilrat <evilrat666 gmail.com> wrote:
 https://github.com/evilrat666/directx-d
Nice! I tried porting one of the samples from the SDK but it uses D3DX11CompileFromFile which is missing in the bindings. MSDN says they recommend not using it (well.. why are they using it in the samples then?: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476261%28v=vs.85%29.aspx So maybe it's not worth binding it? No idea. :)
indeed this is not recommended to use, and there are no more such function on windows 8. i'm also need to fix xaudio example too :(
Nov 11 2013
prev sibling next sibling parent reply "ponce" <contact gam3sfrommars.fr> writes:
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 please be careful though, as it is only in alpha stage and 
 missing some stuff. current version is June 2010 SDK, but i 
 update it(to win8 sdk version) once i had win8 machine(i'm 
 still don't have a PC at home).
Hi evilrat, I've been thinking about this for a while, maybe you know about SharpDX. https://github.com/sharpdx/SharpDX It parses DirectX SDK headers and provide C# DirectX bindings + marshalling code (based on gccxml C++ parser). I wonder how involved would it be to modify its generation tool (https://github.com/sharpdx/SharpDX/tree/master/Source/Tools/SharpGen) to output D bindings instead.
Nov 08 2013
next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 11/8/13, ponce <contact gam3sfrommars.fr> wrote:
 I've been thinking about this for a while, maybe you know about
 SharpDX.
 https://github.com/sharpdx/SharpDX

 It parses DirectX SDK headers and provide C# DirectX bindings +
 marshalling code (based on gccxml C++ parser).
If you need a gccxml XML loader you could grab this code: https://github.com/AndrejMitrovic/dgen/blob/master/src/dgen/parser/gccxml.d It's not exactly a self-hosting module, there's a few dependencies. I also have a fork of gccxml that exports some additional attributes (and documents some things as well): https://github.com/AndrejMitrovic/gccxml Don't even ask about that project though, it's something I /might/ get back to at one point, but I'm way too busy with other stuff.
Nov 08 2013
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 11/8/13, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Don't even ask about that project though, it's something I /might/ get
 back to at one point, but I'm way too busy with other stuff.
This is referring to dgen, not gccxml.
Nov 08 2013
prev sibling next sibling parent reply "liyu" <yunwind msn.com> writes:
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 Greetings,
 many of you may notice lack of (up-to-date and working) DirectX 
 bindings, one may also seen my activity on d.learn sub forum. 
 so let me announce yet another bindings for DirectX which one 
 may fork right now from github!

 https://github.com/evilrat666/directx-d

 please be careful though, as it is only in alpha stage and 
 missing some stuff. current version is June 2010 SDK, but i 
 update it(to win8 sdk version) once i had win8 machine(i'm 
 still don't have a PC at home).

 also, there is no d3d9 and d3d10 stuff as i consider it 
 outdated now, but i would appreciate pull requests for them 
 anyway :)
great, however it seems has a little problem, the arg of ID3D11DeviceContext.Unmap should be ID3D11Resource not ID3D11Resource*, arg of IASetIndexBuffer should be ID3D11Buffer not ID3D11Buffer*
Nov 08 2013
parent "evilrat" <evilrat666 gmail.com> writes:
On Friday, 8 November 2013 at 11:37:38 UTC, liyu wrote:
 On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 Greetings,
 many of you may notice lack of (up-to-date and working) 
 DirectX bindings, one may also seen my activity on d.learn sub 
 forum. so let me announce yet another bindings for DirectX 
 which one may fork right now from github!

 https://github.com/evilrat666/directx-d

 please be careful though, as it is only in alpha stage and 
 missing some stuff. current version is June 2010 SDK, but i 
 update it(to win8 sdk version) once i had win8 machine(i'm 
 still don't have a PC at home).

 also, there is no d3d9 and d3d10 stuff as i consider it 
 outdated now, but i would appreciate pull requests for them 
 anyway :)
great, however it seems has a little problem, the arg of ID3D11DeviceContext.Unmap should be ID3D11Resource not ID3D11Resource*, arg of IASetIndexBuffer should be ID3D11Buffer not ID3D11Buffer*
uh, yes, it has some problems, this is semi-automatic coversion bindings, and i have missed some stuff. thanks for pointing out.
Nov 08 2013
prev sibling next sibling parent reply "evilrat" <evilrat666 gmail.com> writes:
it has been for a long time since i released this bindings, so i 
wonder if anyone uses this in their projects? it would be nice to 
see some results of projects using this bindings :)
Feb 03 2014
parent Benjamin Thaut <code benjamin-thaut.de> writes:
Am 03.02.2014 10:55, schrieb evilrat:
 it has been for a long time since i released this bindings, so i wonder
 if anyone uses this in their projects? it would be nice to see some
 results of projects using this bindings :)
I'm currently using them. But there is nothing showabe yet. I will keep you posted.
Feb 03 2014
prev sibling next sibling parent "evilrat" <evilrat666 gmail.com> writes:
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 https://github.com/evilrat666/directx-d
little update: i'm currently looking at some other not yet converted stuff such as Direct2D, DirectWrite and DXVA(video decoding). can't say anything for now, i don't promise i will translate it but i'll looking forward to adding them in to repo. that's all i can say now. if i had enough time i'll put D2D later this week.
May 19 2014
prev sibling next sibling parent "evilrat" <evilrat666 gmail.com> writes:
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 https://github.com/evilrat666/directx-d
new additions: +Direct2D [DX9 state] (though still some helper functions missing) +DirectWrite [DX9 state] +DXGI [DX11.1, DX11.2] +Direct3D [DX11.1, DX11.2] examples: +Direct2D sample from MSDN ( a bit ugly at this moment )
May 24 2014
prev sibling parent reply "evilrat" <evilrat666 gmail.com> writes:
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 https://github.com/evilrat666/directx-d
this is it. i think i can't continue on this one anymore, nor do i have time, nor passion. i've made a lot of work and meet (almost) no interest. i will be stay in contact, so any pull request will not be lost, but i think this is my last commit to it. i have encountered lot of obstacles such as UFCS on classes, which makes impossible seamless migration of user code from C++ to D(no, that wasnt real purpose but for me it is important point). i may return later, let say in a year or two when D will be more complete and usable, but for now i take my leave. please take my apologies if one really used this bindings or have high hopes on it.
May 27 2014
next sibling parent "Adam Wilson" <flyboynw gmail.com> writes:
On Tue, 27 May 2014 02:24:01 -0700, evilrat <evilrat666 gmail.com> wrote:

 On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 https://github.com/evilrat666/directx-d
this is it. i think i can't continue on this one anymore, nor do i have time, nor passion. i've made a lot of work and meet (almost) no interest. i will be stay in contact, so any pull request will not be lost, but i think this is my last commit to it. i have encountered lot of obstacles such as UFCS on classes, which makes impossible seamless migration of user code from C++ to D(no, that wasnt real purpose but for me it is important point). i may return later, let say in a year or two when D will be more complete and usable, but for now i take my leave. please take my apologies if one really used this bindings or have high hopes on it.
I think it would appropriate at this point to note that Aurora is currently hosting bindings for DirectX and will continue to maintain DirectX bindings for a the foreseeable future. DirectX 12 bindings will be provided once they become available. So if you need current and maintained bindings for DirectX you can find them on GitHub here: https://github.com/auroragraphics/directx -- Adam Wilson GitHub/IRC: LightBender Project Coordinator The Aurora Project
May 28 2014
prev sibling parent reply Andrej Mitrovic via Digitalmars-d-announce writes:
On 5/27/14, evilrat via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 https://github.com/evilrat666/directx-d
this is it. i think i can't continue on this one anymore, nor do i have time, nor passion.
Hey, sorry you didn't find an audience for this, thanks for your work nevertheless! But do you by any chance know how up to date your bindings are compared to these other ones: https://github.com/auroragraphics/directx If you don't know I'll try to diff my way and find out.
Jan 24 2015
parent "evilrat" <evilrat666 gmail.com> writes:
On Saturday, 24 January 2015 at 20:35:23 UTC, Andrej Mitrovic 
wrote:
 On 5/27/14, evilrat via Digitalmars-d-announce
 <digitalmars-d-announce puremagic.com> wrote:
 On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote:
 https://github.com/evilrat666/directx-d
this is it. i think i can't continue on this one anymore, nor do i have time, nor passion.
Hey, sorry you didn't find an audience for this, thanks for your work nevertheless! But do you by any chance know how up to date your bindings are compared to these other ones: https://github.com/auroragraphics/directx If you don't know I'll try to diff my way and find out.
it is very sparse comparing to what i've done, but DirectX itself is stable so there shouldn't be any problems. though my version is targeted for same usage as if in C++, and contains most of helper functions, so one could easily rewrite C++ arrows as dots and thats all - everything should work(most times at least). This is very useful and convenient since there are very few learning resources about D and especially DirectX with D(if any). maybe i'll update it to DirectX 12 as soon it is released. but still i would merge peoples PR's if there be any commits.
Jan 26 2015