making a graphics driver

This is a discussion on making a graphics driver within the C++ Programming forums, part of the General Programming Boards category; I know ogl and dx are so fast because they directly access the graphics card ect.. But how difficult of ...

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,665

    making a graphics driver

    I know ogl and dx are so fast because they directly access the graphics card ect..
    But how difficult of an undertaking would it be to make your own graphics driver that works like ogl and dx? (but nowhere near as complex of course)
    Is is fesable for 1 person to do this even if it is really simple?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,772
    Simple? A driver is never simple.
    DX/OpenGL communicates with the graphics driver, and you know how much time ATI/nVidia has spent on those...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,248
    Quote Originally Posted by Yarin View Post
    I know ogl and dx are so fast because they directly access the graphics card ect..
    But how difficult of an undertaking would it be to make your own graphics driver that works like ogl and dx? (but nowhere near as complex of course)
    Is is fesable for 1 person to do this even if it is really simple?
    Single programmers write drivers all the time. But OpenGL and DirectX are more than drivers, they are entire API frameworks which specify a set of supported operations. Depending on the graphics card, some of these operations can be done by the hardware, and some might need to be emulated in software on cards which can't do them.

    If you just want to exercise the features of some specific graphics card, you could write a driver for that card, depending on your skill level. Be prepared to reboot a lot during development.

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,772
    If you just want to exercise the features of some specific graphics card, you could write a driver for that card, depending on your skill level. Be prepared to reboot a lot during development.
    Wouldn't a virtual pc be feasible for this? Blue screens are not a good thing.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,248
    Quote Originally Posted by Elysia View Post
    Simple? A driver is never simple.
    Why not? It depends how complicated the hardware device is and how many of its features you are willing to ignore.

  6. #6
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,772
    Quote Originally Posted by brewbuck View Post
    Why not? It depends how complicated the hardware device is and how many of its features you are willing to ignore.
    Ah well, if you put it that way.
    Still, it's harder than normal application programming.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,665
    So gl and dx have to code their drivers to support and work with a veriety of different hardwares, including different kinds of code for different cards?

    It'd be better to try to write an engine then?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  8. #8
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    GL and DX are typically implemented as part of the driver package. (In the case of DX, there's a fixed part, too. In the case of GL, usually not. But Linux GL variants may be based on the X DRI infrastructure, in which case they only supply hardware hooks for Mesa.)

    But the main problem with writing graphics drivers is knowing what there is to do. To write a graphics driver:
    1) You first need to write the 2d part of the driver, or your system won't boot. You can't reuse the 2d part of the existing driver - drivers don't like their controlled devices being messed with.
    2) You need the hardware-level interface of the card. Which means getting specifications (ATI has released theirs - partially, so far) or reverse engineering.
    3) Note that just trying things out is not a valid way of finding out what the card does. Improper access at hardware level can damage your graphics card. If you develop a driver by reverse engineering, there's a good chance you'll kill a card at least once.


    An engine? Well, you could do that, but that's an entirely different subject.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  9. #9
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by CornedBee View Post
    Note that just trying things out is not a valid way of finding out what the card does. Improper access at hardware level can damage your graphics card. If you develop a driver by reverse engineering, there's a good chance you'll kill a card at least once.
    Really? How would that be?

  10. #10
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,676
    Let's say you start peek'n and poke'n around (pun intended) and accidentally *way* over-clock a chip and burn it up. Or perhaps there's a register that indirectly controls voltage somewhere that needs to stay within certain parameters....ect, ect...

    I've killed some hardware....

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle Graphics, how does it work?
    By freddyvorhees in forum C++ Programming
    Replies: 15
    Last Post: 08-28-2009, 09:57 AM
  2. Difficulty choosing graphics library
    By jdiperla in forum Game Programming
    Replies: 11
    Last Post: 02-27-2008, 05:35 PM
  3. Handling mouse in graphics mode in Turbo C/DOS
    By sureshkumarct in forum C Programming
    Replies: 2
    Last Post: 12-24-2006, 08:36 AM
  4. Beginning Game Programming Type Books
    By bumfluff in forum Game Programming
    Replies: 36
    Last Post: 09-13-2006, 04:15 PM
  5. HP-UX odbc driver updates?
    By WaterNut in forum Windows Programming
    Replies: 2
    Last Post: 08-27-2004, 04:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21