Struct ocl::builders::ContextBuilder [−][src]
#[must_use = "builders do nothing unless \'::build\' is called"]pub struct ContextBuilder { /* fields omitted */ }
A builder for Context
.
Methods
impl ContextBuilder
[src]
impl ContextBuilder
pub fn new() -> ContextBuilder
[src]
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.
pub fn properties<'a>(
&'a mut self,
properties: ContextProperties
) -> &'a mut ContextBuilder
[src]
pub fn properties<'a>(
&'a mut self,
properties: ContextProperties
) -> &'a mut ContextBuilder
Specifies all context properties directly.
Overwrites all previously specified properties.
pub fn property<'a>(
&'a mut self,
prop_val: ContextPropertyValue
) -> &'a mut ContextBuilder
[src]
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
).
pub fn platform(&mut self, platform: Platform) -> &mut ContextBuilder
[src]
pub fn platform(&mut self, platform: Platform) -> &mut ContextBuilder
Specifies a platform.
Overwrites any previously specified platform.
pub fn gl_context(&mut self, gl_handle: *mut c_void) -> &mut ContextBuilder
[src]
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.
pub fn glx_display(&mut self, glx_display: *mut c_void) -> &mut ContextBuilder
[src]
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.
pub fn devices<D: Into<DeviceSpecifier>>(
&mut self,
device_spec: D
) -> &mut ContextBuilder
[src]
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.
pub fn build(&self) -> OclResult<Context>
[src]
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
impl Send for ContextBuilder
impl Send for ContextBuilder
impl Sync for ContextBuilder
impl Sync for ContextBuilder