[][src]Struct surfman::platform::windows::wgl::connection::Connection

pub struct Connection;

Represents a connection to the display server.

Window server connections are implicit in the Win32 API, so this is a zero-sized type.

Implementations

impl Connection[src]

pub fn new() -> Result<Connection, Error>[src]

Connects to the default display.

pub unsafe fn from_native_connection(
    _: NativeConnection
) -> Result<Connection, Error>
[src]

An alias for Connection::new(), present for consistency with other backends.

pub fn native_connection(&self) -> NativeConnection[src]

Returns the underlying native connection.

pub fn gl_api(&self) -> GLApi[src]

Returns the OpenGL API flavor that this connection supports (OpenGL or OpenGL ES).

pub fn create_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring high-performance hardware adapters.

This is an alias for Connection::create_hardware_adapter().

pub fn create_hardware_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring high-performance hardware adapters.

pub fn create_low_power_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring low-power hardware adapters.

pub fn create_software_adapter(&self) -> Result<Adapter, Error>[src]

Returns the "best" adapter on this system, preferring software adapters.

pub fn create_device(&self, adapter: &Adapter) -> Result<Device, Error>[src]

Opens a device.

pub unsafe fn create_device_from_native_device(
    &self,
    native_device: NativeDevice
) -> Result<Device, Error>
[src]

Creates a Device from a Direct3D 11 device and associated GL/DX interop handle.

The handle can be created by calling wglDXOpenDeviceNV from the WGL_NV_DX_interop extension.

This method increases the reference count on the Direct3D 11 device and takes ownership of the GL/DX interop handle.

pub fn from_winit_window(_: &Window) -> Result<Connection, Error>[src]

Opens the display connection corresponding to the given winit window.

pub fn create_native_widget_from_winit_window(
    &self,
    window: &Window
) -> Result<NativeWidget, Error>
[src]

Creates a native widget type from the given winit window.

This type can be later used to create surfaces that render to the window.

pub unsafe fn create_native_widget_from_ptr(
    &self,
    raw: *mut c_void,
    _size: Size2D<i32>
) -> NativeWidget
[src]

Create a native widget from a raw pointer

Trait Implementations

impl Clone for Connection[src]

impl Connection for Connection[src]

type Adapter = Adapter

The adapter type associated with this connection.

type Device = Device

The device type associated with this connection.

type NativeConnection = NativeConnection

The native type associated with this connection.

type NativeDevice = NativeDevice

The native device type associated with this connection.

type NativeWidget = NativeWidget

The native widget type associated with this connection.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.