MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 431 forks source link

Multiple screens in OpenOS #3543

Closed mrFavoslav closed 2 years ago

mrFavoslav commented 2 years ago

Hi everyone.

I'm new to OpenComputers but i have some programming skills. I would like to ask HOW to use multiple screens with OpenOS. Everything i tried does not work. I have two Tier III GPUs installed but still only one screen works. So how can i make two or more screens to work with one or even two GPUs installed?

AR2000AR commented 2 years ago

OpenOS bind a gpu to a screen when booting. To use multiple screens you need one gpu per screen and to bind them to a screen yourself. It may also be possible to use one gpu for multiples screen by rebinding it as needed vut I may be wrong as it could clear the screen. Check the gpu api documentation for the bind method.

mrFavoslav commented 2 years ago

Ok. Got it. Thanks! But i have some more questions. I got some code which can switch on which screen can the OpenOS terminal is but i cannot use the screens simultaneously. I can use only one at a time. How can i run terminal on each screen simultaneously? Or how can i run specific program on specific screen? Because if i run some program regardless on which screen the program will always start on specific screen which for me is my secondary screen.. even if i run the program from terminal on my first screen.

AR2000AR commented 2 years ago

OpenOS itself doesn't support multiples screen. It may be possible to setup the env before running a script to select the screen, but running 1 script per monitor will require multitasking and no dependencies to lib like term since they use the primary gpu / screen

payonel commented 2 years ago

openos't tty uses a single gpu, and in openos a GPU binds to the screen automatically. If you want to start writing to a new screen, call gpu.bind to the new screen. see manual about the graphics card, and read some info on the wiki https://ocdoc.cil.li/