It's an "empty structure" because it is a stub emitted by the managed C++
compiler.  In other words, the Managed DirectX libraries are written in
managed C++.  This compiler has to emit *something* in the MSIL metadata
that describes the types that the MDX libraries manipulate.  _D3DMATRIX is
clearly the C++ structure, which the managed C++ compiler is emitting for
the sake of the managed code.  The only thing the JIT compiler needs is the
layout and size -- which the managed C++ compiler has kindly provided.

-- arlie


-----Original Message-----
From: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma
Sent: Monday, May 17, 2004 4:57 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Large structures

> Frans Bouma wrote:
> > > > Because the DX api is a COM api,
> > >
> > > We're talking about the *Managed* DirectX API. So your entire
> > > message doesn't make any sense.
> >
> >         Erm, that api is a wrapper around DX COM.
>
> I know, but that's irrelevant.

        Why is it irrelevant, if I may ask? Isn't it best for managed
applications to be able to create the fastest app possible, which means that
there should be as less overhead as possible in hte managed wrapper, imho
you can achieve that best by allowing passable constructs, like objects, but
not structs.

> > For the main logic it calls into the COM objects.
>
> Yes and if you look at the COM APIs you'll see that they take a
> *pointer* to a D3DMATRIX. So the Managed DirectX wrapper designers
> (presumable) consciously chose to make their API different.
> The question was, why?

        Well, perhaps the answer lies somewhere in the reason why D3DMATRIX
is defined as:
[StructLayout(LayoutKind.Sequential, Size=64, Pack=1), CLSCompliant(false),
DebugInfoInPDB, MiscellaneousBits(65)] public struct _D3DMATRIX {

}

        i.e. an empty struct. (Which I find strange)

        Perhaps it's reflector, dunno ;), but it might also be MC++ (I
assume they've written this managed api in MC++, it would be the
easiest) which creates these kind of constructs.

                FB

===================================
This list is hosted by DevelopMentor.  http://www.develop.com Some .NET
courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to