Thread: DirectX 9: it's possible get the actual Window Device?

  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    434

    DirectX 9: it's possible get the actual Window Device?

    for we start the DirectX, we must create the Device.
    have to do with DirectX initialization. but can we get the actual Window DirectX?
    (imagine if the DirectX variables initialization aren't global, for exemple... how can we get the device?)

  2. #2
    Registered User
    Join Date
    Dec 2017
    Posts
    943
    Your question is not entirely clear, but if you want the HWND from the CreateDevice call, try this:
    Code:
    // global
    IDirect3DDevice9* d3dDevice = NULL;
    
    // wherever (after d3dDevice is initialized)
    D3DDEVICE_CREATION_PARAMETERS Parameters;
    d3dDevice->GetCreationParameters(&Parameters);
    HWND hwnd = Parameters.hFocusWindow;
    IDirect3D9 interface
    If you want the truth to stand clear before you, never be for or against. - Sent-ts'an

  3. #3
    Registered User
    Join Date
    Aug 2013
    Posts
    434
    ok.. nice. but imagine if i need get the device, how can i do it?
    PS: i'm getting problems: why i didn't get the mail notification?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX and Window Focus
    By Marc in forum Game Programming
    Replies: 3
    Last Post: 12-05-2009, 05:34 AM
  2. DirectInput Device Access (DirectX 10)
    By DarkMasterBosel in forum Game Programming
    Replies: 0
    Last Post: 12-27-2008, 11:41 PM
  3. DirectX - Lost Device. HELP
    By Mastadex in forum C++ Programming
    Replies: 0
    Last Post: 11-21-2004, 10:31 PM
  4. DOS window behind the actual window
    By Erf in forum Windows Programming
    Replies: 7
    Last Post: 10-08-2004, 10:06 PM
  5. DirectX - Handling Lost Device
    By X PaYnE X in forum Game Programming
    Replies: 2
    Last Post: 04-27-2004, 01:17 PM

Tags for this Thread