Display Database: naming a monitor [ SOLVED ]

5 posts / 0 new
Last post
Massi
Massi's picture
Offline
Last seen: 4 years 7 months ago
Joined: 2012-03-28 17:16
Display Database: naming a monitor [ SOLVED ]

Hello.

Given a certain display ID of an opened screen (SA_DisplayID), how to retrieve the name of its associated monitor?
For example having a display ID corresponding to the mode "Radeon 9250:800x600 ARGB32", I need to get "Radeon 9250".

Thanks, regards

Hans
Hans's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: Display Database: naming a monitor [ SOLVED ]

@Massi

This is probably not quite what you're looking for, but here's what Composite3DDemo does to get the screen mode name:

  1. struct MonitorInfo monitor;
  2. IGraphics->GetDisplayInfoData(NULL, &monitor, sizeof(monitor), DTAG_MNTR, screenModeReq->sm_DisplayID);
  3.  
  4. printf("Opening screen: %s\n", monitor.Mspc->ms_Node.xln_Name);

There is a way to get just the graphics card's name, but I can't remember that right now.

Hans

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

Hans
Hans's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: Display Database: naming a monitor [ SOLVED ]

@Massi

I just remembered that GfxBench2D extracts this info. Here's the snippet:

  1. ULONG boardNum = IP96->p96GetModeIDAttr(displayID, P96IDA_BOARDNUMBER);
  2. const char *boardName = NULL;
  3. const char *boardDriverName = NULL;
  4. ULONG boardDriverVersion = 0;
  5. ULONG boardDriverRevision = 0;
  6. const char *chipDriverName = NULL;
  7. ULONG chipDriverVersion = 0;
  8. ULONG chipDriverRevision = 0;
  9. uint64 totalInternalMemory = 0;
  10. ULONG cardVendorID = 0;
  11. ULONG cardProductID = 0;
  12. ULONG cardSubVendorID = 0;
  13. ULONG cardSubProductID = 0;
  14. IP96->p96GetBoardDataTags(boardNum, P96BD_BoardName, (ULONG)&boardName,
  15. P96BD_PCIProductID, (ULONG)&cardProductID,
  16. P96BD_PCIVendorID, (ULONG)&cardVendorID,
  17. P96BD_BoardDriver, (ULONG)&boardDriverName,
  18. P96BD_ChipDriver, (ULONG)&chipDriverName,
  19. P96BD_InternalMemorySize, (ULONG)&totalInternalMemory, TAG_DONE);
  20.  
  21. if(!boardName)
  22. {
  23. boardName = "Unknown";
  24. }

THe code above extracts more than you're looking for, but I figure that it might be useful for someone else.

Hans

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

Massi
Massi's picture
Offline
Last seen: 4 years 7 months ago
Joined: 2012-03-28 17:16
@Hans Retrieving the screen

@Hans

Retrieving the screen mode name should definitively help me and also this should include the monitor name.

Thanks for the helpful and handy responses, as usual.

Massi
Massi's picture
Offline
Last seen: 4 years 7 months ago
Joined: 2012-03-28 17:16
@Hans I actually solved the

@Hans

I actually solved the problem using
IGraphics->GetDisplayInfoData( ..., struct NameInfo, DTAG_NAME, ... )
which allows to get a string like for example "Radeon 9250:800x600 ARGB32".

See more details here
http://wiki.amigaos.net/wiki/Display_Database

Log in or register to post comments