Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-17-2003, 07:24 PM   #1
Registered: May 2003
Distribution: Debian GNU/Linux 3.0 Sid, OpenBSD 3.5
Posts: 190

Rep: Reputation: 30
Accessing Video Memory Information...need help!

Okay, I was going to write a program for fun (and maybe, probably not practical use) that sees how much Video Memory you have, and how much your using. My friend sugessted DirectDraw for this task.

I googled video memory programming, and came up with this link. The first answer says this:


Total amount of display memory on the device, in bytes, minus memory reserved for the primary surface and any private data structures reserved by the driver. (This value is the same as the total video memory reported by the IDirectDraw7::GetAvailableVidMem method.)
Free display memory. This value equals the value in dwVidMemTotal, minus any memory currently allocated by the application for surfaces. Unlike the GetAvailableVidMem method, which reports the memory available for a particular type of surface (such as a texture), this value reflects the memory available for any type of surface.
From what I've read you need ddraw.h and ddraw.dll (both of which I have).
From MSDN (*dodges flames*) it says that IDirectDrawVideo::GetCaps (HRESULT GetCaps(DDCAPS *pCaps);) can get this information also.

Now, onto my question. Should I use one of these two methods or possibly another one? And is there a good DirectDraw tutorial that teaches use of one of the methods?

I found this. Good tutorial, but it doesn't teach GetCaps or dwVidMemTotal/dwVidMemFree.

Old 08-19-2003, 02:38 AM   #2
Registered: May 2003
Distribution: Debian GNU/Linux 3.0 Sid, OpenBSD 3.5
Posts: 190

Original Poster
Rep: Reputation: 30
A person suggested to me to use (in addtion to IDirectDraw7::GetCaps, supposed to fill lpDDSCaps2 with GetCaps):

IDirectDraw7::GetAvailableVidMem( LPDDSCAPS2 lpDDSCaps2, ... )
I'm having trouble initialized it. I found this, and it says to put in the given code. But when I do, it spits out all these errors at me. I've included ddraw.dll (in my project, not as a header file ) and ddraw.h, but it doesn't seem to be enough.

And how exactly would I use GetCaps to fill lpDDSCaps2?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory slot and device information. atticboy1 Linux - Hardware 5 11-07-2006 12:31 PM
general video card information versaulis Linux - Hardware 1 06-14-2004 03:53 PM
Accessing PCI memory space HTS Programming 7 04-30-2004 11:55 AM
Accessing information from a floppy drive inZioN Linux - Newbie 2 04-14-2004 09:40 AM
accessing system calls information netwizio Programming 4 02-18-2004 01:53 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration