* * *

Author Topic: RTL: Video  (Read 608 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

  • Sr. Member
  • ****
  • Posts: 273
  • Keep it simple.
    • Ditrianum
Re: RTL: Video
« Reply #1 on: October 01, 2017, 07:59:39 am »
I believe SreenHeight and ScreenWith are defined in the unit CRT.
Lazarus 1.6.2, testing 1.8, FPC 3.0.0; Debian 9 KDE 5.8.6 x64; Windows 7 x64, PC-DOS2000

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5804
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5804
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.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus