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开发者_如何学Go 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?
精彩评论