SFML community forums

Help => Window => Topic started by: EvilSakray on March 18, 2012, 05:59:35 pm

Title: Checking connection to X Server
Post by: EvilSakray on March 18, 2012, 05:59:35 pm
Hello,

I'd like to know if SFML (1.6) offers any way of checking if DISPLAY environnement of execution shell is properly setted before trying opening a Window.

(env -u DISPLAY / env -i or any invalid value result in an instant segfault.)

Thanks  :wink:
Title: Checking connection to X Server
Post by: Laurent on March 18, 2012, 06:07:39 pm
No, but since it's platform specific you can use platform specific code. Include <Xlib.h> and check whether XOpenDisplay returns NULL or a valid result.
Title: Checking connection to X Server
Post by: EvilSakray on March 18, 2012, 11:29:04 pm
Thanks, worked like a charm  :wink: