windows - API to get the graphics or video memory -
I want to get an adapter RAM or a graphics RAM that you can see in the device manager using the display settings or APIs. I'm in the C ++ app.
I have tried to search on the net and according to my RND, I have concluded that we can get graphics memory information from 1. DirectX SDK structure DXGI_ADAPTandSESE but if I do not want to use DirectX API 2. Win32_videocontroller: But this class does not always provide adapter RAM information that the availability of video controller is offline. I checked it on Vista.
Is there any other way of getting the graphics RAM?
There is no way to get the graphics RAM directly on the desktop, windows prevent you from doing this. Because it shows what the control is.
However, you can create a directX device. Get back the buffer surface and then lock it. After locking you can fill it with whatever you want, and then unlock and call. It's slow, however, as you just copy the video memory into the main memory, some cards also use the "Swiss" formats, whose copies are unaware as a copy, and more time to do this And some cards prohibit you from doing so.
Normally you want to avoid reaching the video card directly and drawing windows / directx for you. Im under D3d1x 'pretty sure you can do it through an IDXGIOutput though it is actually something to try and avoid ...
You have to go through standard Win32 Can write a linear array from (this example considers C) but it is quite involved.
First you need linear array.
unsigned int * pBits = malloc (width * height);
Then you need to create a bitmap and select it in DC.
HBITMAP HibitMap :: :: Biltmap (width, height, 1, 32, zero); Select object (HDC, (HGDIIJ) HBITMAP);
Please kindly fill the PBIT array. You can set bitmap bits when you finish.
:: SetBitmapBits (hBitmap, width * height * 4, (zero *) pBits)
When you have used your bitmap Do not forget to delete it (using the deleted object) and release your linear array!
EDIT: The only way to obtain video RAM is to find it on the DX SDK to go through the DX Diagnostic interface.
Comments
Post a Comment