That isn't my decision to make. Managed DirectX uses value types for Matrix and several other types. Overall, I agree with the decision.
I'm certainly not going to waste my time rolling another managed interop layer for DirectX. -- arlie -----Original Message----- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma Sent: Monday, May 17, 2004 4:00 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Large structures > I think the main issue here is that teh DirectX API (which this was > about in the beginning) does not pass the structy by ref. > > Looks like a tremendous oversight to me. > > The rest then is basically a logical extension of standard .NET > semantics (structs copied onto stack) and not perfect optimizations > (that are also not really wanted). > > Has anyone a clue whether there may be a reason they are not defined > as ref? Because the DX api is a COM api, which works with objects and pointers, something you can mimic with classes in C# and references to objects. Structs in .NET should, correct me if I'm wrong, be used to create somewhat specialized value types, like a 'Coordinate', and then also just for .NET, not for COM interop. Because there are some drawbacks on structs, like manipulating them in a boxed situation (array list for example) is cumbersome, it's IMHO best to use classes instead of structs, especially when it comes to DX interop. 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