mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
Implement headless rendering
This commit is contained in:
@@ -14,6 +14,10 @@ mod support;
|
||||
#[cfg(target_os = "android")]
|
||||
android_start!(main)
|
||||
|
||||
#[cfg(not(feature = "window"))]
|
||||
fn main() { println!("This example requires glutin to be compiled with the `window` feature"); }
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
fn main() {
|
||||
// enumerating monitors
|
||||
let monitor = {
|
||||
|
||||
@@ -12,6 +12,10 @@ mod support;
|
||||
#[cfg(target_os = "android")]
|
||||
android_start!(main)
|
||||
|
||||
#[cfg(not(feature = "window"))]
|
||||
fn main() { println!("This example requires glutin to be compiled with the `window` feature"); }
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
fn main() {
|
||||
let window1 = glutin::Window::new().unwrap();
|
||||
let window2 = glutin::Window::new().unwrap();
|
||||
@@ -30,6 +34,7 @@ fn main() {
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
fn run(window: glutin::Window, color: (f32, f32, f32, f32)) {
|
||||
unsafe { window.make_current() };
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![cfg(feature = "window")]
|
||||
|
||||
#[phase(plugin)]
|
||||
extern crate gl_generator;
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ mod support;
|
||||
#[cfg(target_os = "android")]
|
||||
android_start!(main)
|
||||
|
||||
#[cfg(not(feature = "window"))]
|
||||
fn main() { println!("This example requires glutin to be compiled with the `window` feature"); }
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
fn main() {
|
||||
let window = glutin::Window::new().unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user