Villacaleb / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

SlimDX.Direct3D9.Device.SetTransform question #817

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi guys. SetTransform has 4 overloads. 2 of them asking _pointer_ as second 
parameter (Matrix). Is this okay in terms of design? Maybe better pass matrices 
by ref? Instead of ‘unsafe’ usage?

Original issue reported on code.google.com by RussianF...@gmail.com on 22 Jul 2011 at 11:27

GoogleCodeExporter commented 9 years ago
The pointer / unsafe version is for people who've determined that this is a 
bottleneck for them and want a faster solution. Since we provide a safe 
alternative I believe it is an acceptable design decision.

We don't take a ref Matrix as a parameter because then we'd have to pin it 
first before passing it to Direct3D, completely negating any benefits of 
passing it by ref in the first place.

Original comment by Mike.Popoloski on 22 Jul 2011 at 2:39