graphics

This is a discussion on graphics within the Windows Programming forums, part of the Platform Specific Boards category; Is there a way to directly access the monitor's output?
I mean, to draw to the screen, you always have ...

graphics

Is there a way to directly access the monitor's output?
I mean, to draw to the screen, you always have to use GDI, OGL, D3D, or somthing else, isn't there some way to forget about all that stuff? How does windows draw?

> How does windows draw?
By providing many hundreds of hardware specific libraries for accessing any imaginable graphics card that can run with a windows compatible PC. All those libraries present the same interface to the layers above, so you get a nice set of interfaces which allow your code to run easily pretty much anywhere (if you use OpenGL).

Is there a way to directly access the monitor's output?
I mean, to draw to the screen, you always have to use GDI, OGL, D3D, or somthing else, isn't there some way to forget about all that stuff? How does windows draw?

Sure, although you probably won't be able to use it very effectively, as the framebuffer that the graphics card gives you is not normally mapped into the memory space of the user-mode application, so you can't actually get to it. But assuming you write a suitable driver to map it into user space you could just write the relevant data into the right position of the framebuffer. Of course, the relevant position depends on the hardware provided - most modern graphics cards do not store pixels in the obvious order of 8 bits of Red, 8 bits Green, 8 bits Blue and 8 bits of Alpha, but rather stores some number of red data items, then the green, the blue and alpha data in their own separate "tiles".

So you don't only need to know where the pixels are stored, but also how they are organized.

In days of old when VGA memory was just that, and the processor did all the pixel bashing then having the memory in the same place was good.

Modern cards usually (AFAIK) sit at the same address, but there's no reason to assume so. Also, many cards have many acceleration functions which are far quicker than letting the host processor bash away at the pixels one at a time.