Thread: please help - video memory

  1. #1
    Registered User
    Join Date
    Jan 2006

    Question please help - video memory

    this may be a very newbish post, but i need some help over here... two questions, first and second

    i'm working on a program that needs to run totally separated from windows (utopically)... currently i'm running it from windows' dos console, but i don't know how to instruct the video card directly, no need for anything complicated, just being able to pinpoint each pixel and to draw and color that pixel, and it must be done as directly as possible...
    anyone out there can give a pointer?
    i've looked for this information everywhere, but found only directX and such...

    now second, i need the classes' methods to be able to get any kind of data (not just to polymorph, but to be able to handle anything to drops by)... right now i'm working with inheritance, all of my objects being a subobject of a control class called ZS and is working fine as far as methods are concerned (they are able to receive any type) but what i'm aiming at is an alghorithm to make methods able to recognize their 'incoming' by interaction afterwards, this is that the class' method first receives a subtype of ZS but then internally analyses the type to determine what it is exactly...
    any ideas?

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001

    Exclamation Not such a simple thing...

    There are good reasons why you can't find the info you're looking for. There are two issues -

    - Windows (except Win98 or older) will not allow a user mode program to directly access memory. You have to write a kernel mode (driver) program. Writing drivers is an advanced topic.

    - In general, Windows hardware is not exactly standardized... Each video chip/card has a specialized driver written for the specific hardware.

    The manufacturer's driver is the key. The driver knows how translate/communicate with the both the OS and the hardware. The idea is that the Windows programmer doesn't have to know anything about the hardware. He/she can use standard Windows API functions to display video or to query the video capabilities.

    The hardware design and the driver are proprietary. I doubt that you can get any memory-map or driver/firmware information from the video card manufacturer. For example, printer manufacturer's no longer publish the "escape codes" that set font size, etc.

    There is a standard start-up mode that allows the video card to display low resolution graphics before the OS and driver are loaded. There may be other standard or psudo-standard modes... I don't know the details about video cards... So, it may not be as quite as bad as I think.

    The Windows driver model looks something like this:


    EDIT ----------------------------
    Maybe you don't need to write directly to video memory.
    There are simple WinAPI functions that you can use to set pixels at an X,Y location on the screen (or in a window). I don't know the functions off the top of my head, and of course you need to use them within a Windows program.

    I don't quite understand your 2nd question, and I probably couldn't answer it anyway.
    Last edited by DougDbug; 01-04-2006 at 01:20 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tools for finding memory leaks
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2009, 11:41 AM
  2. Sharing a Memory Space between two Processes
    By akm3 in forum C Programming
    Replies: 1
    Last Post: 04-02-2009, 02:06 AM
  3. Help with insert/delete binary search tree
    By Nazgulled in forum C Programming
    Replies: 39
    Last Post: 03-25-2009, 04:24 PM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  5. Onboard video card memory access
    By HermioneFan in forum Game Programming
    Replies: 1
    Last Post: 05-28-2003, 09:53 AM