Class SoDeviceContext
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.devices.SoDeviceContext
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoCpuContext
,SoGLContext
public class SoDeviceContext extends Inventor implements SafeDisposable
Abstract base class for device context managment. This class provides generic functions to manage or get data about specific device contexts.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind()
Bind this context to the current thread.boolean
dispose()
Explicitly call this method to force object to dispose its unmanaged resources.SoDeviceContextSharedGroup
getSharedGroup()
Returns the current shared group.int
getSharedId()
Returns an id common to all compatible/shared contexts.boolean
isCompatible(SoDeviceContext name_10849)
Returns true if two contexts are compatible.boolean
isCurrent()
Returns true if the context is valid and currently active.boolean
isDisposable()
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.boolean
isSharable()
Returns the sharable status of this context.boolean
isSharedWith(SoDeviceContext context)
Returns the current sharing state with passed context.boolean
isValid()
Returns true if this context is valid.void
setSharable(boolean sharable)
Sets the sharable property.boolean
setSharedGroup(SoDeviceContextSharedGroup sharedGroup)
Explicitly change the sharedGroup.boolean
setSharedWith(SoDeviceContext sourceCtx)
Share this context.void
unbind()
Unbind this context from the current thread.-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Method Detail
-
isDisposable
public boolean isDisposable()
Description copied from interface:SafeDisposable
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.- Specified by:
isDisposable
in interfaceSafeDisposable
- Returns:
true
if the object can be disposed in a safe manner
-
dispose
public boolean dispose()
Description copied from class:Inventor
Explicitly call this method to force object to dispose its unmanaged resources. The object may not be reused in the application code after this call.- Specified by:
dispose
in interfaceSafeDisposable
- Overrides:
dispose
in classInventor
- Returns:
true
if this object native resources were successfully disposed;false
if it was already disposed or no native resources has been registered for this object.
-
isCompatible
public boolean isCompatible(SoDeviceContext name_10849)
Returns true if two contexts are compatible.
Compatible means that using a buffer from one of these contexts inside the other will not require copying the data.
-
isCurrent
public boolean isCurrent()
Returns true if the context is valid and currently active.
-
setSharable
public void setSharable(boolean sharable)
Sets the sharable property.
-
bind
public void bind()
Bind this context to the current thread.
-
unbind
public void unbind()
Unbind this context from the current thread.
-
isSharedWith
public boolean isSharedWith(SoDeviceContext context)
Returns the current sharing state with passed context.
-
setSharedGroup
public boolean setSharedGroup(SoDeviceContextSharedGroup sharedGroup)
Explicitly change the sharedGroup.
-
getSharedId
public int getSharedId()
Returns an id common to all compatible/shared contexts.
-
getSharedGroup
public SoDeviceContextSharedGroup getSharedGroup()
Returns the current shared group.
-
isSharable
public boolean isSharable()
Returns the sharable status of this context. By default, a context is sharable.
-
setSharedWith
public boolean setSharedWith(SoDeviceContext sourceCtx)
Share this context.
-
isValid
public boolean isValid()
Returns true if this context is valid.- Returns:
- true if the context is valid.
-
-