Lazarus

Free Pascal => Beginners => Topic started by: joho on September 13, 2017, 11:03:27 pm

Title: RTL: Video
Post by: joho on September 13, 2017, 11:03:27 pm

program testh;

uses
  video;

begin
  InitVideo;
  Writeln (ScreenHeight);
  Writeln (ScreenWidth);
end.


Outputs 56 and 132. In a CMD window (Win10Pro64) that I have defined as 132x50. Why?
If I change the window size to 80x43, I'll get 80 width, and 56 height, why?

Doing a GetVideoMode (), I get the same value in "Row".

(FPC 3.0.2)
Title: Re: RTL: Video
Post by: munair on October 01, 2017, 07:59:39 am
I believe SreenHeight and ScreenWith are defined in the unit CRT.
Title: Re: RTL: Video
Post by: marcov on October 01, 2017, 11:09:46 am
IIRC a windows cmd has two sizes. One for the visible resolution, one of the scrollbackbuffer.

You are seeing the scrollback buffer one, at least the part that has been used (which can be smaller than the max scrollbuffer size if the cmd.exe is just started).
Title: Re: RTL: Video
Post by: joho on October 02, 2017, 09:22:21 am
IIRC a windows cmd has two sizes. One for the visible resolution, one of the scrollbackbuffer.

You are seeing the scrollback buffer one, at least the part that has been used (which can be smaller than the max scrollbuffer size if the cmd.exe is just started).

Hmm ... OK ... I guess that "makes sense", but if I don't want to rely on CRT, how would I fetch the actual screen height/width? Using the RTL I mean.
Title: Re: RTL: Video
Post by: marcov on October 02, 2017, 10:37:32 am
Video has screenwidth/height too.

The only advise that I can give is study the textmode IDE. It sets the console in different modes that are more like a dos screen.
Title: Re: RTL: Video
Post by: joho on October 02, 2017, 10:48:56 am
Video has screenwidth/height too.

The only advise that I can give is study the textmode IDE. It sets the console in different modes that are more like a dos screen.

Thanks. Will do.
TinyPortal © 2005-2018