iliak's picture

System inventory log

Project:Dungeon Eye
Version:0.2.0
Component:Code
Category:task
Priority:normal
Assigned:iliak
Status:open
Description

Add the following to the log :
Operating System (XP, Vista, Seven...)
Amout of RAM
Graphic Card type, available modes and if possibly driver version (don't know how...)
Sound card and available devices


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Driver version:

Console.WriteLine("Graphics card: {0} {1} {2}", GL.GetString(StringName.Vendor), GL.GetString(StringName.Renderer), GL.GetString(StringName.Version));

Note that OpenGL 3.0+ has deprecated StringName.Version in favor of:

GL.GetInteger(GetPName.Major, out major);
GL.GetInteger(GetPName.Minor, out minor);

You can get available resolutions using the DisplayResolution class. OpenTK doesn't offer a way to request available GraphicsMode right now (will consider that, please add a feature request if you think this will be useful).

iliak's picture

#2

Here's my code to log some hw & sw informations :

WriteLine("Hardware informations :");
Indent();
WriteLine("OS : {0}", Environment.OSVersion.ToString());
WriteLine("Platform : {0}", Environment.OSVersion.Platform.ToString());
WriteLine("SP : {0}", Environment.OSVersion.ServicePack);
WriteLine("Processor count : {0}", Environment.ProcessorCount);
Unindent();
 
WriteLine("Software informations :");
Indent();
WriteLine("CLR : {0}", Environment.Version.ToString());
Unindent();
 
 
WriteLine("Video informations :");
Indent();
WriteLine("Graphics card vendor : {0}", GL.GetString(StringName.Vendor));
WriteLine("Renderer : {0}", GL.GetString(StringName.Renderer));
 
int major, minor;
GL.GetInteger(GetPName.MajorVersion, out major);
GL.GetInteger(GetPName.MinorVersion, out minor);
WriteLine("Version : {0} ({1}, {2})", GL.GetString(StringName.Version), major, minor);
 
 
WriteLine("Display modes");
Indent();
 
foreach (DisplayDevice device in DisplayDevice.AvailableDisplays)
	WriteLine(device.ToString());
 
Unindent();
 
Unindent();

Here's the output :

Hardware informations :
    OS : Microsoft Windows NT 6.1.7600.0
    Platform : Win32NT
    SP : 
    Processor count : 2
Software informations :
    CLR : 2.0.50727.4927
Video informations :
    Graphics card vendor : NVIDIA Corporation
    Renderer : Quadro FX 570M/PCI/SSE2
    Version : 2.1.2 (0, 0)
    Display modes
        Primary: 1680x1050x32@60Hz (198 modes available)
        Secondary: 1680x1050x32@60Hz (213 modes available)
the Fiddler's picture

#3

Looks fine. Just note that this part:

int major, minor;
GL.GetInteger(GetPName.MajorVersion, out major);
GL.GetInteger(GetPName.MinorVersion, out minor);
WriteLine("Version : {0} ({1}, {2})", GL.GetString(StringName.Version), major, minor);

will not work on drivers that do not expose OpenGL 3.0 (e.g. older Nvidia/AMD drivers or any driver from Intel, Sis and other vendors). The backwards-compatible way to check for version is to use GL.GetString(StringName.Version) and try to the parse the string (which tends to change between different drivers or operating systems).

iliak's picture

#4

Thats is why I display both results.

The next part I would like to display is needed/referenced dlls. This way I can display the version on the client side. I have only found a way to display loaded dll at the time the method is called, it will not output all referenced dll (e.g. my editor use WeifenLuo.WinFormsUI.Docking.dll but not the game itsefl, so it won't display this dll until I call the editor) :

foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
	WriteLine(assembly.ToString());