• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
chronozphere

How to retrieve info about videocard.

9 posts in this topic

Hi game-developers I would like to know whether there is a way of retrieving data about your videocard programmaticly. I would be interested in the following information: Vendor, Name, Version, Ammount of memory and maybe things like GPU speeds, mem speeds or something like that. I know it's possible to retrieve this info, because programs like Everest can do this. So, can anyone tell me how to do this? Thanx a bunch! ;)
0

Share this post


Link to post
Share on other sites
Vendor, name and driver version is possible with D3D (IDirect3D9::GetAdapterIdentifier). I believe you can get the same info from OpenGL. Anything more than that and you'll probably have to do some horrible driver specific hacks.
0

Share this post


Link to post
Share on other sites
I think, amount of memory and GPU speed and thinks like that is not receivable via the direct3d enumeration structures and functions.
I have never tried it, but you could also think about performance tools form nvidia and amd?!

Check out the directX caps viewer to see what is receivable with the enum functionality.

Alex
0

Share this post


Link to post
Share on other sites
I believe DirectShow can get total video memory, and D3D can report available texture memory.

When I write a log file I always output general PC info like CPU, OS, RAM, video card, audio card etc. All this info is available by using WMI. It's even easier to access this info in .NET Framework using System.Management.
0

Share this post


Link to post
Share on other sites
Thanx for the quick replies. ;)

Does anyone know how to do this with OpenGL?
And what exactly is WMI?

Thanks again. :D
0

Share this post


Link to post
Share on other sites
WMI is Windows Management Instrumentation which can be used to query hardware info.

Here is an example using C# to get information about the video card.

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController");

foreach (ManagementObject obj in query.Get())
{
WriteEntry("Video Card: " + obj["Name"].ToString());
WriteEntry("Video Driver: " + obj["DriverVersion"].ToString());
if (obj["AdapterRAM"] != null)
{
double videoRAM = double.Parse(obj["AdapterRAM"].ToString()) / 1024 / 1024;
WriteEntry("Video RAM: " + videoRAM + " MB");
}
}
0

Share this post


Link to post
Share on other sites
This prints at least some information about the display adapter via OpenGL (from wglinfo.c):

printf("OpenGL vendor string: %s\n", glGetString(GL_VENDOR));
printf("OpenGL renderer string: %s\n", glGetString(GL_RENDERER));
printf("OpenGL version string: %s\n", glGetString(GL_VERSION));

On my laptop it prints:

OpenGL vendor string: S3 Graphics
OpenGL renderer string: VIA/S3G UniChrome IGP/MMX/SSE
OpenGL version string: 1.2
0

Share this post


Link to post
Share on other sites
@Headkaze: Thanx for your info. However, i don't use "managed code", so i need some other snippet... nevertheless thanx. ;)

@SnotBob: Thank you, very usefull!
0

Share this post


Link to post
Share on other sites
Here is a page that shows C++ code to get Video card info using WMI

http://www.scodz.com/ViewProgram.php?link=867

#include "comutil.h"
#include "Wbemcli.h"
#include "Wbemidl.h"

// create edit controls to display information
// add this code button event or as ur wish
HRESULT hr;
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);

IWbemLocator *pIWbemLocator = NULL;
hr = CoCreateInstance(__uuidof(WbemLocator), NULL,
CLSCTX_INPROC_SERVER, __uuidof(IWbemLocator),
(LPVOID *) &pIWbemLocator);

BSTR bstrServer = SysAllocString(L"\\\\.\\root\\cimv2");
IWbemServices *pIWbemServices;
hr = pIWbemLocator->ConnectServer(bstrServer, NULL, NULL, 0L, 0L, NULL,
NULL, &pIWbemServices);

hr = CoSetProxyBlanket(pIWbemServices, RPC_C_AUTHN_WINNT,
RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_CALL,
RPC_C_IMP_LEVEL_IMPERSONATE, NULL,
EOAC_DEFAULT);

BSTR bstrWQL = SysAllocString(L"WQL");
BSTR bstrPath = SysAllocString(L"select * from Win32_VideoController");
IEnumWbemClassObject* pEnum;
hr = pIWbemServices->ExecQuery(bstrWQL, bstrPath, WBEM_FLAG_FORWARD_ONLY, NULL, &pEnum);

IWbemClassObject* pObj = NULL;
ULONG uReturned;
VARIANT var;
hr = pEnum->Next(WBEM_INFINITE, 1, &pObj, &uReturned );

