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.
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]
&self,
native_device: Self::NativeDevice
) -> Result<Self::Device, Error>
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]
&self,
window: &Window
) -> Result<Self::NativeWidget, Error>
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]
&self,
raw: *mut c_void,
size: Size2D<i32>
) -> Self::NativeWidget
Creates a native widget from a raw pointer
Implementors
impl Connection for surfman::platform::unix::generic::connection::Connection
[src]
type Adapter = Adapter
type Device = Device
type NativeConnection = NativeConnection
type NativeDevice = NativeDevice
type NativeWidget = NativeWidget
fn new() -> Result<Connection, Error>
[src]
fn native_connection(&self) -> Self::NativeConnection
[src]
fn gl_api(&self) -> GLApi
[src]
fn create_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_hardware_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_low_power_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_software_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_device(&self, adapter: &Adapter) -> Result<Device, Error>
[src]
unsafe fn create_device_from_native_device(
&self,
native_device: Self::NativeDevice
) -> Result<Device, Error>
[src]
&self,
native_device: Self::NativeDevice
) -> Result<Device, Error>
fn from_winit_window(window: &Window) -> Result<Connection, Error>
[src]
fn create_native_widget_from_winit_window(
&self,
window: &Window
) -> Result<NativeWidget, Error>
[src]
&self,
window: &Window
) -> Result<NativeWidget, Error>
unsafe fn create_native_widget_from_ptr(
&self,
raw: *mut c_void,
size: Size2D<i32>
) -> NativeWidget
[src]
&self,
raw: *mut c_void,
size: Size2D<i32>
) -> NativeWidget
impl Connection for surfman::platform::unix::wayland::connection::Connection
[src]
type Adapter = Adapter
type Device = Device
type NativeConnection = NativeConnection
type NativeDevice = NativeDevice
type NativeWidget = NativeWidget
fn new() -> Result<Connection, Error>
[src]
fn native_connection(&self) -> Self::NativeConnection
[src]
fn gl_api(&self) -> GLApi
[src]
fn create_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_hardware_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_low_power_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_software_adapter(&self) -> Result<Adapter, Error>
[src]
fn create_device(&self, adapter: &Adapter) -> Result<Device, Error>
[src]
unsafe fn create_device_from_native_device(
&self,
native_device: Self::NativeDevice
) -> Result<Device, Error>
[src]
&self,
native_device: Self::NativeDevice
) -> Result<Device, Error>
fn from_winit_window(window: &Window) -> Result<Connection, Error>
[src]
fn create_native_widget_from_winit_window(
&self,
window: &Window
) -> Result<NativeWidget, Error>
[src]
&self,
window: &Window
) -> Result<NativeWidget, Error>
unsafe fn create_native_widget_from_ptr(
&self,
raw: *mut c_void,
size: Size2D<i32>
) -> NativeWidget
[src]
&self,
raw: *mut c_void,
size: Size2D<i32>
) -> NativeWidget
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]
Def: DeviceInterface,
Alt: DeviceInterface,
Def::Connection: ConnectionInterface<Device = Def>,
Alt::Connection: ConnectionInterface<Device = Alt>,
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>
fn new() -> Result<Connection<Def, Alt>, Error>
[src]
fn native_connection(&self) -> NativeConnection<Def, Alt>
[src]
fn gl_api(&self) -> GLApi
[src]
fn create_adapter(&self) -> Result<Adapter<Def, Alt>, Error>
[src]
fn create_hardware_adapter(&self) -> Result<Adapter<Def, Alt>, Error>
[src]
fn create_low_power_adapter(&self) -> Result<Adapter<Def, Alt>, Error>
[src]
fn create_software_adapter(&self) -> Result<Adapter<Def, Alt>, Error>
[src]
fn create_device(
&self,
adapter: &Adapter<Def, Alt>
) -> Result<Device<Def, Alt>, Error>
[src]
&self,
adapter: &Adapter<Def, Alt>
) -> Result<Device<Def, Alt>, Error>
unsafe fn create_device_from_native_device(
&self,
native_device: NativeDevice<Def, Alt>
) -> Result<Device<Def, Alt>, Error>
[src]
&self,
native_device: NativeDevice<Def, Alt>
) -> Result<Device<Def, Alt>, Error>
fn from_winit_window(window: &Window) -> Result<Connection<Def, Alt>, Error>
[src]
fn create_native_widget_from_winit_window(
&self,
window: &Window
) -> Result<Self::NativeWidget, Error>
[src]
&self,
window: &Window
) -> Result<Self::NativeWidget, Error>
unsafe fn create_native_widget_from_ptr(
&self,
raw: *mut c_void,
size: Size2D<i32>
) -> NativeWidget<Def, Alt>
[src]
&self,
raw: *mut c_void,
size: Size2D<i32>
) -> NativeWidget<Def, Alt>