Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Accessing VRAM from user application

Accessing VRAM from user application

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sandeep Shetty
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • S Sandeep Shetty

      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

      D Offline
      D Offline
      Daniel Strigl
      wrote on last edited by
      #2

      You can use DirectDraw to get access to the video memory! Just create a primary DirectDraw surface! Daniel ;) --------------------------- Never change a running system!

      S 1 Reply Last reply
      0
      • D Daniel Strigl

        You can use DirectDraw to get access to the video memory! Just create a primary DirectDraw surface! Daniel ;) --------------------------- Never change a running system!

        S Offline
        S Offline
        Sandeep Shetty
        wrote on last edited by
        #3

        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

        D 1 Reply Last reply
        0
        • S Sandeep Shetty

          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

          D Offline
          D Offline
          Daniel Strigl
          wrote on last edited by
          #4

          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!

          S 1 Reply Last reply
          0
          • D Daniel Strigl

            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!

            S Offline
            S Offline
            Sandeep Shetty
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups