Thread: Direct Graphics Programming

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    1

    Direct Graphics Programming

    As an overview of what I'm trying to do is simply make a program that will display an 32 bit image on the screen. In game programming this is a simple process by using an existing library to render an image to a window. What I've been trying to learn the past few weeks is Assembly to attempt to do this as a first step in creating a minimalistic operating system. I know a LITTLE bit such as the main registers AX, BX, or EAX for 32 bit and RAX for 64 bit, and etc. I understand the concepts of the CPU and RAM, but am having a VERY difficult time understanding things such as peripherals and how to interact with them through interrupts. This seems to be the most vital part to understand, at least to me.

    I have a concrete understanding of how to use C\C++, but I don't know all of the possible functions and commands I could. Mainly what I'm looking for right now is to write pixels\images to the screen without the need of an operating system running. I assume that with this I'd need to make my own little mini video card driver. I'm pretty sure this can be done with C and possibly some inline Assembly. Just as a heads up, my IDE\Compiler is Visual Studio 2010:Visual C++ 2010.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    how to write an os - Google Search
    Pretty soon, you'll come across how to write drivers for your new OS.

    Yes you can still treat video memory as just a dumb block of memory you can write to from the CPU.
    But if you want real performance, then you need to know that pretty much any graphics card from the last 10+ years has a GPU (possibly quite a few), which are really capable at bashing out those pixels at a far higher rate than you could from the CPU.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I'm think this is commonly done using VESA:

    VESA - Wikipedia, the free encyclopedia

    Eg, I'd guess that's how the GRand Unified Bootloader presents an splash screen, which you could look at the C source for that:

    GNU GRUB - GNU Project - Free Software Foundation (FSF)
    Last edited by MK27; 04-06-2012 at 10:09 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    google 'how to learn bare metal programming' . and displaying a 32bit graphic image is not a first step in learning to program an OS, its arguably the last step.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectDraw in Direct Graphics
    By lyx in forum Game Programming
    Replies: 11
    Last Post: 12-07-2003, 04:01 PM
  2. Dual Poll: Direct X/Open GL, Game/Windows Programming
    By Geo-Fry in forum C++ Programming
    Replies: 8
    Last Post: 05-02-2003, 02:24 PM
  3. programming w/direct x
    By dP munky in forum Game Programming
    Replies: 3
    Last Post: 02-11-2003, 11:09 PM
  4. Microsoft Visual C++ ? graphics DIRECT X???
    By NNTB in forum C++ Programming
    Replies: 1
    Last Post: 11-21-2001, 02:40 AM
  5. Graphics programming in C
    By Music_Man in forum C Programming
    Replies: 2
    Last Post: 10-11-2001, 03:32 PM