Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android-example/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub unsafe extern "system" fn Java_org_mozilla_surfmanthreadsexample_SurfmanThre
*app.borrow_mut() = Some(App::new(
connection,
adapter,
device,
device.into(),
context,
resource_loader,
window_size,
Expand Down
2 changes: 1 addition & 1 deletion examples/threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn main() {
..Default::default()
})
.unwrap();
let device = connection.create_device(&adapter).unwrap();
let device = surfman::connection::Connection::create_device(&connection, &adapter).unwrap();

let context_attributes = ContextAttributes {
version: GLVersion::new(3, 0),
Expand Down
2 changes: 1 addition & 1 deletion src/angle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub mod context;
pub mod device;
pub mod surface;

crate::implement_interfaces!(AngleConnection, AngleDevice);
crate::implement_interfaces!(AngleConnection);

#[cfg(test)]
use self::connection::AngleConnection as Connection;
Expand Down
2 changes: 1 addition & 1 deletion src/cgl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub mod surface;
mod error;
mod ffi;

crate::implement_interfaces!(CglConnection, CglDevice);
crate::implement_interfaces!(CglConnection);

#[cfg(test)]
use self::connection::CglConnection as Connection;
Expand Down
6 changes: 2 additions & 4 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

use crate::adapter::AdapterPreferences;
use crate::Adapter;
use crate::Device;
use crate::Error;
use crate::GLApi;

/// Methods relating to display server connections.
pub trait Connection: Sized {
/// The device type associated with this connection.
type Device;

/// Connects to the default display.
fn new() -> Result<Self, Error>;

Expand All @@ -20,7 +18,7 @@ pub trait Connection: Sized {
fn create_adapter(&self, preferences: AdapterPreferences) -> Result<Adapter, Error>;

/// Opens a device.
fn create_device(&self, adapter: &Adapter) -> Result<Self::Device, Error>;
fn create_device(&self, adapter: &Adapter) -> Result<Device, Error>;

/// Opens the display connection corresponding to the given `DisplayHandle`.
fn from_display_handle(handle: raw_window_handle::DisplayHandle) -> Result<Self, Error>;
Expand Down
Loading
Loading