Thread: Direct X initialization

  1. #1
    Registered User
    Join Date
    Mar 2009

    Direct X initialization

    Hi all

    I understand what I'm about to ask is beyond the juristiction of this board, however I'm sure most people on here must know what I'm on about and ppl have been very helpful in the past!

    I've been studying C++ for a while now and am beginning to look at using it to write Direct X programs (I already have a question and I'm right at the start lol). When initializing a direct 3D object I then use the createDevice method to create a device object for it. Despite trawling my tutorial book and internet pages noone seems to explain this simple point: what is a direct3D device object in relation to the actual direct3D object that was used to create it? From the limited information I've managed to gather, it sounds like the device object is used to manipulate the graphics in the master direct3d object itself? Does that sound right or have I missed the point?

    Just making sure I understand this basic before I move on :-)

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    You can think of the Direct3D object as an interface that represents the actual physical device or the adapter. The object can then create one or more actual logical devices (more in the case of multi-head). If you look at the SDK you will see that the interface functions for IDirect3D9/10 are all about querying adapter related properties, etc. You cannot render anything with an IDirect3D9/10 interface pointer. You must obtain an IDirect3DDevice9/10 interface pointer in order to begin rendering.

    You can keep the IDirect3D9/10 interface around if you want to but it's also perfectly acceptable and valid to release it right after you successfully create an IDirect3DDevice9/10 interface pointer.

    The overlap between them is that you can call GetDeviceCaps() with an IDirect3D9/10 and an IDirect3DDevice9/10 interface pointer. However they differ in that you cannot specify the device type from the visibility of an IDirect3DDevice9/10 interface pointer since this was specified when you created the pointer via CreateDevice(). You also cannot specify the adapter ordinal with an IDirect3DDevice9/10 interface pointer.

    To make matters more confusing you can use IDirect3D9/10ex in Vista.
    Last edited by VirtualAce; 07-08-2009 at 04:08 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Direct Input shutting down improperly
    By Deo in forum Game Programming
    Replies: 3
    Last Post: 06-14-2005, 06:54 AM
  2. Direct Input and Mouse Coords
    By Khelder in forum Game Programming
    Replies: 5
    Last Post: 12-30-2003, 02:29 PM
  3. Direct X
    By MicroFiend in forum C++ Programming
    Replies: 2
    Last Post: 03-21-2003, 02:34 PM
  4. Direct Music Illegal Static Member Call error
    By FwyWice in forum Game Programming
    Replies: 4
    Last Post: 11-30-2002, 05:14 PM
  5. Direct Music Trouble
    By FwyWice in forum Game Programming
    Replies: 5
    Last Post: 11-29-2002, 04:01 PM