Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

When I use Direct3D, whether I must create a window before CreateDevice?

This topic is 5151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I use Direct3D, whether I must create a window before CreateDevice?
......
IDirect3D9* pD3D = Direct3DCreate9(D3D_SDK_VERSION);
......
pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, ......);
......
 
CreateDevice''s 3rd parameter is a window handle. Must I create a window before CreateDevice? Is there any way to use Direct3D in console? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Elandsong
CreateDevice''s 3rd parameter is a window handle.
Must I create a window before CreateDevice?
What would you pass to CreateDevice instead?

Share this post


Link to post
Share on other sites
To Oluseyi, I passed NULL, and I known it must be failed. So I want to known what parameter should I pass to it if I don''t create window?
To SiCrane, I want to use it in console mode.
To Raloth, you said it''s simpler, How can I do it?

Thank you!

Share this post


Link to post
Share on other sites
I meant yes, you must create a window. There is no way to do it in "console mode" if you mean a dos prompt console. If you mean something else, what is it?

Share this post


Link to post
Share on other sites
quote:
Original post by Elandsong
To SiCrane, I want to use it in console mode.


Right, but if you don''t have a window to render to, what could you do with Direct3D, which is pretty much all about rendering?

Share this post


Link to post
Share on other sites
Maybe some kinda off screen rendering to create graphic files or something could be a possibility if they wanted to let you do it =p

Share this post


Link to post
Share on other sites

hi,

Nope u do not need to create a window. You can pass NULL as the window handle in the d3d createdevice func ... ie:

pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, ... ) and this will work without any error.

BUT if you want see something on screen you will need to create a window eventually ( specifically you cant call pD3D->Present without a valid window handle if u used NULL as the focus windown in CreateDevice )

pr0jekt2501

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!