Accessing VRAM from user application
-
Hello, I have some queries 1. Is it possible to directly access Video RAM from User Application? 2. If not, How to read/write data directly to Video RAM ? When searched, I found that certain IOCTLs ( like IOCTL_VIDEO_MAP_VIDEO_MEMORY ) available for Video RAM access. But It seems that these IOCTL are being used by the video driver. Can we have access to these IOCTLs and How? Can you provide some clue as to how we can go ahead. Regards Sandeep
-
Hello, I have some queries 1. Is it possible to directly access Video RAM from User Application? 2. If not, How to read/write data directly to Video RAM ? When searched, I found that certain IOCTLs ( like IOCTL_VIDEO_MAP_VIDEO_MEMORY ) available for Video RAM access. But It seems that these IOCTL are being used by the video driver. Can we have access to these IOCTLs and How? Can you provide some clue as to how we can go ahead. Regards Sandeep
You can use
DirectDraw
to get access to the video memory! Just create a primaryDirectDraw surface
! Daniel ;) --------------------------- Never change a running system! -
You can use
DirectDraw
to get access to the video memory! Just create a primaryDirectDraw surface
! Daniel ;) --------------------------- Never change a running system!Hello!! Thank you for your reply. I have one more question. Does DirectDraw allow the application to get the whole of the VRAM or just a part of it? Can the full VRAM be tested by writing data to it and then reading it back? Sandeep
-
Hello!! Thank you for your reply. I have one more question. Does DirectDraw allow the application to get the whole of the VRAM or just a part of it? Can the full VRAM be tested by writing data to it and then reading it back? Sandeep
I think yes, but I don't know exactly! You can access the whole video memory, that you will see on your monitor screen! But most graphic-cards have more momory and you can allocate some memory directly in the graphic-card memory! Daniel ;) --------------------------- Never change a running system!
-
I think yes, but I don't know exactly! You can access the whole video memory, that you will see on your monitor screen! But most graphic-cards have more momory and you can allocate some memory directly in the graphic-card memory! Daniel ;) --------------------------- Never change a running system!
Thank you for your answer. I am now able to get the total video memory which is free and total video memory in the system by using function IDirectDraw::GetCaps(). I am now able to get the pointer of the surface by using DDSURFACEDESC2 structure and IDirectDrawSurface::Lock(). I have locked the surface using the function IDirectDrawSurface::Lock(), and then went on to write data in the surface till total memory. i.e. I am filling the total video memory with my data. The data is also seen on the screen. But after the screen is completely filled, the screen can be refreshed again by pressing alt+tab and again ALT+TAB (or if the screen is refreshed by some other event). My question is if I have locked the surface how does the screen get refreshed? I have written the data in blocks of 4 KB. I am reading the data back and then comparing it. If I increase the size of data to be written from 4K to 5K then my compare fails. Even if I increase the data size to 8k (to see if it has to do something with page size) then too, the compare fails.. Can anyone tell me why 4096 so special? I also need advise on feasibility of following: While writing data on whole of VRAM can I show the data written on anypart of VRAM on the screen in a window? Can anyone help me out? Regards, Sandeep