Page 1 of 1

Using the new graphical console

Posted: Thu May 20, 2010 9:48 pm
by Foz
I've been testing it (and it works just fine), but I've hit some slight snags, so just a few questions:
1) How can I detect the size of the console?
2) And related to the one above - if the console is resized, is there some way of detecting it?
3) Is it possible for me to access the current text on the screen (like using the Point() function returns the colour of a point in an image, I want to return the character on the screen/terminal)

Re: Using the new graphical console

Posted: Tue May 25, 2010 1:20 am
by Foz
Answers so far:
1) With magic. Linux only as far as I'm aware:

Code: Select all

Structure TerminalWindowSize
  row.w
  col.w
  xPixel.w
  yPixel.w
EndStructure

ws.TerminalWindowSize

#TIOCGWINSZ = $5413

OpenConsole()
EnableGraphicalConsole(1)

PrintN("Press enter to show the current console size")
Input()

ioctl_(0, #TIOCGWINSZ, @ws)
PrintN("> " + Str(ws\col) + " x " + Str(ws\row))

PrintN("")
PrintN("Press enter to quit")
Input()
2) You can't - but you can keep checking the size of the console periodically