質問

does any one know how to initilize directX using hdc? the problem is i want to draw my stuff in a component inside a window and these things usualy only have HDC but DX gets HWND which is assigned to a window.

役に立ちましたか?

解決

You can create an invisible window using CreateWindow with 0 width and 0 height and use that hwnd to create the device. Then you can render the images to a texture, retreive the raw buffer from it and pass it to the application where the image is copied to the window. You do no need the HDC too.

他のヒント

HDC represents your rendering device, while HWND represents your window.

You can get get an HDC representing the Window's rendering target with GetDC (don't forget to ReleaseDC it when you're done).

Hope that helps?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top