Recent

Author Topic: RTL: Video  (Read 3506 times)

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
RTL: Video
« 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)

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: RTL: Video
« Reply #1 on: October 01, 2017, 07:59:39 am »
I believe SreenHeight and ScreenWith are defined in the unit CRT.
keep it simple

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11455
  • FPC developer.
Re: RTL: Video
« Reply #2 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).

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
Re: RTL: Video
« Reply #3 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.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11455
  • FPC developer.
Re: RTL: Video
« Reply #4 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.

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
Re: RTL: Video
« Reply #5 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