LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 08-17-2003, 06:24 PM   #1
KneeLess
Member
 
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:

Quote:
...
IDirectDraw7::GetCaps

dwVidMemTotal
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.)
dwVidMemFree
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.

Thanks.
 
Old 08-19-2003, 01:38 AM   #2
KneeLess
Member
 
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):

Code:
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?
 
  


Reply


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 11:31 AM
general video card information versaulis Linux - Hardware 1 06-14-2004 02:53 PM
Accessing PCI memory space HTS Programming 7 04-30-2004 10:55 AM
Accessing information from a floppy drive inZioN Linux - Newbie 2 04-14-2004 08:40 AM
accessing system calls information netwizio Programming 4 02-18-2004 12:53 AM


All times are GMT -5. The time now is 06:04 PM.

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