Thread: Rendering Pixels w/o Libraries

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    102

    Rendering Pixels w/o Libraries

    Hey everyone, I was hoping to find an answer to this question on the forum. Can't seem to find it much of anywhere else.
    How would you display output to the monitor, such as one pixel. Without using any pre-created libraries or add-ins. Using solid C++ syntax, and the int main() function.
    Anyone know?
    My Favorite Programming Line:
    Code:
    #define true ((rand() % 2) ? true : false)

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    903
    It's impossible, point blank. Pure C++ has no knowledge of any input/output system.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Yes, it does. It knows the standard and file streams.

    But nothing beyond that.
    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

  4. #4
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    If you ran your program under an operating system which did not put a layer between itself and the hardware, theoretically you could directly access videocard memory using pointers.

    http://www.monstersoft.com/tutorial1/VESA_intro.html

    You'll need a decent understanding of the underlying architecture, along with some assembly to talk to the BIOS.


    These techniques won't work under Windows, Linux, OSX or any modern operating system, because the operating system prevents direct hardware access. Instead, programs talk to the operating system, which talks to the hardware, therefore providing a unified way to access hardware, and forcing programs to cooperate with each other.
    Programming Your Mom. http://www.dandongs.com/

  5. #5
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    If you want something small and basic you could use TinyPTC. I havent used it yet, but I'll be having a go at it.

  6. #6
    Registered User
    Join Date
    Apr 2007
    Posts
    102
    Hmm.. Interesting, but i guess it makes sense that it is done through the operating system.
    No direct access kinda stinks though. Anyways, thanks for your help, nice to know it can't be done.
    My Favorite Programming Line:
    Code:
    #define true ((rand() % 2) ? true : false)

  7. #7
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    At first direct access seems nice, but once you get into it, you'll be glad that the OS does what it does. Once you get a basic OpenGL setup going (I'd recommend in conjunction with SDL or glfw), it makes everything easier by handling Geometry, textures, transformations, and other things that would take lots of time to implement manually.
    Programming Your Mom. http://www.dandongs.com/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MinGW thread-safe runtime libraries
    By Mario F. in forum C++ Programming
    Replies: 3
    Last Post: 08-21-2006, 08:15 AM
  2. scene graph rendering techniques
    By ichijoji in forum Game Programming
    Replies: 7
    Last Post: 03-19-2006, 12:17 AM
  3. Manual rendering disappears
    By Magos in forum Windows Programming
    Replies: 7
    Last Post: 02-29-2004, 09:25 PM
  4. voxel based rendering
    By Silvercord in forum Game Programming
    Replies: 1
    Last Post: 03-20-2003, 05:14 PM
  5. Algo needed for 'Fit to page'
    By Unregged in forum Windows Programming
    Replies: 6
    Last Post: 10-03-2002, 07:09 AM