News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Write Directly To Window

Started by cman, April 13, 2010, 11:29:27 PM

Previous topic - Next topic

cman

Is there a way to write text directly to a Window without use of an api function? I remember this could be done in DOS programming using the video buffer, but I'm not sure with Windows. Thanks for any info....

qWord

Without the API it clearly not possible. If you have the windows handle, than it possible (through GetDC(hWnd)). The problem is that the window will overwrite this text when it is update/redrawn.
FPU in a trice: SmplMath
It's that simple!

Farabi

Yes it is posible but why? DOS is text mode where every picture elements is formed a text, and Windows is Graphic Mode where every picture elements is a tiny dot.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

raymond

QuoteDOS is text mode where every picture elements is formed a text

The DOS function was also "graphic" for the VESA modes, each letter being formed one pixel at a time. I can still remember examining that function which was SLOW. When I still had that 8MHz 386, you could almost read each line of text as it was displayed. I then wrote my own function (using the DOS data for the letters) and the display became almost instantaneous.
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

jj2007

Quote from: raymond on April 15, 2010, 02:53:45 AM
... SLOW. When I still had that 8MHz 386, you could almost read each line of text as it was displayed. I then wrote my own function (using the DOS data for the letters) and the display became almost instantaneous.
Around 1987, I had an Atari 520ST - same problem. The native mode was incredibly slow, so I had to roll my own (in 68000 assembly), stealing the characters from the TOS fonts; and voilĂ , it rocked! Which makes you wonder which language those guys used for programming screen drivers...

cman

How are Windows laid out in memory? Is it a good idea to access them directly? Thanks for any info.....

raymond

QuoteWhich makes you wonder which language those guys used for programming screen drivers...

It's not as much the language as the procedures.

If I remember it right, in the case of MSDOS for VESA modes, it was sending the VESA codes to set up the memory requirements for each character being displayed (a lot of overhead) instead of setting it once until all required characters were displayed, and then calling their "set pixel" function for each pixel of the character according to the required VESA mode!!!
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

hutch--

cman,

The closest you will come to direct memory control is DirectX and that requires setting up either a Window or full screen to do it first. There is no way to access the direct video memory as protected mode OS versions ensure that you cannot do that.

As you can imagine, the memory management for a multiwindowed OS like Windows is some powers more complex than a non-reentrant OS version in real mode like MS-DOS and this goes for disk IO and any other normal OS operation. The only memory you can control is memory you allocate yourself in a process, the alternative is the way things were in the old Win 3.0 days where anything could wreck the entire OS with a memory write error.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

vanjast

It is possible but you'd need to know how each graphics card driver works (DirectX/OpenGL was created as a universal graphics interface to avoid this developer 'stumbling block'). And above this you'd probably also need the hardware specific info on every graphics chip on the market. As you can see... you going to spend alot of time reading/learning just to put a dot on the screen (re-inventing the wheel).

If you're that eager, I'd suggest the first place to start is to learn the DirectX/OpenGL interfaces and how they link to the graphics drivers. From this you indirectly learn the driver interfaces, but now you're probably talking Ring0 I/F, that's if the drivers have no higher level interfaces. It'll will be a good idea to now look at info on writing drivers.

Make sure you regularly have short haircuts, as you're grey hairs will start showing... :P
:8)



jj2007

Quote from: vanjast on April 17, 2010, 11:01:37 AMthe first place to start is to learn the DirectX/OpenGL interfaces and how they link to the graphics drivers

Would you say that is significantly faster than the SetDiBits road?

Slugsnack

Quote from: jj2007 on April 17, 2010, 11:16:34 AM
Quote from: vanjast on April 17, 2010, 11:01:37 AMthe first place to start is to learn the DirectX/OpenGL interfaces and how they link to the graphics drivers

Would you say that is significantly faster than the SetDiBits road?
But if he wanted to use WinAPI, he could've just used TextOut or SetPixel :/

jj2007

Quote from: Slugsnack on April 17, 2010, 11:24:30 AM
Quote from: jj2007 on April 17, 2010, 11:16:34 AM
Quote from: vanjast on April 17, 2010, 11:01:37 AMthe first place to start is to learn the DirectX/OpenGL interfaces and how they link to the graphics drivers

Would you say that is significantly faster than the SetDiBits road?
But if he wanted to use WinAPI, he could've just used TextOut or SetPixel :/

Both TextOut and SetPixel are probably a lot slower than SetDIBits...

vanjast

Quote from: jj2007 on April 17, 2010, 11:16:34 AM
Quote from: vanjast on April 17, 2010, 11:01:37 AMthe first place to start is to learn the DirectX/OpenGL interfaces and how they link to the graphics drivers

Would you say that is significantly faster than the SetDiBits road?
JJ, I wouldn't know at this stage.
Sometime ago I spent a solid 3-6 months disecting the DX and GL interfaces, and their connection to graphics card drivers, but am really rusty as I have not followed up on this for at least 2 years. Real life sort of grabbed me by the gonads.. dammm :green2

hutch--

Van,

That sounds really serious, you will have to give up on the "new age sensitive male" approach, dust off that fashionable hat and go back to being a bulldozer again.  :bg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php