API Migration
Major Changes#
- Callback System Changes.
- Added new PropertyParameter class.
- Added new SplinePoint class.
- Added new SplineSegment class.
Callback System Changes#
All callbacks were brought to a common stardard, and now API of some abstract callback looks as follows (For C# replace void* with System.IntPtr):
- void *addSomeCallback(Callback *func);
Registers a new handler without checking if it already exists in the list (so, you can subscribe two or more times). Returns callback ID, to be used later to unsubscribe. - bool removeSomeCallback(void *id);
Removes a handler registered earlier and returns true. Will return false if there's no hadler with the specified ID. - void clearSomeCallbacks();
Removes all registered handlers.
New callbacks API is thread-safe, i.e., add, remove and clear can be called from different threads, even simultaneously. Moreover, callback functions are now reentrant, this means that you can call add, remove, or clear right from a callback handler. For example, if we need a callback handler to be executed only for the very first click, we can use the following:
// add a CLICKED callback
widget->addCallback(Gui::CLICKED, MakeCallback(&trigger_once));
// ...
void trigger_once(WidgetPtr sender)
{
Log::message("button clicked\n");
// clear all CLICKED callbacks
sender->clearCallbacks(Gui::CLICKED);
}
clear and remove called from a handler will be executed immediately, so all other handlers, that were removed by this "transaction" (if any), will not be executed at all. The result of calling add inside a handler shall be applied in the beginning of the next "transaction": i.e. if inside a CLICK event handler we add a new one, it will be executed only for the next CLICK event.
You can check the way it works in the following sample: engine/samples/Api/Widgets/WidgetCallbacks
The complete list of changes for each of affected classes is given below.
AsyncQueue Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase2<const char *, int> *func)
- bool removeCallback(int callback, void *id)
Deprecated functions (to be removed in the next SDK release):
- void *addCallback(int callback, Unigine::CallbackBase2<const char *, int> *func)
- void removeCallback(int callback, int num)
Body Class Callbacks#
New functions:
- void *addFrozenCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
- bool removeFrozenCallback(void *id)
- void clearFrozenCallbacks()
- void *addPositionCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
- bool removePositionCallback(void *id)
- void clearPositionCallbacks()
- void *addContactCallback(Unigine::CallbackBase2< Ptr<Body>, int > *func)
- bool removeContactCallback(void *id)
- void clearContactCallbacks()
Deprecated functions (to be removed in the next SDK release):
- void setContactCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
- void setFrozenCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
- void setPositionCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
Console Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase2<const char *, int> *func)
- bool removeCallback(void *id)
- void clearLeaveCallbacks()
Deprecated functions (to be removed in the next SDK release):
- void setOutputCallback(Unigine::CallbackBase2<const char *, int> *func)
Joint Class Callbacks#
New functions:
- void *addBrokenCallback(Unigine::CallbackBase1< Ptr<Joint> > *func)
- bool removeBrokenCallback(void *id)
- void clearBrokenCallbacks()
Deprecated functions (to be removed in the next SDK release):
- void setBrokenCallback(Unigine::CallbackBase1< Ptr<Joint> > *func)
Node Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase2< Ptr<Node>, Ptr<Property> > *func)
- void *addCallback(int callback, Unigine::CallbackBase3< Ptr<Node>, Ptr<Property>, int > *func)
- void *addCallback(int callback, Unigine::CallbackBase3< Ptr<Node>, int, int > *func)
- bool removeCallback(int callback, void *id)
- void clearCallbacks(int callback)
Deprecated functions (to be removed in the next SDK release):
- void *addCallback(int callback, Unigine::CallbackBase *func)
- void removeCallback(int callback, void *func)
- void clearCallbacks(int callback)
NodeTrigger Class Callbacks#
New functions:
- void *addEnabledCallback(Unigine::CallbackBase1< Ptr<NodeTrigger> > *func)
- bool removeEnabledCallback(void *id)
- void clearEnabledCallbacks()
- void *addPositionCallback(Unigine::CallbackBase1< Ptr<NodeTrigger> > *func)
- bool removePositionCallback(void *id)
- void clearPositionCallbacks()
Deprecated functions (to be removed in the next SDK release):
- void setEnabledCallback(Unigine::CallbackBase1< Ptr<NodeTrigger> > *func)
- void setPositionCallback(Unigine::CallbackBase1< Ptr<NodeTrigger> > *func)
PhysicalTrigger Class Callbacks#
New functions:
- void *addEnterCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
- bool removeEnterCallback(void *id)
- void clearEnterCallbacks()
- void *addLeaveCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
- bool removeLeaveCallback(void *id)
- void clearLeaveCallbacks()
Deprecated functions (to be removed in the next SDK release):
- void setEnterCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
- void setLeaveCallback(Unigine::CallbackBase1< Ptr<Body> > *func)
Property Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase1< Ptr<Property> > *func)
- void *addCallback(int callback, Unigine::CallbackBase2< Ptr<Property>, int > *func)
- bool removeCallback(int callback, void *id)
- void clearCallbacks(int callback)
Deprecated functions (to be removed in the next SDK release):
- void *addCallback(int callback, Unigine::CallbackBase *func)
- void removeCallback(int callback, void *func)
- void clearCallbacks(int callback)
Properties Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase1< Ptr<Property> > *func)
- bool removeCallback(int callback, void *id)
- void clearCallbacks(int callback)
Deprecated functions (to be removed in the next SDK release):
- void *addCallback(int callback, Unigine::CallbackBase *func)
- void removeCallback(int callback, void *func)
- void clearCallbacks(int callback)
Render Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase1< Ptr<Unigine::Renderer> > *func)
- bool removeCallback(int callback, void *id)
Deprecated functions (to be removed in the next SDK release):
- void *addCallback(int callback, Unigine::CallbackBase *func)
- void removeCallback(int callback, void *func)
UserInterface Class Callbacks#
New functions:
- void *addCallback(const char *name, int callback, Unigine::CallbackBase *func)
- void *addCallback(const char *name, int callback, Unigine::CallbackBase1< Ptr<Widget> > *func)
- void *addCallback(const char *name, int callback, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > *func)
- void *addCallback(const char *name, int callback, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > *func)
- bool removeCallback(const char *name, int callback, void *id)
- void clearCallbacks(const char *name, int callback)
Deprecated functions (to be removed in the next SDK release):
- void setCallback0(const char *name, int callback, Unigine::CallbackBase *func)
- void setCallback1(const char *name, int callback, Unigine::CallbackBase1< Ptr<Widget> > *func)
- void setCallback2(const char *name, int callback, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > *func)
- void setCallback3(const char *name, int callback, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > *func)
Viewport Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase1< Ptr<Unigine::Renderer> > *func)
- bool removeCallback(int callback, void *id)
Deprecated functions (to be removed in the next SDK release):
- void *addCallback(int callback, Unigine::CallbackBase *func)
- void removeCallback(int callback, void *func)
Widget Class Callbacks#
New functions:
- void *addCallback(int callback, Unigine::CallbackBase *func)
- void *addCallback(int callback, Unigine::CallbackBase1< Ptr<Widget> > *func)
- void *addCallback(int callback, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > *func)
- void *addCallback(int callback, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > *func)
- bool removeCallback(int callback, void *id)
- void clearCallbacks(int callback)
Deprecated functions (to be removed in the next SDK release):
- void setCallback0(int callback, Unigine::CallbackBase *func)
- void setCallback1(int callback, Unigine::CallbackBase1< Ptr<Widget> > *func)
- void setCallback2(int callback, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > *func)
- void setCallback3(int callback, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > *func)
WorldTrigger Class Callbacks#
New functions:
- void *addEnterCallback(Unigine::CallbackBase1< Ptr<Node> > *func)
- bool removeEnterCallback(void *id)
- void clearEnterCallbacks()
- void *addLeaveCallback(Unigine::CallbackBase1< Ptr<Node> > *func)
- bool removeLeaveCallback(void *id)
- void clearLeaveCallbacks()
Deprecated functions (to be removed in the next SDK release):
- void setEnterCallback(Unigine::CallbackBase1< Ptr<Node> > *func)
- void setLeaveCallback(Unigine::CallbackBase1< Ptr<Node> > *func)
Body Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
removeShape() | Set of arguments changed. |
removeShape() | Set of arguments changed. |
New Functions#
Engine Class#
FileSystem Class#
Light Class#
LightEnvironmentProbe Class#
Material Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
TEXTURE_SCATTERING_GROUND_LUT | Removed. |
clearShadersHash() | Removed. |
New Functions#
Node Class#
New Functions#
Object Class#
New Functions#
ObjectBillboards Class#
ObjectParticles Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
restoreStateParticles() | Removed. Use restoreStateSelf() instead. |
saveStateParticles() | Removed. Use saveStateSelf() instead. |
New Functions#
ObjectTerrain Class#
Profiler Class#
Property Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
restoreState() | Set of arguments changed. |
getNumParameters() | Deprecated. Use getParameterPtr instead. |
getParameterName() | Deprecated. Use getParameterPtr instead. |
getParameterType() | Deprecated. Use getParameterPtr instead. |
isParameterHidden() | Deprecated. Use getParameterPtr instead. |
isParameterInherited() | Deprecated. Use getParameterPtr instead. |
isParameterOverridden() | Deprecated. Use getParameterPtr instead. |
findParameter() | Deprecated. Use getParameterPtr instead. |
fetchParameter() | Deprecated. Use getParameterPtr instead. |
resetParameter() | Deprecated. Use getParameterPtr instead. |
getParameterTitle() | Deprecated. Use getParameterPtr instead. |
getParameterTooltip() | Deprecated. Use getParameterPtr instead. |
getParameterGroup() | Deprecated. Use getParameterPtr instead. |
getParameterFilter() | Deprecated. Use getParameterPtr instead. |
setParameter() | Deprecated. Use getParameterPtr instead. |
getParameter() | Deprecated. Use getParameterPtr instead. |
setParameterInt() | Deprecated. Use getParameterPtr instead. |
getParameterInt() | Deprecated. Use getParameterPtr instead. |
getParameterIntMinValue() | Deprecated. Use getParameterPtr instead. |
getParameterIntMaxValue() | Deprecated. Use getParameterPtr instead. |
setParameterFloat() | Deprecated. Use getParameterPtr instead. |
getParameterFloat() | Deprecated. Use getParameterPtr instead. |
getParameterFloatMinValue() | Deprecated. Use getParameterPtr instead. |
getParameterFloatMaxValue() | Deprecated. Use getParameterPtr instead. |
setParameterDouble() | Deprecated. Use getParameterPtr instead. |
getParameterDouble() | Deprecated. Use getParameterPtr instead. |
getParameterDoubleMinValue() | Deprecated. Use getParameterPtr instead. |
getParameterDoubleMaxValue() | Deprecated. Use getParameterPtr instead. |
hasParameterSliderMinValue() | Deprecated. Use getParameterPtr instead. |
hasParameterSliderMaxValue() | Deprecated. Use getParameterPtr instead. |
getParameterSliderLog10() | Deprecated. Use getParameterPtr instead. |
getParameterSliderMinExpand() | Deprecated. Use getParameterPtr instead. |
getParameterSliderMaxExpand() | Deprecated. Use getParameterPtr instead. |
setParameterToggle() | Deprecated. Use getParameterPtr instead. |
getParameterToggle() | Deprecated. Use getParameterPtr instead. |
setParameterSwitch() | Deprecated. Use getParameterPtr instead. |
getParameterSwitch() | Deprecated. Use getParameterPtr instead. |
getParameterSwitchNumItems() | Deprecated. Use getParameterPtr instead. |
getParameterSwitchItem() | Deprecated. Use getParameterPtr instead. |
setParameterString() | Deprecated. Use getParameterPtr instead. |
getParameterString() | Deprecated. Use getParameterPtr instead. |
setParameterColor() | Deprecated. Use getParameterPtr instead. |
getParameterColor() | Deprecated. Use getParameterPtr instead. |
setParameterVec3() | Deprecated. Use getParameterPtr instead. |
getParameterVec3() | Deprecated. Use getParameterPtr instead. |
setParameterVec4() | Deprecated. Use getParameterPtr instead. |
getParameterVec4() | Deprecated. Use getParameterPtr instead. |
setParameterMask() | Deprecated. Use getParameterPtr instead. |
getParameterMask() | Deprecated. Use getParameterPtr instead. |
setParameterFile() | Deprecated. Use getParameterPtr instead. |
getParameterFile() | Deprecated. Use getParameterPtr instead. |
getParameterFileIsAsset() | Deprecated. Use getParameterPtr instead. |
getParameterFileIsRuntime() | Deprecated. Use getParameterPtr instead. |
getParameterFileIsAbsPath() | Deprecated. Use getParameterPtr instead. |
isParameterFileExist() | Deprecated. Use getParameterPtr instead. |
setParameterProperty() | Deprecated. Use getParameterPtr instead. |
getParameterProperty() | Deprecated. Use getParameterPtr instead. |
setParameterMaterial() | Deprecated. Use getParameterPtr instead. |
getParameterMaterial() | Deprecated. Use getParameterPtr instead. |
setParameterGUID() | Deprecated. Use getParameterPtr instead. |
getParameterGUID() | Deprecated. Use getParameterPtr instead. |
setParameterNode() | Deprecated. Use getParameterPtr instead. |
getParameterNode() | Deprecated. Use getParameterPtr instead. |
setParameterNodeID() | Deprecated. Use getParameterPtr instead. |
getParameterNodeID() | Deprecated. Use getParameterPtr instead. |
New Functions#
Render Class#
New Functions#
- setGbufferLightmap()
- isGbufferLightmap()
- setMotionBlurCameraVelocity()
- isMotionBlurCameraVelocity()
- setSSDirt()
- isSSDirt()
- setSSDirtAngleBias()
- getSSDirtAngleBias()
- setSSDirtConvexityAlbedoTextureName()
- getSSDirtConvexityAlbedoTextureName()
- setSSDirtConvexityColor()
- getSSDirtConvexityColor()
- setSSDirtConvexityExponent()
- getSSDirtConvexityExponent()
- setSSDirtConvexityMetalness()
- getSSDirtConvexityMetalness()
- setSSDirtConvexityMetalnessVisibility()
- getSSDirtConvexityMetalnessVisibility()
- setSSDirtConvexityShadingTextureName()
- getSSDirtConvexityShadingTextureName()
- setSSDirtConvexityTextureSize()
- getSSDirtConvexityTextureSize()
- setSSDirtCavityAlbedoTextureName()
- getSSDirtCavityAlbedoTextureName()
- setSSDirtCavityColor()
- getSSDirtCavityColor()
- setSSDirtCavityExponent()
- getSSDirtCavityExponent()
- setSSDirtCavityMetalness()
- getSSDirtCavityMetalness()
- setSSDirtCavityMetalnessVisibility()
- getSSDirtCavityMetalnessVisibility()
- setSSDirtCavityShadingTextureName()
- getSSDirtCavityShadingTextureName()
- setSSDirtCavityTextureSize()
- getSSDirtCavityTextureSize()
- setSSDirtIncreaseAccuracy()
- isSSDirtIncreaseAccuracy()
- setSSDirtIntensity()
- getSSDirtIntensity()
- setSSDirtPerspective()
- getSSDirtPerspective()
- setSSDirtQuality()
- getSSDirtQuality()
- setSSDirtRadius()
- getSSDirtRadius()
- setSSDirtResolution()
- getSSDirtResolution()
- setSSDirtThreshold()
- getSSDirtThreshold()
- setStereoHiddenArea()
- getStereoHiddenArea()
- setStereoHiddenAreaTransform()
- getStereoHiddenAreaTransform()
- setStereoReprojection()
- getStereoReprojection()
- setStereoReprojectionBuffersFixBlur()
- isStereoReprojectionBuffersFixBlur()
- setStereoReprojectionFixBlur()
- isStereoReprojectionFixBlur()
- setStereoReprojectionThreshold()
- getStereoReprojectionThreshold()
- setTAAAntialiasingInMotion()
- isTAAAntialiasingInMotion()
- setWhiteBalance()
- isWhiteBalance()
- setWhiteBalanceAdaptationTime()
- getWhiteBalanceAdaptationTime()
- setWhiteBalanceIntensity()
- getWhiteBalanceIntensity()
- CALLBACK_BEGIN_ADAPTATION_COLOR
- CALLBACK_END_ADAPTATION_COLOR
- CALLBACK_BEGIN_ADAPTATION_COLOR_AVERAGE
- CALLBACK_END_ADAPTATION_COLOR_AVERAGE
- CALLBACK_BEGIN_CURVATURE
- CALLBACK_END_CURVATURE
- CALLBACK_BEGIN_CURVATURE_COMPOSITE
- CALLBACK_END_CURVATURE_COMPOSITE
RenderEnvironmentPreset Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
setScatteringGroundColor() | Removed. |
getScatteringGroundColor() | Removed. |
setScatteringGroundLUTName() | Removed. |
getScatteringGroundLUTName() | Removed. |
Renderer Class#
New Functions#
Socket Class#
Sound Class#
SoundSource Class#
SplineGraph Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
calcSegmentPoint() | Type of arguments changed. |
setSegmentEndPoint() | Type of arguments changed. |
getSegmentEndPoint() | Type of arguments changed. |
setSegmentStartPoint() | Type of arguments changed. |
getSegmentStartPoint() | Type of arguments changed. |
setPoint() | Type of arguments changed. |
getPoint() | Type of arguments changed. |
addPoint() | Type of arguments changed. |
String Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
isalpha() | Set of arguments changed. |
isdigit() | Set of arguments changed. |
islower() | Set of arguments changed. |
isspace() | Set of arguments changed. |
isupper() | Set of arguments changed. |
do_memcpy() | Removed. |
WorldSplineGraph Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
getNumSourceNodes() | Removed. |
getNumSegmentNodes() | Set of arguments changed. |
getNumSegments() | Removed. Use getNumSplineSegments() instead. |
getNumPoints() | Removed. Use getNumSplinePoints() instead. |
calcSegmentPoint() | Removed. Use SplineSegment::calcPoint() instead. |
calcSegmentTangent() | Removed. Use SplineSegment::calcTangent() instead. |
calcSegmentUpVector() | Removed. Use SplineSegment::calcUpVector() instead. |
getLength() | Removed. Use SplineSegment::getLength() instead. |
setPoint() | Removed. |
getPoint() | Removed. |
addPoint() | Removed. Use createSplinePoint() instead. |
removePoint() | Removed. Use removeSplinePoint() instead. |
splitPoint() | Removed. |
weldPoints() | Removed. |
insertPointToSegment() | Removed. |
getPointSegmentsIndices() | Removed. Use SplinePoint::getSplineSegments() instead. |
addSegment() | Removed. Use createSplineSegment() instead. |
removeSegment() | Removed. Use removeSplineSegment() instead. |
setSegmentEndPoint() | Removed. Use SplineSegment::setEndPoint() instead. |
getSegmentEndPoint() | Removed. Use SplineSegment::getEndPoint() instead. |
getSegmentEndPointIndex() | Removed. |
setSegmentEndTangent() | Removed. Use SplineSegment::setEndTangent() instead. |
getSegmentEndTangent() | Removed. Use SplineSegment::getEndTangent() instead. |
setSegmentEndUpVector() | Removed. Use SplineSegment::setEndUp() instead. |
getSegmentEndUpVector() | Removed. Use SplineSegment::getEndUp() instead. |
getSegmentMode() | Removed. Use SplineSegment::getSegmentMode() instead. |
getSegmentNodes() | Removed. |
getSegmentSourceIndex() | Removed. |
setSegmentStartPoint() | Removed. Use SplineSegment::setStartPoint() instead. |
getSegmentStartPoint() | Removed. Use SplineSegment::getStartPoint() instead. |
getSegmentStartPointIndex() | Removed. |
setSegmentStartTangent() | Removed. Use SplineSegment::setStartTangent() instead. |
getSegmentStartTangent() | Removed. Use SplineSegment::getStartTangent() instead. |
setSegmentStartUpVector() | Removed. Use SplineSegment::setStartUp() instead. |
getSegmentStartUpVector() | Removed. Use SplineSegment::getStartUp() instead. |
assignSegmentSource() | Removed. Use SplineSegment::assignSource() or SplinePoint::assignSource() instead. |
clearSegmentSource() | Removed. Use SplineSegment::clearSources() or SplinePoint::clearSources() instead. |
addSourceNode() | Removed. |
removeSourceNode() | Removed. Use SplineSegment::removeSource() or SplinePoint::removeSource() instead. |
setSourceForwardAxis() | Removed. |
getSourceForwardAxis() | Removed. |
getSourceNodeName() | Removed. |
setSplineGraph() | Removed. |
getSplineGraph() | Removed. |
getNodeSegmentIndex() | Removed. |
getNodeSegmentTileIndex() | Removed. |
getNodeSourceIndex() | Removed. |
New Functions#
- getNumSegmentNodes()
- getSegmentNodeMesh()
- createSplinePoint()
- removeSplinePoint()
- getNumSplinePoints()
- getSplinePoints()
- createSplineSegment()
- removeSplineSegment()
- getNumSplineSegments()
- getSplineSegments()
- rebuild()
- addPointAddedCallback()
- removePointAddedCallback()
- clearPointAddedCallbacks_void()
- addPointChangedCallback()
- removePointChangedCallback()
- clearPointChangedCallbacks()
- addPointRemovedCallback()
- removePointRemovedCallback()
- clearPointRemovedCallbacks()
- addSegmentAddedCallback()
- removeSegmentAddedCallback()
- clearSegmentAddedCallbacks()
- addSegmentChangedCallback()
- removeSegmentChangedCallback()
- clearSegmentChangedCallbacks()
- addSegmentRemovedCallback()
- removeSegmentRemovedCallback()
- clearSegmentRemovedCallbacks()
Variable Class#
Viewport Class#
Widget Class#
UNIGINE 2.7.2 | UNIGINE 2.7.3 |
---|---|
isCallback() | Return value changed. |
getCallbackAccel() | Return value changed. |