if (uReturned)
{
hr = pObj->Get(L"AdapterRAM", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
sprintf(str,"Video Memory %ld",(var.lVal/(1024*1024)));

m_vidMemoryTxt.SetWindowText(str);
}

hr = pObj->Get(L"ConfigManagerErrorCode", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
sprintf(str,"ConfigManagerErrorCode %ld",var.lVal);
switch (var.lVal)
{
case 0:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device is working properly");
break;
case 1:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device is not configured correctly");
break;
case 2:
m_ConfigManagerErrorCodeTxt.SetWindowText("Windows cannot load the driver for this device.");
break;
case 3:
m_ConfigManagerErrorCodeTxt.SetWindowText("The driver for this device might be corrupted, or your system may be running low on memory or other resources.");
break;
case 4:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device is not working properly. One of its drivers or your registry might be corrupted.");
break;
case 5:
m_ConfigManagerErrorCodeTxt.SetWindowText("The driver for this device needs a resource that Windows cannot manage.");
break;
case 6:
m_ConfigManagerErrorCodeTxt.SetWindowText("The boot configuration for this device conflicts with other devices.");
break;
case 7:
m_ConfigManagerErrorCodeTxt.SetWindowText("Cannot filter.");
break;
case 8:
m_ConfigManagerErrorCodeTxt.SetWindowText("The driver loader for the device is missing");
break;
case 11:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device failed.");
break;
case 12:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device cannot find enough free resources that it can use.");
break;
case 14:
m_ConfigManagerErrorCodeTxt.SetWindowText("This device cannot work properly until you restart your computer.");
break;
case 18:
m_ConfigManagerErrorCodeTxt.SetWindowText("Reinstall the drivers for this device.");
break;
case 20:
m_ConfigManagerErrorCodeTxt.SetWindowText("Your registry might be corrupted.");
break;
}
}

// *********** driver name

hr = pObj->Get(L"Name", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_nameTxt.SetWindowText(sString);
}

hr = pObj->Get(L"DeviceID", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_deviceIdTxt.SetWindowText(sString);
}

hr = pObj->Get(L"DriverVersion", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_VersionTxt.SetWindowText(sString);
}

hr = pObj->Get(L"DriverDate", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
SYSTEMTIME lpSystemTime;
memset( &lpSystemTime, 0, sizeof( SYSTEMTIME ) );

char char_string[100]="";

//BSTR dateStr = var.bstrVal;
//_bstr_t bstrIntermediate(*dateStr); // convert to _bstr_t
//_stprintf(char_string, _T("%s"), (LPCTSTR)bstrIntermediate);

//char* lpszText2 = _com_util::ConvertBSTRToString(dateStr);

// int res= VariantTimeToSystemTime(var.bstrVal, & lpSystemTime );

/*DWORD err =::GetLastError();

sprintf(str,"%ld // %ld // %ld",lpSystemTime.wDay,lpSystemTime.wMonth,lpSystemTime.wYear);

m_InstalldateTxt.SetWindowText( str);*/

}

//VideoProcessor
hr = pObj->Get(L"VideoProcessor", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_InstalldateTxt.SetWindowText( sString);
}

hr = pObj->Get(L"VideoModeDescription", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_videodcrTxt.SetWindowText(sString);
}

hr = pObj->Get(L"AdapterDACType", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char sString[256];
WideCharToMultiByte(CP_ACP, 0, var.bstrVal, -1, sString,

sizeof(sString), NULL, NULL);
m_DacTypeTxt.SetWindowText(sString);
}

hr = pObj->Get(L"VideoArchitecture", 0, &var, NULL, NULL);
if(SUCCEEDED(hr))
{
char str[MAX_PATH];
sprintf(str,"Video Memory %ld",(var.lVal));
switch(var.lVal)
{
case 5:
m_arch.SetWindowText("VGA");
break;
case 6:
m_arch.SetWindowText("SVGA");
break;
case 7:
m_arch.SetWindowText("MDA");
break;
case 10:
m_arch.SetWindowText("8514A");
break;
case 11:
m_arch.SetWindowText("XGA");
break;
case 12:
m_arch.SetWindowText("Linear Frame Buffer");
break;
}
//m_DacTypeTxt.SetWindowText(sString);
}
}

// ***********

pEnum->Release();
SysFreeString(bstrPath);
SysFreeString(bstrWQL);
pIWbemServices->Release();
SysFreeString(bstrServer);
CoUninitialize();




[Edited by - Headkaze on May 21, 2008 3:33:01 PM]
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0