Struct surfman::platform::windows::wgl::connection::Connection
source · pub struct Connection;
Expand description
Represents a connection to the display server.
Window server connections are implicit in the Win32 API, so this is a zero-sized type.
Implementations§
source§impl Connection
impl Connection
sourcepub fn new() -> Result<Connection, Error>
pub fn new() -> Result<Connection, Error>
Connects to the default display.
sourcepub unsafe fn from_native_connection(
_: NativeConnection,
) -> Result<Connection, Error>
pub unsafe fn from_native_connection( _: NativeConnection, ) -> Result<Connection, Error>
An alias for Connection::new()
, present for consistency with other backends.
sourcepub fn native_connection(&self) -> NativeConnection
pub fn native_connection(&self) -> NativeConnection
Returns the underlying native connection.
sourcepub fn gl_api(&self) -> GLApi
pub fn gl_api(&self) -> GLApi
Returns the OpenGL API flavor that this connection supports (OpenGL or OpenGL ES).
sourcepub fn create_adapter(&self) -> Result<Adapter, Error>
pub fn create_adapter(&self) -> Result<Adapter, Error>
Returns the “best” adapter on this system, preferring high-performance hardware adapters.
This is an alias for Connection::create_hardware_adapter()
.
sourcepub fn create_hardware_adapter(&self) -> Result<Adapter, Error>
pub fn create_hardware_adapter(&self) -> Result<Adapter, Error>
Returns the “best” adapter on this system, preferring high-performance hardware adapters.
sourcepub fn create_low_power_adapter(&self) -> Result<Adapter, Error>
pub fn create_low_power_adapter(&self) -> Result<Adapter, Error>
Returns the “best” adapter on this system, preferring low-power hardware adapters.
sourcepub fn create_software_adapter(&self) -> Result<Adapter, Error>
pub fn create_software_adapter(&self) -> Result<Adapter, Error>
Returns the “best” adapter on this system, preferring software adapters.
sourcepub unsafe fn create_device_from_native_device(
&self,
native_device: NativeDevice,
) -> Result<Device, Error>
pub unsafe fn create_device_from_native_device( &self, native_device: NativeDevice, ) -> Result<Device, Error>
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.
sourcepub fn from_display_handle(_: DisplayHandle<'_>) -> Result<Connection, Error>
pub fn from_display_handle(_: DisplayHandle<'_>) -> Result<Connection, Error>
Opens the display connection corresponding to the given DisplayHandle
.
sourcepub unsafe fn create_native_widget_from_ptr(
&self,
raw: *mut c_void,
_size: Size2D<i32>,
) -> NativeWidget
pub unsafe fn create_native_widget_from_ptr( &self, raw: *mut c_void, _size: Size2D<i32>, ) -> NativeWidget
Create a native widget from a raw pointer
sourcepub fn create_native_widget_from_window_handle(
&self,
handle: WindowHandle<'_>,
_size: Size2D<i32>,
) -> Result<NativeWidget, Error>
pub fn create_native_widget_from_window_handle( &self, handle: WindowHandle<'_>, _size: Size2D<i32>, ) -> Result<NativeWidget, Error>
Create a native widget type from the given WindowHandle
.
Trait Implementations§
source§impl Clone for Connection
impl Clone for Connection
source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Connection for Connection
impl Connection for Connection
§type NativeConnection = NativeConnection
type NativeConnection = NativeConnection
§type NativeDevice = NativeDevice
type NativeDevice = NativeDevice
§type NativeWidget = NativeWidget
type NativeWidget = NativeWidget
source§fn native_connection(&self) -> Self::NativeConnection
fn native_connection(&self) -> Self::NativeConnection
source§fn gl_api(&self) -> GLApi
fn gl_api(&self) -> GLApi
source§fn create_adapter(&self) -> Result<Adapter, Error>
fn create_adapter(&self) -> Result<Adapter, Error>
source§fn create_hardware_adapter(&self) -> Result<Adapter, Error>
fn create_hardware_adapter(&self) -> Result<Adapter, Error>
source§fn create_low_power_adapter(&self) -> Result<Adapter, Error>
fn create_low_power_adapter(&self) -> Result<Adapter, Error>
source§fn create_software_adapter(&self) -> Result<Adapter, Error>
fn create_software_adapter(&self) -> Result<Adapter, Error>
source§unsafe fn create_device_from_native_device(
&self,
native_device: Self::NativeDevice,
) -> Result<Device, Error>
unsafe fn create_device_from_native_device( &self, native_device: Self::NativeDevice, ) -> Result<Device, Error>
source§fn from_display_handle(handle: DisplayHandle<'_>) -> Result<Connection, Error>
fn from_display_handle(handle: DisplayHandle<'_>) -> Result<Connection, Error>
DisplayHandle
.source§unsafe fn create_native_widget_from_ptr(
&self,
raw: *mut c_void,
size: Size2D<i32>,
) -> NativeWidget
unsafe fn create_native_widget_from_ptr( &self, raw: *mut c_void, size: Size2D<i32>, ) -> NativeWidget
source§fn create_native_widget_from_window_handle(
&self,
window: WindowHandle<'_>,
size: Size2D<i32>,
) -> Result<NativeWidget, Error>
fn create_native_widget_from_window_handle( &self, window: WindowHandle<'_>, size: Size2D<i32>, ) -> Result<NativeWidget, Error>
WindowHandle
.