Add an interface for providing system wide initialization options to the windowing system.
This allows setting up Linux based systems which use multithreaded OpenGL contexts.
This commit is contained in:
parent
d8ca679a6e
commit
97c471dc05
4 changed files with 18 additions and 0 deletions
|
|
@ -1,9 +1,11 @@
|
|||
use std::{ptr};
|
||||
use super::super::ffi;
|
||||
use super::ensure_thread_init;
|
||||
|
||||
pub struct MonitorID(pub uint);
|
||||
|
||||
pub fn get_available_monitors() -> Vec<MonitorID> {
|
||||
ensure_thread_init();
|
||||
let nb_monitors = unsafe {
|
||||
let display = ffi::XOpenDisplay(ptr::null());
|
||||
if display.is_null() {
|
||||
|
|
@ -20,6 +22,7 @@ pub fn get_available_monitors() -> Vec<MonitorID> {
|
|||
}
|
||||
|
||||
pub fn get_primary_monitor() -> MonitorID {
|
||||
ensure_thread_init();
|
||||
let primary_monitor = unsafe {
|
||||
let display = ffi::XOpenDisplay(ptr::null());
|
||||
if display.is_null() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue