Struct ocl::builders::ContextBuilder
[−]
[src]
pub struct ContextBuilder { /* fields omitted */ }A builder for Context.
TODO: Implement index-searching-round-robin-ing methods (and thier '_exact' counterparts).
Methods
impl ContextBuilder[src]
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.
[TODO]: - That stuff above (find a valid context, devices, etc. first thing). - Handle context creation callbacks.
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.
fn properties<'a>(&'a mut self,
properties: ContextProperties)
-> &'a mut ContextBuilder
properties: ContextProperties)
-> &'a mut ContextBuilder
Specify context properties directly.
Overwrites any previously specified properties.
fn property<'a>(&'a mut self,
prop_val: ContextPropertyValue)
-> &'a mut ContextBuilder
prop_val: ContextPropertyValue)
-> &'a mut ContextBuilder
Specify 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).
fn platform(&mut self, platform: Platform) -> &mut ContextBuilder
Specifies a platform.
Overwrites any previously specified platform.
fn gl_context(&mut self, gl_handle: u32) -> &mut ContextBuilder
Specifies an OpenGL context to associate with.
Overwrites any previously specified OpenGL context.
fn devices<D: Into<DeviceSpecifier>>(&mut self,
device_spec: D)
-> &mut ContextBuilder
device_spec: D)
-> &mut ContextBuilder
Specifies a DeviceSpecifer which specifies how specifically
the relevant devices shall be specified.
See DeviceSpecifier for actually
useful documentation.
Panics
Panics if any devices have already been specified.