mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 13:50:05 -04:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user