digitalmars.D - directx with d
- ElfQT (7/7) Feb 07 2008 I have ported some directx tutorial back in 2005... This time I play aro...
- Vladimir Panteleev (8/15) Feb 07 2008 Have you seen the Win32 API bindings project? They seem to have ported s...
- ElfQT (4/27) Feb 07 2008 Yep, I am aware of the bindings, also I use them in newer code - in the ...
- Clay Smith (2/32) Feb 07 2008 He probably meant this link www.dsource.org/projects/nonagon
- Extrawurst (3/11) Feb 07 2008 i tried your attached app and it works for me with dmd2.010 i just
- ElfQT (5/24) Feb 07 2008 Well, by working you mean you see the triangle (instead of the simple ba...
- ElfQT (2/29) Feb 07 2008 Whoa I see this is what happening. It works with dmdv1.026 and phobos. I...
- ElfQT (20/20) Feb 09 2008 There is a problem - difference - between dmdc1.0124 AND default phobos ...
- Jarrett Billingsley (9/32) Feb 10 2008 I don't see why the size would differ based on the standard library, tha...
- ElfQT (27/58) Mar 01 2008 ElfQT Wrote:
I have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQT
Feb 07 2008
On Thu, 07 Feb 2008 17:16:04 +0200, ElfQT <elf_qt _deletethis_yahoo.com> wrote:I have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQTHave you seen the Win32 API bindings project? They seem to have ported some or all of the DirectX headers: http://www.dsource.org/projects/bindings/wiki/WindowsApi Also, check out this in-progress 3D game engine written in D: http://www.yage3d.net/ -- Best regards, Vladimir mailto:thecybershadow gmail.com
Feb 07 2008
Vladimir Panteleev Wrote:On Thu, 07 Feb 2008 17:16:04 +0200, ElfQT <elf_qt _deletethis_yahoo.com> wrote:Yep, I am aware of the bindings, also I use them in newer code - in the attached code I tried to use a minimal version, and also a simple one which worked well with dmd back in 2005. Thanks for the link to Yage. Unfortunately Yage uses openGL. ElfQTI have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQTHave you seen the Win32 API bindings project? They seem to have ported some or all of the DirectX headers: http://www.dsource.org/projects/bindings/wiki/WindowsApi Also, check out this in-progress 3D game engine written in D: http://www.yage3d.net/ -- Best regards, Vladimir mailto:thecybershadow gmail.com
Feb 07 2008
ElfQT wrote:Vladimir Panteleev Wrote:He probably meant this link www.dsource.org/projects/nonagonOn Thu, 07 Feb 2008 17:16:04 +0200, ElfQT <elf_qt _deletethis_yahoo.com> wrote:Yep, I am aware of the bindings, also I use them in newer code - in the attached code I tried to use a minimal version, and also a simple one which worked well with dmd back in 2005. Thanks for the link to Yage. Unfortunately Yage uses openGL. ElfQTI have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQTHave you seen the Win32 API bindings project? They seem to have ported some or all of the DirectX headers: http://www.dsource.org/projects/bindings/wiki/WindowsApi Also, check out this in-progress 3D game engine written in D: http://www.yage3d.net/ -- Best regards, Vladimir mailto:thecybershadow gmail.com
Feb 07 2008
i tried your attached app and it works for me with dmd2.010 i just changed the depencies to get it working with phobos, cause i dont use tango. ElfQT schrieb:I have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQT
Feb 07 2008
Extrawurst Wrote:i tried your attached app and it works for me with dmd2.010 i just changed the depencies to get it working with phobos, cause i dont use tango. ElfQT schrieb:Well, by working you mean you see the triangle (instead of the simple backgroud)? I'll try that with phobos, also with dmd2.010, if that difference causes this then there is an interesting bug somewhere... Thanks, ElfQTI have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQT
Feb 07 2008
ElfQT Wrote:Extrawurst Wrote:Whoa I see this is what happening. It works with dmdv1.026 and phobos. I am investigating this issue, right now I suspect tango - somebody from there please lend me a hand.i tried your attached app and it works for me with dmd2.010 i just changed the depencies to get it working with phobos, cause i dont use tango. ElfQT schrieb:Well, by working you mean you see the triangle (instead of the simple backgroud)? I'll try that with phobos, also with dmd2.010, if that difference causes this then there is an interesting bug somewhere... Thanks, ElfQTI have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQT
Feb 07 2008
There is a problem - difference - between dmdc1.0124 AND default phobos versus "tango-0.99.4-bin-win32-dmd.1.024". See the code below: // A structure for our custom vertex type struct CUSTOMVERTEX { FLOAT x, y, z, rhw; // The transformed position for the vertex DWORD color; // The vertex color }; // Initialize three vertices for rendering a triangle static CUSTOMVERTEX[3] vertices = [ { 150.0f, 50.0f, 0.5f, 1.0f, 0xffff0000, }, // x, y, z, rhw, color { 250.0f, 250.0f, 0.5f, 1.0f, 0xff00ff00, }, { 50.0f, 250.0f, 0.5f, 1.0f, 0xff00ffff, }, ]; int a = vertices.sizeof; a is 120 with phobos, 60 with tango. Some related question: is it possible for tango and phobos to live side by side, also edit and debug side by side? (Something like an automated test that is capable to compare phobos vs tango build?) It isn't simple to find a difference like this one. Or is this difference intentional to begin with? ElfQT
Feb 09 2008
"ElfQT" <elf_qt _deletethis_yahoo.com> wrote in message news:fols9e$19u0$1 digitalmars.com...There is a problem - difference - between dmdc1.0124 AND default phobos versus "tango-0.99.4-bin-win32-dmd.1.024". See the code below: // A structure for our custom vertex type struct CUSTOMVERTEX { FLOAT x, y, z, rhw; // The transformed position for the vertex DWORD color; // The vertex color }; // Initialize three vertices for rendering a triangle static CUSTOMVERTEX[3] vertices = [ { 150.0f, 50.0f, 0.5f, 1.0f, 0xffff0000, }, // x, y, z, rhw, color { 250.0f, 250.0f, 0.5f, 1.0f, 0xff00ff00, }, { 50.0f, 250.0f, 0.5f, 1.0f, 0xff00ffff, }, ]; int a = vertices.sizeof; a is 120 with phobos, 60 with tango.I don't see why the size would differ based on the standard library, that's really odd. The library should have no effect on this code. Regardless, you should put align(1) on the CUSTOMVERTEX struct declaration, which SHOULD make it 60 in both.Some related question: is it possible for tango and phobos to live side by side, also edit and debug side by side? (Something like an automated test that is capable to compare phobos vs tango build?) It isn't simple to find a difference like this one. Or is this difference intentional to begin with?I'm not sure why you'd want to. There's tangobos which is an implementation of phobos in Tango, but you should really either target one, or if you really must, use "version(Tango) { ... } else { ... }" statements.
Feb 10 2008
ElfQT Wrote: Finally I have found the time to investigate this issue. And the winner is... Same code will follow with phobos then with tango: //phobos import std.c.windows.windows; struct CUSTOMVERTEX { FLOAT x; }; static CUSTOMVERTEX[3] vertices = [ { 150.0f } ]; void main() { printf ("%d",vertices.sizeof); } Prints 12. //tango import tango.sys.win32.Types; import tango.stdc.stdio; struct CUSTOMVERTEX { FLOAT x; }; static CUSTOMVERTEX[3] vertices = [ { 150.0f } ]; void main() { printf ("%d",vertices.sizeof); } Prints 24. The difference lies: Phobos, \dmd\src\phobos\std\c\windows\windows.d: alias float FLOAT; Tango, D:\D\import\tango\sys\win32\Types.di: alias double FLOAT; (Before you ask, I use type FLOAT - uppercase - because I copy some directx code, which already uses that.) With directx on win32, the phobos approach is working, Tango FLOAT produces errors. Is this intended in Tango? Is there already code requiring FLOAT to be double? The problem in the original post is disappears (and the directx triangle appears), if I use float instead of FLOAT (so double in Tango). ElfQTElfQT Wrote:Extrawurst Wrote:Whoa I see this is what happening. It works with dmdv1.026 and phobos. I am investigating this issue, right now I suspect tango - somebody from there please lend me a hand.i tried your attached app and it works for me with dmd2.010 i just changed the depencies to get it working with phobos, cause i dont use tango. ElfQT schrieb:Well, by working you mean you see the triangle (instead of the simple backgroud)? I'll try that with phobos, also with dmd2.010, if that difference causes this then there is an interesting bug somewhere... Thanks, ElfQTI have ported some directx tutorial back in 2005... This time I play around again with directx and also with tango. But I have a problem even with the old directx code of mine - which of course worked on the old dmd compiler. Right now the compiler and tango verisons are: tango-0.99.4-bin-win32-dmd.1.024.zip Bit of a help would be appreciated, the attached code should display a triangle. http://tmtinformatika.hu/_Others/Marton/dx_vertices.zip Contact me at elf_qt _deletethis_yahoo.com ElfQT
Mar 01 2008
ElfQT wrote:The difference lies: Phobos, \dmd\src\phobos\std\c\windows\windows.d: alias float FLOAT; Tango, D:\D\import\tango\sys\win32\Types.di: alias double FLOAT; (Before you ask, I use type FLOAT - uppercase - because I copy some directx code, which already uses that.) With directx on win32, the phobos approach is working, Tango FLOAT produces errors. Is this intended in Tango? Is there already code requiring FLOAT to be double?This looks like a tango bug, FLOAT is a C float. http://msdn2.microsoft.com/en-us/library/aa383751.aspx
Mar 01 2008
torhu wrote:ElfQT wrote:Tango's PFLOAT is wrong too.The difference lies: Phobos, \dmd\src\phobos\std\c\windows\windows.d: alias float FLOAT; Tango, D:\D\import\tango\sys\win32\Types.di: alias double FLOAT; (Before you ask, I use type FLOAT - uppercase - because I copy some directx code, which already uses that.) With directx on win32, the phobos approach is working, Tango FLOAT produces errors. Is this intended in Tango? Is there already code requiring FLOAT to be double?This looks like a tango bug, FLOAT is a C float. http://msdn2.microsoft.com/en-us/library/aa383751.aspx
Mar 01 2008
Thanks. Issue entered to Tango's Trac, http://www.dsource.org/projects/tango/ticket/955 ElfQT torhu Wrote:torhu wrote:ElfQT wrote:Tango's PFLOAT is wrong too.The difference lies: Phobos, \dmd\src\phobos\std\c\windows\windows.d: alias float FLOAT; Tango, D:\D\import\tango\sys\win32\Types.di: alias double FLOAT; (Before you ask, I use type FLOAT - uppercase - because I copy some directx code, which already uses that.) With directx on win32, the phobos approach is working, Tango FLOAT produces errors. Is this intended in Tango? Is there already code requiring FLOAT to be double?This looks like a tango bug, FLOAT is a C float. http://msdn2.microsoft.com/en-us/library/aa383751.aspx
Mar 01 2008