/// Create a new window
///
/// This creates a window and fully initializes a window.
Create a new window
This creates a window and fully initializes a window.
Create a new window This creates a window and fully initializes a window .
pub fn new(
        title: &str,
        window_config: &WindowConfig,
    ) -> Result<Window> {
        let event_loop = EventsLoop::new();
        Window::platform_window_init();
        let window = WindowBuilder::new()
            .with_title(title)
            .with_visibility(false)
            .with_transparency(true)
            .with_decorations(window_config.decorations());
        let window = create_gl_window(window.clone(), &event_loop, false)
            .or_else(|_| create_gl_window(window, &event_loop, true))?;
        window.show();
        // Text cursor
        window.set_cursor(GlutinMouseCursor::Text);
        // Set OpenGL symbol loader
        gl::load_with(|symbol| window.get_proc_address(symbol) as *const _);
        // Make the context current so OpenGL operations can run
        unsafe {
            window.make_current()?;
        }
        let window = Window {
            event_loop,
            window,
            cursor_visible: true,
            is_focused: true,
        };
        window.run_os_extensions();
        Ok(window)
    }
pub fn new ( title : & str , window_config : & WindowConfig , ) -> Result < Window > { let event_loop = EventsLoop :: new ( ) ; Window :: platform_window_init ( ) ; let window = WindowBuilder :: new ( ) . with_title ( title ) . with_visibility ( false ) . with_transparency ( true ) . with_decorations ( window_config . decorations ( ) ) ; let window = create_gl_window ( window . clone ( ) , & event_loop , false ) . or_else ( | _ | create_gl_window ( window , & event_loop , true ) ) ? ; window . show ( ) ; // Text cursor window . set_cursor ( GlutinMouseCursor :: Text ) ; // Set OpenGL symbol loader gl :: load_with ( | symbol | window . get_proc_address ( symbol ) as * const _ ) ; // Make the context current so OpenGL operations can run unsafe { window . make_current ( ) ? ; } let window = Window { event_loop , window , cursor_visible : true , is_focused : true , } ; window . run_os_extensions ( ) ; Ok ( window ) }
Create a new window
This creates a window and fully initializes a window.
Create a new window This creates a window and fully initializes a window .
title
&str
window_config
&WindowConfig