eric
eric

Reputation: 153

How can I get the memory size of the display adapter card using C++?

I would like to get the display adapter card memory size. What is the best way to do this?

My development enviroment is Visual Studio C++ 2008.

Thanks.

Upvotes: 1

Views: 3686

Answers (2)

oldSkool
oldSkool

Reputation: 1232

Consider the graphics library you are using... the difficulty of determining the installed video memory will depend on the library. Some libraries do not provide methods for this. Perhaps the easiest library to get the installed video memory is SDL...

http://www.libsdl.org/cgi/docwiki.cgi/SDL_VideoInfo

Upvotes: 0

Samrat Patil
Samrat Patil

Reputation: 798

One of the (easier and uniform) ways of getting this is through WMI or windows management instrumentation.

E.g. to view it non programatically through WMI.
1. Open Run > wbemtest > press enter. This will bring up the WMI window.
2. Click Connect > enter root\cimv2 into the box that has already root\default > push Connect.
3. Click on Query > Enter query as Select * from Win32_VideoController > Apply > double click the value returned. This will bring up a window with information about your graphics card.
4. In the object editor window check the field AdapterRam which has the graphics card RAM in bytes.

Now to programatically do this in VC++, you need to access APIs of the WMI provider. You'll find an example here.

Hope that helps.

Upvotes: 2

Related Questions