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?
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).
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.
Yarin, you can also use crayons that can draw properly on a glass surface!
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.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Ohj, I was under the impression that all the graphics cards use a specific reserved memory space, regardless of what kind it is.
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.
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.