1

I know directshow could use windowless via VMR-9. VMR-9 is based on Direct3D. Could I write a windowless application using Direct3D directly?

zdd
  • 8,258
  • 8
  • 46
  • 75
Dean Chen
  • 3,800
  • 8
  • 45
  • 70
  • If you don't want a window, where do you render to? – zdd Oct 23 '12 at 09:30
  • My coworkers are implementing a library using Direct3D. The hwnd should be passed from client App, for example a browser plugin should pass its hwnd to our library. – Dean Chen Oct 24 '12 at 13:45
  • So, you still need a window, although it is created by the client App, it passed the hwnd to you. – zdd Oct 24 '12 at 14:48
  • Yes, when I said windowless, I mean my library implemented by Direct3D has not its own window, just use the hwnd from client App. And windowless is a term from MSDN, it was not created by me. :) – Dean Chen Oct 25 '12 at 03:04

1 Answers1

1

I think you can try it as below

  1. Create your Direct3D library, say a dll and expose two interface, one is InitD3D which takes an hwnd as a parameter(you need it when you create the device), another is render() which you can call to draw your scene.
  2. In your client App code, first call InitD3D to initialize your Direct3D stuffs, then, in the message loop call render to present your scene when there is no message to process.
zdd
  • 8,258
  • 8
  • 46
  • 75
  • Sorry, my question is not about how to design the interfaces of my library APIs. Just want to know whether Direct3D 9 supports windowless ability or not. – Dean Chen Oct 26 '12 at 04:44
  • if you want to render something, then you must use a window, either create it yourself or pass in with other apps, otherwise, you don't need, is that clear? – zdd Oct 26 '12 at 10:28
  • My co-workers said only Direct 10 or 11 support this ability, windowless ability. – Dean Chen Oct 26 '12 at 15:12