Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Direct3D to WPF  Daosheng Mu    2012.1.3
Outline• WPF• Direct3D• Binding-P/Invoke, CIL
WPF• Windows Presentation Foundation  – Based on .NET 3.0  – GUI utilizes DirectX  – eXtensible Application Markup Languag...
Direct3D• 3D graphics API supported by Microsoft• Utilize GPU hardware acceleration• Used to render 3D application which  ...
Communication between WPF/D3D• How?  – P/Invoke    • extern identifier, huge cost  – CIL(Common Intermediate Language)    ...
How to write CLI• Project Setting  – Adjust on Win32 dll project  – Create CLR project
Adjust on Win32 dll project      Add dll to WPF project
Adjust on Win32 dll project                       Code Generation
Adjust on Win32 dll                 CLR Support
Create CLR Project              Create CLR Class Library
CIL Sample• Extend Idisposable• Class ref• *ObjPtr using  IntPtr
Result• https://github.com/DaoshengMu/WPFd3dIma  geCpp
Upcoming SlideShare
Loading in …5
×

Direct3D to WPF

2,347 views

Published on

Talk about using Direct3D on WPF

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Direct3D to WPF

  1. 1. Direct3D to WPF Daosheng Mu 2012.1.3
  2. 2. Outline• WPF• Direct3D• Binding-P/Invoke, CIL
  3. 3. WPF• Windows Presentation Foundation – Based on .NET 3.0 – GUI utilizes DirectX – eXtensible Application Markup Language (XAML) • For more effective to develop UI
  4. 4. Direct3D• 3D graphics API supported by Microsoft• Utilize GPU hardware acceleration• Used to render 3D application which performance is important• Game engine usually is designed to use c++/d3d commonly
  5. 5. Communication between WPF/D3D• How? – P/Invoke • extern identifier, huge cost – CIL(Common Intermediate Language) • Marshaling at compile time, better performance
  6. 6. How to write CLI• Project Setting – Adjust on Win32 dll project – Create CLR project
  7. 7. Adjust on Win32 dll project Add dll to WPF project
  8. 8. Adjust on Win32 dll project Code Generation
  9. 9. Adjust on Win32 dll CLR Support
  10. 10. Create CLR Project Create CLR Class Library
  11. 11. CIL Sample• Extend Idisposable• Class ref• *ObjPtr using IntPtr
  12. 12. Result• https://github.com/DaoshengMu/WPFd3dIma geCpp

×