*Is there any way to write directly to screen, Without using any kind of drivers at all?
Posted on 2001-11-05 12:44:05 by Rulerz
In the windows 32 bit API there exists something called a Device Context. If you create a device context using CreateDC and passing "Display" as the first parameter then a handle will be returned in eax which you can use gdi functions on (such as bitblit and TextOut).

If you mean writing directly to video memory like in the dos days, then the answer is not without a device driver or some very operating system and version dependant code which will be unstable at best.

here is what I would use to get a whole screen DC:

invoke CreateDC, addr Display, NULL, NULL, NULL
mov myhdc, eax
Posted on 2001-11-06 17:54:54 by emonk
I'd just like to quickly add that you can use GetDIBits and SetDIBits of the DIB selected in the hDC, if you're interested in writing to memory directly without GDI commands.
Posted on 2001-11-06 17:56:42 by Irving W.
Writing a device driver to do your work is NOT easy. I mean, ok,
if you know the linear address of your framebuffer, and the pixel
format used, and the width, height, and pitch... it's not too hard.
But getting this information programatically from a driver... *bleh*.
The only approach I can really think of would be writing a fake
driver layer between your app and the real driver, and... this is not
worth it. The only area where you should be wanting to write directly
to the screen is in a kernel-mode debugger.

For everything else, use DirectDraw and be happy.
Posted on 2001-11-07 02:51:58 by f0dder