Using the new graphical console

Linux specific forum
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Using the new graphical console

Post 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)
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: Using the new graphical console

Post 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
Post Reply