Trait surfman::connection::Connection[][src]

pub trait Connection: Sized {
    type Adapter;
    type Device;
    type NativeConnection;
    type NativeDevice;
    type NativeWidget;
    fn new() -> Result<Self, Error>;
fn native_connection(&self) -> Self::NativeConnection;
fn gl_api(&self) -> GLApi;
fn create_adapter(&self) -> Result<Self::Adapter, Error>;
fn create_hardware_adapter(&self) -> Result<Self::Adapter, Error>;
fn create_low_power_adapter(&self) -> Result<Self::Adapter, Error>;
fn create_software_adapter(&self) -> Result<Self::Adapter, Error>;
fn create_device(
        &self,
        adapter: &Self::Adapter
    ) -> Result<Self::Device, Error>;
unsafe fn create_device_from_native_device(
        &self,
        native_device: Self::NativeDevice
    ) -> Result<Self::Device, Error>;
fn from_winit_window(window: &Window) -> Result<Self, Error>;
fn create_native_widget_from_winit_window(
        &self,
        window: &Window
    ) -> Result<Self::NativeWidget, Error>;
unsafe fn create_native_widget_from_ptr(
        &self,
        raw: *mut c_void,
        size: Size2D<i32>
    ) -> Self::NativeWidget; }

Methods relating to display server connections.

Associated Types

type Adapter[src]

The adapter type associated with this connection.

type Device[src]

The device type associated with this connection.

type NativeConnection[src]

The native type associated with this connection.

type NativeDevice[src]

The native device type associated with this connection.

type NativeWidget[src]

The native widget type associated with this connection.

Loading content...

Required methods

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

Connects to the default display.

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

Returns the native connection corresponding to this connection.

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

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

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

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

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

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

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

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

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

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

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

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

Opens a device.

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

Wraps an existing native device type in a device.

fn from_winit_window(window: &Window) -> Result<Self, Error>[src]

Opens the display connection corresponding to the given winit window.

fn create_native_widget_from_winit_window(
    &self,
    window: &Window
) -> Result<Self::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.

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

Creates a native widget from a raw pointer

Loading content...

Implementors

impl Connection for surfman::platform::unix::generic::connection::Connection[src]

impl Connection for surfman::platform::unix::wayland::connection::Connection[src]

impl<Def, Alt> Connection for surfman::platform::generic::multi::connection::Connection<Def, Alt> where
    Def: DeviceInterface,
    Alt: DeviceInterface,
    Def::Connection: ConnectionInterface<Device = Def>,
    Alt::Connection: ConnectionInterface<Device = Alt>, 
[src]

type Adapter = Adapter<Def, Alt>

type Device = Device<Def, Alt>

type NativeConnection = NativeConnection<Def, Alt>

type NativeDevice = NativeDevice<Def, Alt>

type NativeWidget = NativeWidget<Def, Alt>

Loading content...