directx with d

Jarrett Billingsley kb3ctd2 at yahoo.com
Sun Feb 10 08:32:55 PST 2008


"ElfQT" <elf_qt at _deletethis_yahoo.com> wrote in message 
news:fols9e$19u0$1 at 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. 





More information about the Digitalmars-d mailing list