Thread: Can you write directly into video memory in windows vista?

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    71

    Can you write directly into video memory in windows vista?

    I just downloaded allegro and it come with examples...I compiled one example(exflame.c) and it doesn't work,the program purpose is to demonstrates how to write directly to video memory.
    I linked the library with directx 7 and read once that window vista has some problem with direct draw...
    Is the problem related to vista incompatibility with directx 7?
    http://www.krugle.org/examples/p-bFp...2SJO/exflame.c

  2. #2
    Registered User
    Join Date
    Jul 2008
    Posts
    71
    I think my question is really "do direct draw or directx 7 works under windows vista?",what aspect is not working under window vista?

    thank you

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Simple answer: No.

    Complicated answer: Sort of in DirectX and OGL.

    When you lock a surface you can write directly to it but it comes at a cost. The surface will reside in system memory and not video memory which means to get to video memory you have to transfer the data over the bus to the card.

    Easiest way to avoid this problem is to go with a shader-based rendering system. Shader's operate on the GPU and also have access to the video memory (sorta). It all happens transparent to the programmer so it may not look much different than locking, writing, and unlocking but it is completely different.

    In general you never want to lock a surface, vertex buffer, or any other resource from any API.
    Hands off the low level data is the general rule. You use algorithms and techniques to affect the low level data but you don't directly manipulate it - except inside of shaders.

    Shaders are definitely the way to go for low level access and manipulation of graphical data. With DirectX 10 (and soon 11) you can also instance geometry from shaders.

  4. #4
    Registered User
    Join Date
    Jul 2008
    Posts
    71
    Quote Originally Posted by Bubba View Post
    Simple answer: No.
    Thanks,that's all i need to know.Otherwise,I would still be scratching my head wondering 'where did I go wrong?'.
    AS for your other answer,I heard about the shader part but i not yet reach advance level to understand what you said.I'm going to research more about shader after this.
    Thanks for your explanation,really appreciate it...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem in windows vista
    By raj_ksrt in forum C++ Programming
    Replies: 6
    Last Post: 09-30-2008, 11:52 AM
  2. Open an excel file from a windows service under Windows Vista
    By AdrianaLuby in forum C# Programming
    Replies: 1
    Last Post: 06-05-2007, 03:55 AM
  3. Accessing Video Memory Information...need help
    By KneeLess in forum C++ Programming
    Replies: 8
    Last Post: 08-24-2003, 03:53 PM
  4. Onboard video card memory access
    By HermioneFan in forum Game Programming
    Replies: 1
    Last Post: 05-28-2003, 09:53 AM
  5. Is it necessary to write a specific memory manager ?
    By Morglum in forum Game Programming
    Replies: 18
    Last Post: 07-01-2002, 01:41 PM