Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Video Card Drivers

  1. #1

    Video Card Drivers

    I hope this is an easy question. I need to get the mfgr, driver version and resolution for the Video Card installed.
    Is there a way to do this in Delphi or DelphiX? If so, how.
    I have Delphi 6 and the latest DelphiX installed.
    Chris Iverson
    <br />http://mywebpages.comcast.net/civerson

  2. #2

    Video Card Drivers

    The TDirectDraw.IDraw[/4/7].GetDeviceIdentifier method (in dxdraws.pas and DirectX.pas of the DelphiX source) looks promising, though there may be a simpler way (I've not had time to check). You should know the resolution if using fullscreen mode (you set it!), else you can use the GetDeviceCaps API function (with HORZRES and VERTRES if memory serves).
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  3. #3

    Video Card Drivers

    How do I implenet the GetDeviceIdentifier method? Do you have some sample code?
    Chris Iverson
    <br />http://mywebpages.comcast.net/civerson

  4. #4

    Video Card Drivers

    I've never actually use DelphiX myself, but I'll try to post some example code soon (in a couple of hours since I'm still at work ). The example might not compile exactly but it'll be close enough to get you started.

    I'll throw two pages at MSDN your way to begin with so you can read about them. Keep in mind that the docs are C++ based...

    IDirectDraw7.GetDeviceIdentifier
    DeviceIdentifier2 structure

    But yeah, the example should be coming sometime after about 5:30 UK time.
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  5. #5

    Video Card Drivers

    The following _should_ do the trick (based solely on looking at the DelphiX source and trying a non-DelphiX test...)

    You want to declare a variable of type TDDDeviceIdentifier. You then call the appropriate function...

    [pascal]var
    ID: TDDDeviceIdentifier;
    begin
    DirectDraw1.IDraw7.GetDeviceIdentifier(ID, 0);
    // todo: use stuff in ID record however you want
    end;[/pascal]

    That's it, as far as I can see. I'm not sure where the TDirectDraw-based component comes from (what I called DirectDraw1) since I've not used DelphiX. I'd be surprised if it wasn't a visual thing, easily available, though! You can also use IDraw4 instead of IDraw7 I think.

    I'll quote from the relevant header so you know what ID will contain after calling the above function. Lots of info for you...

    TDDDeviceIdentifier = record
    //
    // These elements are for presentation to the user only. They should not be used to identify particular
    // drivers, since this is unreliable and many different strings may be associated with the same
    // device, and the same driver from different vendors.
    //
    szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
    szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;

    //
    // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
    // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
    // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
    //
    // This version has the form:
    // wProduct = HIWORD(liDriverVersion.HighPart)
    // wVersion = LOWORD(liDriverVersion.HighPart)
    // wSubVersion = HIWORD(liDriverVersion.LowPart)
    // wBuild = LOWORD(liDriverVersion.LowPart)
    //
    liDriverVersion: TLargeInteger; // Defined for applications and other 32 bit components

    //
    // These elements can be used to identify particular chipsets. Use with extreme caution.
    // dwVendorId Identifies the manufacturer. May be zero if unknown.
    // dwDeviceId Identifies the type of chipset. May be zero if unknown.
    // dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown.
    // dwRevision Identifies the revision level of the chipset. May be zero if unknown.
    //
    dwVendorId: DWORD;
    dwDeviceId: DWORD;
    dwSubSysId: DWORD;
    dwRevision: DWORD;

    //
    // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
    // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
    // reprofile the graphics subsystem.
    // This element can also be used to identify particular problematic drivers.
    //
    guidDeviceIdentifier: TGUID;
    end;
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  6. #6

    Video Driver Info

    How do I define DirectDraw1. I tried this:
    var
    DD : TDirectDraw;

    But I think I have to initialize it with a value, or create it. Doing this:

    dd.Create(GUID);

    Needs a GUID and I don't know what it is.
    Chris Iverson
    <br />http://mywebpages.comcast.net/civerson

  7. #7

    Video Card Drivers

    There should already be one, and it will be created automatically (I'd assume). Check the TDXDraw component, actually -- it looks like it has a DDraw property, meaning the previous example would be something like this:

    [pascal]DXDraw1.DDraw.IDraw7.GetDeviceIdentifier(ID, 0);[/pascal]

    (I think!)
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  8. #8

    Video Card Info

    Maybe it would be better to use the DirectX SDK from Microsoft. Have you ever used it?
    Chris Iverson
    <br />http://mywebpages.comcast.net/civerson

  9. #9

    Re: Video Card Info

    Quote Originally Posted by civerson
    Maybe it would be better to use the DirectX SDK from Microsoft. Have you ever used it?
    Yep

    The problem I'm having helping you is simply that I've never used DelphiX, have no idea of what classes it contains and have no way to compile any test code using it. Aside from that, it's been a cinch so far! But seriously, did the last thing I suggested not work? I can't think why it wouldn't have (you should have a TDXDraw object, and all the properties tally up from the source code).
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  10. #10
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Video Card Drivers

    I've got a feeling this isn;t what you want but I thought I'd post if anyway:

    Code:
    procedure TForm1.ShowDrivers;
    Var
      S &#58; String;
      I &#58; Integer;
    begin
      For I &#58;= 0 to DXDraw1.DDraw.Drivers.Count - 1 do
        S &#58;= S + IntToStr&#40;I&#41; +'&#58; '+ DXDraw1.DDraw.Drivers&#91;I&#93;.Description+ #10#13;
      ShowMessage&#40;S&#41;;
      // todo&#58; use stuff in ID record however you want
    end;
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •