Is there a way to find out how many displays are available to my Processing program?
I would like my sketch to start in fullScreen on display 2 if it is connected, otherwise display 1. Currently, I’m using fullScreen(2) and it gives a warning if there is no display 2, but still works. I’d like to avoid the warning, if possible, by checking for the presence of display 2 before I go fullScreen on it.
You can have a look at the source code and implement a solution for your use case. Points of interest in the source code:
The last link shows that you can specify a parameter when running your sketch. It could be handy in certain scenarios as for example, if your code was an executable.
Excellent, thanks! The GraphicsEnvironment (with GraphicsDevice list) gives me exactly what I need.