pub struct ContextBuilder { /* private fields */ }
Expand description

A builder for Context.

Implementations§

source§

impl ContextBuilder

source

pub fn new() -> ContextBuilder

Creates a new ContextBuilder

Use Context::builder().build().unwrap() for defaults.

§Defaults
  • The first avaliable platform
  • All devices associated with the first available platform
  • No notify callback function or user data.
source

pub fn properties<'a>( &'a mut self, properties: ContextProperties ) -> &'a mut ContextBuilder

Specifies all context properties directly.

Overwrites all previously specified properties.

source

pub fn property<'a>( &'a mut self, prop_val: ContextPropertyValue ) -> &'a mut ContextBuilder

Specifies a context property.

Overwrites any property with the same variant (i.e.: if ContextPropertyValue::Platform was already set, it would be overwritten if prop_val is also ContextPropertyValue::Platform).

source

pub fn platform(&mut self, platform: Platform) -> &mut ContextBuilder

Specifies a platform.

Overwrites any previously specified platform.

source

pub fn gl_context(&mut self, gl_handle: *mut c_void) -> &mut ContextBuilder

Specifies an OpenGL context to associate with.

Overwrites any previously specified OpenGL context.

source

pub fn glx_display(&mut self, glx_display: *mut c_void) -> &mut ContextBuilder

Specifies a Display pointer for the GLX context.

Overwrites any previously specified GLX context.

source

pub fn devices<D: Into<DeviceSpecifier>>( &mut self, device_spec: D ) -> &mut ContextBuilder

Specifies a list of devices with which to associate the context.

Devices may be specified in any number of ways including simply passing a device or slice of devices. See the [impl From] section of DeviceSpecifier for more information.

§Panics

Devices must not have already been specified.

source

pub fn build(&self) -> OclResult<Context>

Returns a new Context with the parameters hitherinforthto specified (say what?).

Returns a newly created context with the specified platform and set of device types.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.