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

Context properties list.

[MINIMALLY TESTED]

TODO: Check for duplicate property assignments.

Implementations§

source§

impl ContextProperties

source

pub fn new() -> ContextProperties

Returns an empty new list of context properties

source

pub fn platform<P: Into<PlatformId>>(self, platform: P) -> ContextProperties

Specifies a platform (builder-style).

source

pub fn interop_user_sync(self, sync: bool) -> ContextProperties

Specifies whether the user is responsible for synchronization between OpenCL and other APIs (builder-style).

source

pub fn gl_context(self, gl_ctx: *mut c_void) -> ContextProperties

Specifies an OpenGL context handle (builder-style).

source

pub fn glx_display(self, glx_disp: *mut c_void) -> ContextProperties

Specifies a Display pointer for the GLX context (builder-style).

source

pub fn wgl_hdc(self, wgl_hdc: *mut c_void) -> ContextProperties

Specifies a Display pointer for the WGL HDC (builder-style).

source

pub fn cgl_sharegroup(self, gl_sharegroup: *mut c_void) -> ContextProperties

Specifies an OpenGL context CGL share group to associate the OpenCL context with (builder-style).

source

pub fn egl_display(self, egl_disp: *mut c_void) -> ContextProperties

Specifies a pointer for the EGL display (builder-style).

source

pub fn property_value(self, prop: ContextPropertyValue) -> ContextProperties

Pushes a ContextPropertyValue onto this list of properties (builder-style).

source

pub fn set_platform<P: Into<PlatformId>>(&mut self, platform: P)

Specifies a platform.

source

pub fn set_interop_user_sync(&mut self, sync: bool)

Specifies whether the user is responsible for synchronization between OpenCL and other APIs.

source

pub fn set_gl_context(&mut self, gl_ctx: *mut c_void)

Specifies an OpenGL context handle.

source

pub fn set_glx_display(&mut self, glx_disp: *mut c_void)

Specifies a Display pointer for the GLX context.

source

pub fn set_wgl_hdc(&mut self, wgl_hdc: *mut c_void)

Specifies a Display pointer for the WGL HDC.

source

pub fn set_cgl_sharegroup(&mut self, gl_sharegroup: *mut c_void)

Specifies an OpenGL context CGL share group to associate the OpenCL context with.

source

pub fn set_egl_display(&mut self, egl_disp: *mut c_void)

Specifies a pointer for the EGL display.

source

pub fn set_property_value(&mut self, prop: ContextPropertyValue)

Pushes a ContextPropertyValue onto this list of properties.

source

pub fn get_platform(&self) -> Option<PlatformId>

Returns a platform id or none.

source

pub fn contains_gl_context_or_sharegroup(&self) -> bool

Returns true if this set of context properties specifies any OpenGL context or sharegroup to associate with.

source

pub fn to_raw(&self) -> Vec<isize>

Converts this list into a packed-word representation as specified here.

source

pub unsafe fn extract_property_from_raw( property: ContextProperty, raw_context_properties: &[isize] ) -> Option<ContextPropertyValue>

Returns a single context property value.

source

pub unsafe fn from_raw( raw_context_properties: &[isize] ) -> OclCoreResult<ContextProperties>

Converts raw stuff into other stuff.

Trait Implementations§

source§

impl Clone for ContextProperties

source§

fn clone(&self) -> ContextProperties

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ContextProperties

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ContextProperties> for Vec<isize>

source§

fn from(cp: ContextProperties) -> Vec<isize>

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.