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,192 views

Published on

Talk about using Direct3D on WPF

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,192
On SlideShare
0
From Embeds
0
Number of Embeds
146
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

×