This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

API Migration

Major Changes#

Breaking Changes#

Callbacks to Events#

We have reworked the core mechanism of tracking various events everywhere across the Engine, as the callbacks-based system used up to this release had a number of issues and weak points, including:

  • Crashes when subscribing with a class member function in case the subscribed object was deleted (a frequent case as users often forget to unsubscribe).
  • Users had to keep and track all signals and handlers to manually unsubscribe properly.
  • Signal signature unclear from API, without type checking, making it possible to subscribe with virtually any signature, then compile successfully (even with some mistakes), and get invalid data at runtime. No compiler notifications in case of any API changes, again resulting in getting invalid data at runtime.
  • Calls to MakeCallback() and typecasting for lambda expressions were required in order to use addCallback() functions.

Introducing the new Event System to replace old callbacks with improved reliability and flexibility, bringing you the following features:

  • New Events have strict type checking for function signatures. It is now clearly seen how many arguments and which exactly a callback (event handler) function requires.
  • Compile-time checking determines whether argument types match event types or not.
  • Simpler subscription to events with lambda functions. There is no need to perform internal type conversions.
  • The new EventConnection handler does not require to unsubscrube manually. It automatically breaks any connection in the destructor.
  • More flexibility: you can temporarily disable certain events to perform certain actions without triggering them, as well as you can toggle on and off just a particular connection (EventConnection).
  • Batch management: a set of different subscriptions can be linked to a single EventConnections instance, enabling you to unsubscribe from all of them in a single function call.

The new Event System will require manual migration. But, there's nothing to worry about as the entire process involves locating all instances of addCallback in your code and replacing them with the new approach according to the instructions given below. For a medium-sized project this can be completed by one developer in a few days.

Migration Instructions#

  1. Replace all "addCallback()" subscriptions with calls of the connect() method for the corresponding events. Remove calls of MakeCallback() from subscriptions, they are no longer needed. You can also replace callback IDs according to the following pattern:
    2.17
    Source code (C++)
    void *callback_id = ...
    2.18
    Source code (C++)
    EventConnectionId callback_id = ...
    There is a set of regular expressions that can be used to speed up the process.
  2. Replace all "removeCallback()" unsubscriptions with calls of the disconnect() method for the corresponding events (you can simply leave callback ids, if you replaced them as suggested in the previous step)
    2.17
    Source code (C++)
    Render::removeCallback(Render::CALLBACK_BEGIN_AUXILIARY_BUFFER, callback_id);
    2.18
    Source code (C++)
    Render::getEventBeginAuxiliaryBuffer().disconnect(callback_id);
    There is a set of regular expressions that can be used to speed up the process.
  3. Remove all "clearCallbacks()" methods, use EventConnections pattern with a call to disconnectAll() for such cases:
    2.17
    Source code (C#)
    // add the first Reparented callback handler 
    property->addCallback(Property::CALLBACK_REPARENTED, event_handler);
    
    // add another Reparented callback handler
    property->addCallback(Property::CALLBACK_REPARENTED, MakeCallback([](PropertyPtr property) { 
    			Log::message("Reparented Handler\n");
    		}));
    
    // ...
    
    // remove all added Reparented callbacks
    property->clearCallbacks(Property::CALLBACK_REPARENTED);
    2.18
    Source code (C++)
    // create an instance of the EventConnections class
    EventConnections conns;
    
    // subscribe for the Reparented event with the first handler linking to the EventConnections instance
    property->getEventReparented().connect(conns, event_handler);
    
    // subscribe for the Reparented event with the first handler linking to the EventConnections instance
    property->getEventReparented().connect(conns, [](const PropertyPtr & property) { 
    		Log::message("\Handling Reparented event (lambda).\n");
    	}
    );
    
    // ...
    
    // remove all subscriptions linked to the EventConnections instance
    conns.disconnectAll();
  4. Replace all complex-type arguments in callback signatures to const ptr&
    2.17
    Source code (C++)
    (BodyPtr b)
    2.18
    Source code (C++)
    (const BodyPtr &b)
  5. In case you used the setCallbackEnabled() method to temporarily disable firing of certain callbacks (e.g., for widgets), you can replace it by calling the setEnabled() method for the corresponding events:
    2.17
    Source code (C++)
    widget->setCallbackEnabled(Gui::CHANGED, 1);
    2.18
    Source code (C++)
    widget->getEventChanged().setEnabled(true);
    There is a set of regular expressions that can be used to speed up the process.

Useful Reqular Expressions#

The set of regular expressions listed below might come in handy to save your time on upgrading your code:

1. Adding callbacks, both static and non-static, including the ones constructed using lambda expressions.
Find:
Output
([\S]*?)(::|->)addCallback\([\S]*?::(?:CALLBACK_|)([A-Z])([A-Z]*)(?:_([A-Z])([A-Z]*)){0,1}(?:_([A-Z])([A-Z]*)){0,1}(?:_([A-Z])([A-Z]*)){0,1}\s*?,\s*?MakeCallback\(([\S\s:&]*?)\)\)
Replace:
Output
$1$2getEvent$3\L$4\E$5\L$6\E$7\L$8\E$9\L$10\(\).connect\(\E$11\)
Examples:
Source code (C++)
widget_button->addCallback(Gui::CLICKED, MakeCallback(this, &AppWorldLogic::onButtonClicked));

viewport->addCallback(Render::CALLBACK_END_OPACITY_GBUFFER, MakeCallback(gbuffers_ready_callback));

Properties::addCallback(Properties::CALLBACK_REMOVED, MakeCallback([](BodyPtr b){
			b->renderInternalContacts(); 
			
			
			
			//...
		}));

AsyncQueue::addCallback(AsyncQueue::CALLBACK_IMAGE_LOADED, MakeCallback(this, &AsyncSample::image_loaded));

void *callback_id = Render::addCallback(Render::CALLBACK_BEGIN_AUXILIARY_BUFFER, MakeCallback([](BodyPtr b) {b->renderInternalContacts(); }));
2. Adding named callbacks, including the ones constructed using lambda expressions.
Find:
Output
([\S]*?)->add([A-Za-z]+)Callback\(MakeCallback\(([\S\s:&]*?)\)\)
Replace:
Output
$1->getEvent$2\(\).connect\($3\)
Examples:
Source code (C++)
trigger->addEnterCallback(MakeCallback(this, &AppWorldLogic::enter_callback));

trigger->addLeaveCallback(MakeCallback(leave_callback));

joint->addBrokenCallback(MakeCallback([](JointPtr j) {j->getBody0()->getObject()->setMaterialPath("some.mat", "*"); }));

body->addContactsCallback(MakeCallback([](BodyPtr b){
	b->renderInternalContacts(); 
	
	
	//...
}));
3. Removing callbacks.
Find:
Output
([\S]*?)(::|->)removeCallback\([\S]*?::(?:CALLBACK_|)([A-Z])([A-Z]*)(?:_([A-Z])([A-Z]*)){0,1}(?:_([A-Z])([A-Z]*)){0,1}(?:_([A-Z])([A-Z]*)){0,1}\s*?,\s*?([\S]*?)\s*?\)
Replace:
Output
$1$2getEvent$3\L$4\E$5\L$6\E$7\L$8\E$9\L$10\(\).disconnect\(\E$11\)
Examples:
Source code (C++)
Render::removeCallback(Render::CALLBACK_BEGIN_AUXILIARY_BUFFER, callback_id);

widget->removeCallback(Gui::CLICKED, callback_id);
4. Disabling callbacks.
Find:
Output
([\S]*?)->setCallbackEnabled\([\S]*?::(?:CALLBACK_|)([A-Z])([A-Z]*)(?:_([A-Z])([A-Z]*)){0,1}(?:_([A-Z])([A-Z]*)){0,1}(?:_([A-Z])([A-Z]*)){0,1}\s*?,\s*?([\S]*?)\s*?\)
Replace:
Output
$1->getEvent$2\L$3\E$4\L$5\E$6\L$7\E$8\L$9\(\).\EsetEnabled\(\E$10\)
Examples:
Source code (C++)
widget->setCallbackEnabled(Gui::CHANGED, 1);

DeleteForce/DeleteLater Ambiguity#

To solve the ambiguity with calling the deleteLater/deleteForce methods in C++ we have removed these methods from the APIInterface class. The proper way is to call these methods via '.' :

Source code (C++)
NodePtr node;

node.deleteLater();
node.deleteForce();

AsyncQueue Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( CALLBACK_INDEX, Unigine::CallbackBase2< const char *, int > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_FILE_LOADED -> getEventFileLoaded()
- CALLBACK_IMAGE_LOADED -> getEventImageLoaded()
- CALLBACK_MESH_LOADED -> getEventMeshLoaded()
- CALLBACK_NODE_LOADED -> getEventNodeLoaded()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = asyncqueue->add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = asyncqueue->add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
asyncqueue->remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
asyncqueue->clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = asyncqueue->getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = asyncqueue->getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
asyncqueue->getEvent<CB_NAME>.disconnect(handler_id);

See Also:

Body Class#

UNIGINE 2.17 UNIGINE 2.18
addFrozenCallback( Unigine::CallbackBase1< Ptr<Body> > * ) Removed. Use getEventFrozen().connect() call instead (see migration details).
setFrozenCallback( int ) Removed.
removeFrozenCallback( void * ) Removed. Use getEventFrozen().disconnect() call instead (see migration details).
clearFrozenCallbacks( ) Removed for safety reasons (see migration details).
addPositionCallback( Unigine::CallbackBase1< Ptr<Body> > * ) Removed. Use getEventPosition().connect() call instead (see migration details).
setPositionCallback( int ) Removed.
removePositionCallback( void * ) Removed. Use getEventPosition().disconnect() call instead (see migration details).
clearPositionCallbacks( ) Removed for safety reasons (see migration details).
addContactsCallback( Unigine::CallbackBase1< Ptr<Body> > * ) Removed. Use getEventContacts().connect() call instead (see migration details).
setContactsCallback( int ) Removed.
removeContactsCallback( void * ) Removed. Use getEventContacts().disconnect() call instead (see migration details).
clearContactsCallbacks( ) Removed for safety reasons (see migration details).
addContactEnterCallback( Unigine::CallbackBase2< Ptr<Body>, int> * ) Removed. Use getEventContactEnter().connect() call instead (see migration details).
setContactEnterCallback( int ) Removed.
removeContactEnterCallback( void * ) Removed. Use getEventContactEnter().disconnect() call instead (see migration details).
clearContactEnterCallbacks( ) Removed for safety reasons (see migration details).
addContactLeaveCallback( Unigine::CallbackBase2< Ptr<Body>, int> * ) Removed. Use getEventContactLeave().connect() call instead (see migration details).
setContactLeaveCallback( int ) Removed.
removeContactLeaveCallback( void * ) Removed. Use getEventContactLeave().disconnect() call instead (see migration details).
clearContactLeaveCallbacks( ) Removed for safety reasons (see migration details).

BoundBox Class#

Console Class#

UNIGINE 2.17 UNIGINE 2.18
addOutputCallback( Unigine::CallbackBase2< const char *, int > * ) Removed. Use getEventOutput().connect() call instead (see migration details).
removeOutputCallback( void * ) Removed. Use getEventOutput().disconnect() call instead (see migration details).
clearOutputCallbacks( ) Removed for safety reasons (see migration details).

Curve2d Class#

UNIGINE 2.17 UNIGINE 2.18
addChangedCallback( Unigine::CallbackBase * ) Removed. Use getEventChanged().connect() call instead (see migration details).
removeChangedCallback( void * ) Removed. Use getEventChanged().disconnect() call instead (see migration details).
clearChangedCallbacks( ) Removed for safety reasons (see migration details).

Engine Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( Engine::CALLBACK_INDEX, CallbackBase * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( Engine::CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( Engine::CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_BEGIN_UPDATE -> getEventBeginUpdate()
- CALLBACK_BEGIN_PROPERTIES_UPDATE -> getEventBeginPropertiesUpdate()
- CALLBACK_END_PROPERTIES_UPDATE -> getEventEndPropertiesUpdate()
- CALLBACK_BEGIN_INPUT_UPDATE -> getEventBeginInputUpdate()
- CALLBACK_END_INPUT_UPDATE -> getEventEndInputUpdate()
- CALLBACK_BEGIN_CONTROLS_UPDATE -> getEventBeginControlsUpdate()
- CALLBACK_END_CONTROLS_UPDATE -> getEventEndControlsUpdate()
- CALLBACK_BEGIN_WORLD_MANAGER_UPDATE -> getEventBeginWorldManagerUpdate()
- CALLBACK_END_WORLD_MANAGER_UPDATE -> getEventEndWorldManagerUpdate()
- CALLBACK_BEGIN_SOUND_MANAGER_UPDATE -> getEventBeginSoundManagerUpdate()
- CALLBACK_END_SOUND_MANAGER_UPDATE -> getEventEndSoundManagerUpdate()
- CALLBACK_BEGIN_GAME_UPDATE -> getEventBeginGameUpdate()
- CALLBACK_END_GAME_UPDATE -> getEventEndGameUpdate()
- CALLBACK_BEGIN_RENDER_UPDATE -> getEventBeginRenderUpdate()
- CALLBACK_END_RENDER_UPDATE -> getEventEndRenderUpdate()
- CALLBACK_BEGIN_EXPRESSION_UPDATE -> getEventBeginExpressionUpdate()
- CALLBACK_END_EXPRESSION_UPDATE -> getEventEndExpressionUpdate()
- CALLBACK_BEGIN_SOUNDS_UPDATE -> getEventBeginSoundsUpdate()
- CALLBACK_END_SOUNDS_UPDATE -> getEventEndSoundsUpdate()
- CALLBACK_BEGIN_PLUGINS_UPDATE -> getEventBeginPluginsUpdate()
- CALLBACK_END_PLUGINS_UPDATE -> getEventEndPluginsUpdate()
- CALLBACK_BEGIN_EDITOR_UPDATE -> getEventBeginEditorUpdate()
- CALLBACK_END_EDITOR_UPDATE -> getEventEndEditorUpdate()
- CALLBACK_BEGIN_SYSTEM_SCRIPT_UPDATE -> getEventBeginSystemScriptUpdate()
- CALLBACK_END_SYSTEM_SCRIPT_UPDATE -> getEventEndSystemScriptUpdate()
- CALLBACK_BEGIN_SYSTEM_LOGIC_UPDATE -> getEventBeginSystemLogicUpdate()
- CALLBACK_END_SYSTEM_LOGIC_UPDATE -> getEventEndSystemLogicUpdate()
- CALLBACK_BEGIN_WORLD_UPDATE -> getEventBeginWorldUpdate()
- CALLBACK_END_WORLD_UPDATE -> getEventEndWorldUpdate()
- CALLBACK_BEGIN_WORLD_POST_UPDATE -> getEventBeginWorldPostUpdate()
- CALLBACK_END_WORLD_POST_UPDATE -> getEventEndWorldPostUpdate()
- CALLBACK_BEGIN_SYSTEM_SCRIPT_POST_UPDATE -> getEventBeginSystemScriptPostUpdate()
- CALLBACK_END_SYSTEM_SCRIPT_POST_UPDATE -> getEventEndSystemScriptPostUpdate()
- CALLBACK_BEGIN_SYSTEM_LOGIC_POST_UPDATE -> getEventBeginSystemLogicPostUpdate()
- CALLBACK_END_SYSTEM_LOGIC_POST_UPDATE -> getEventEndSystemLogicPostUpdate()
- CALLBACK_BEGIN_EDITOR_POST_UPDATE -> getEventBeginEditorPostUpdate()
- CALLBACK_END_EDITOR_POST_UPDATE -> getEventEndEditorPostUpdate()
- CALLBACK_BEGIN_PLUGINS_POST_UPDATE -> getEventBeginPluginsPostUpdate()
- CALLBACK_END_PLUGINS_POST_UPDATE -> getEventEndPluginsPostUpdate()
- CALLBACK_BEGIN_SPATIAL_UPDATE -> getEventBeginSpatialUpdate()
- CALLBACK_END_SPATIAL_UPDATE -> getEventEndSpatialUpdate()
- CALLBACK_BEGIN_FILESYSTEM_UPDATE -> getEventBeginFilesystemUpdate()
- CALLBACK_END_FILESYSTEM_UPDATE -> getEventEndFilesystemUpdate()
- CALLBACK_BEGIN_PATHFINDING -> getEventBeginPathfinding()
- CALLBACK_END_UPDATE -> getEventEndUpdate()
- CALLBACK_BEGIN_RENDER -> getEventBeginRender()
- CALLBACK_BEGIN_EDITOR_RENDER -> getEventBeginEditorRender()
- CALLBACK_END_EDITOR_RENDER -> getEventEndEditorRender()
- CALLBACK_BEGIN_PLUGINS_RENDER -> getEventBeginPluginsRender()
- CALLBACK_END_PLUGINS_RENDER -> getEventEndPluginsRender()
- CALLBACK_BEGIN_RENDER_WORLD -> getEventBeginRenderWorld()
- CALLBACK_END_RENDER_WORLD -> getEventEndRenderWorld()
- CALLBACK_BEGIN_PLUGINS_GUI -> getEventBeginPluginsGui()
- CALLBACK_END_PLUGINS_GUI -> getEventEndPluginsGui()
- CALLBACK_BEGIN_POST_RENDER -> getEventBeginPostRender()
- CALLBACK_END_POST_RENDER -> getEventEndPostRender()
- CALLBACK_END_RENDER -> getEventEndRender()
- CALLBACK_BEGIN_SWAP -> getEventBeginSwap()
- CALLBACK_END_PATHFINDING -> getEventEndPathfinding()
- CALLBACK_BEGIN_WORLD_SWAP -> getEventBeginWorldSwap()
- CALLBACK_END_WORLD_SWAP -> getEventEndWorldSwap()
- CALLBACK_BEGIN_PLUGINS_SWAP -> getEventBeginPluginsSwap()
- CALLBACK_END_PLUGINS_SWAP -> getEventEndPluginsSwap()
- CALLBACK_BEGIN_DELETE_OBJECTS -> getEventBeginDeleteObjects()
- CALLBACK_END_DELETE_OBJECTS -> getEventEndDeleteObjects()
- CALLBACK_END_SWAP -> getEventEndSwap()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = Engine::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = Engine::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
Engine::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
Engine::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = Engine::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = Engine::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
Engine::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

EngineWindow Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( CALLBACK_INDEX, Unigine::CallbackBase * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1<float > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< const char * > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< Math::ivec2 > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< Ptr <WindowEvent> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_WINDOW_EVENT -> getEventWindowEvent()
- CALLBACK_FUNC_UPDATE -> getEventFuncUpdate()
- CALLBACK_FUNC_BEGIN_RENDER -> getEventFuncBeginRender()
- CALLBACK_FUNC_RENDER -> getEventFuncRender()
- CALLBACK_FUNC_BEGIN_RENDER_GUI -> getEventFuncBeginRenderGui()
- CALLBACK_FUNC_END_RENDER_GUI -> getEventFuncEndRenderGui()
- CALLBACK_FUNC_END_RENDER -> getEventFuncEndRender()
- CALLBACK_FUNC_SWAP -> getEventFuncSwap()
- CALLBACK_MOVED -> getEventMoved()
- CALLBACK_RESIZED -> getEventResized()
- CALLBACK_FOCUSED -> getEventFocused()
- CALLBACK_UNFOCUSED -> getEventUnfocused()
- CALLBACK_MOUSE_ENTER -> getEventMouseEnter()
- CALLBACK_MOUSE_LEAVE -> getEventMouseLeave()
- CALLBACK_SHOWN -> getEventShown()
- CALLBACK_HIDDEN -> getEventHidden()
- CALLBACK_MINIMIZED -> getEventMinimized()
- CALLBACK_MAXIMIZED -> getEventMaximized()
- CALLBACK_RESTORED -> getEventRestored()
- CALLBACK_CLOSE -> getEventClose()
- CALLBACK_ITEM_DROP -> getEventItemDrop()
- CALLBACK_UNSTACK_MOVE -> getEventUnstackMove()
- CALLBACK_STACK -> getEventStack()
- CALLBACK_UNSTACK -> getEventUnstack()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = enginewindow->add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = enginewindow->add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
enginewindow->remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
enginewindow->clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = enginewindow->getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = enginewindow->getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
enginewindow->getEvent<CB_NAME>.disconnect(handler_id);

See Also:

CollisionVolume Class#

UNIGINE 2.17 UNIGINE 2.18
addCustomRenderCallback( Unigine::CallbackBase1< Ptr<EngineWindowViewport> > * ) Removed. Use getEventCustomRender().connect() call instead (see migration details).
removeCustomRenderCallback( void * ) Removed. Use getEventCustomRender().disconnect() call instead (see migration details).
clearCustomRenderCallbacks( ) Removed for safety reasons (see migration details).

FieldShoreline Class#

UNIGINE 2.17 UNIGINE 2.18
addProgressCallback( Unigine::CallbackBase * ) Removed. Use getEventProgress().connect() call instead (see migration details).
removeProgressCallback( void * ) Removed. Use getEventProgress().disconnect() call instead (see migration details).
clearProgressCallbacks( ) Removed for safety reasons (see migration details).

New Functions

FileSystem Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( int, Unigine::CallbackBase1< const Vector < FilePath > & > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( int, Unigine::CallbackBase2< const char *, UGUID > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( int, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( int ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_FILE_ADDED -> getEventFileAdded()
- CALLBACK_FILE_REMOVED -> getEventFileRemoved()
- CALLBACK_FILE_CHANGED -> getEventFileChanged()
- CALLBACK_FILES_ADDED -> getEventFilesAdded()
- CALLBACK_FILES_REMOVED -> getEventFilesRemoved()
- CALLBACK_FILES_CHANGED -> getEventFilesChanged()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = FileSystem::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = FileSystem::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
FileSystem::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
FileSystem::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = FileSystem::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = FileSystem::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
FileSystem::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

Gui Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.

New Functions

Image Class#

ImageConverter Class#

Input Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< Input::MOUSE_BUTTON > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase2< int, int > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< Input::KEY > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< unsigned int > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< Ptr <InputEvent> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase2< unsigned int, Input::GAMEPAD_BUTTON> * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase2< unsigned int, Input::GAMEPAD_AXIS> * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase2< unsigned int, int> * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_MOUSE_DOWN -> getEventMouseDown()
- CALLBACK_MOUSE_UP -> getEventMouseUp()
- CALLBACK_MOUSE_WHEEL -> getEventMouseWheel()
- CALLBACK_MOUSE_WHEEL_HORIZONTAL -> getEventMouseWheelHorizontal()
- CALLBACK_MOUSE_MOTION -> getEventMouseMotion()
- CALLBACK_KEY_DOWN -> getEventKeyDown()
- CALLBACK_KEY_UP -> getEventKeyUp()
- CALLBACK_KEY_REPEAT -> getEventKeyRepeat()
- CALLBACK_TEXT_PRESS -> getEventTextPress()
- CALLBACK_TOUCH_DOWN -> getEventTouchDown()
- CALLBACK_TOUCH_UP -> getEventTouchUp()
- CALLBACK_TOUCH_MOTION -> getEventTouchMotion()
- CALLBACK_GAMEPAD_CONNECTED -> getEventGamepadConnected()
- CALLBACK_GAMEPAD_DISCONNECTED -> getEventGamepadDisconnected()
- CALLBACK_GAMEPAD_BUTTON_DOWN -> getEventGamepadButtonDown()
- CALLBACK_GAMEPAD_BUTTON_UP -> getEventGamepadButtonUp()
- CALLBACK_GAMEPAD_AXIS_MOTION -> getEventGamepadAxisMotion()
- CALLBACK_GAMEPAD_TOUCH_DOWN -> getEventGamepadTouchDown()
- CALLBACK_GAMEPAD_TOUCH_UP -> getEventGamepadTouchUp()
- CALLBACK_GAMEPAD_TOUCH_MOTION -> getEventGamepadTouchMotion()
- CALLBACK_JOY_CONNECTED -> getEventJoyConnected()
- CALLBACK_JOY_DISCONNECTED -> getEventJoyDisconnected()
- CALLBACK_JOY_BUTTON_DOWN -> getEventJoyButtonDown()
- CALLBACK_JOY_BUTTON_UP -> getEventJoyButtonUp()
- CALLBACK_JOY_AXIS_MOTION -> getEventJoyAxisMotion()
- CALLBACK_JOY_POV_MOTION -> getEventJoyPovMotion()
- CALLBACK_IMMEDIATE_INPUT -> getEventImmediateInput()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = Input::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = Input::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
Input::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
Input::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = Input::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = Input::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
Input::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

New Functions

InputEvent Class#

Joint Class#

UNIGINE 2.17 UNIGINE 2.18
addBrokenCallback( Unigine::CallbackBase1< Ptr<Joint> > * ) Removed. Use getEventBroken().connect() call instead (see migration details).
removeBrokenCallback( void * ) Removed. Use getEventBroken().disconnect() call instead (see migration details).
clearBrokenCallbacks( ) Removed for safety reasons (see migration details).

Landscape Class#

UNIGINE 2.17 UNIGINE 2.18
addTextureDrawCallback( Unigine::CallbackBase5< UGUID, int, Ptr<LandscapeTextures>, Math::ivec2, int > * ) Removed. Use getEventTextureDraw().connect() call instead (see migration details).
removeTextureDrawCallback( void * ) Removed. Use getEventTextureDraw().disconnect() call instead (see migration details).
clearTextureDrawCallback( ) Removed for safety reasons (see migration details).
addApplyDiffCallback( Unigine::CallbackBase3< UGUID, int, const char* > * ) Removed. Use getEventApplyDiff().connect() call instead (see migration details).
removeApplyDiffCallback( void * ) Removed. Use getEventApplyDiff().disconnect() call instead (see migration details).
clearApplyDiffCallback( ) Removed for safety reasons (see migration details).
addSaveFileCallback( Unigine::CallbackBase4< UGUID, int, const char*, const char* > * ) Removed. Use getEventSaveFile().connect() call instead (see migration details).
removeSaveFileCallback( void * ) Removed. Use getEventSaveFile().disconnect() call instead (see migration details).
clearSaveFileCallback( ) Removed for safety reasons (see migration details).

LandscapeFetch Class#

UNIGINE 2.17 UNIGINE 2.18
addStartCallback( Unigine::CallbackBase * ) Removed. Use getEventStart().connect() call instead (see migration details).
removeStartCallback( void * ) Removed. Use getEventStart().disconnect() call instead (see migration details).
clearStartCallback( ) Removed for safety reasons (see migration details).
addEndCallback( Unigine::CallbackBase * ) Removed. Use getEventEnd().connect() call instead (see migration details).
removeEndCallback( void * ) Removed. Use getEventEnd().disconnect() call instead (see migration details).
clearEndCallback( ) Removed for safety reasons (see migration details).

LandscapeMapFileCreator Class#

UNIGINE 2.17 UNIGINE 2.18
addCreateCallback( Unigine::CallbackBase4< Ptr<LandscapeMapFileCreator>, Ptr<LandscapeImages>, int, int > * ) Removed. Use getEventCreate().connect() call instead (see migration details).
removeCreateCallback( void * ) Removed. Use getEventCreate().disconnect() call instead (see migration details).
clearCreateCallback( ) Removed for safety reasons (see migration details).
addProgressCallback( Unigine::CallbackBase1< Ptr<LandscapeMapFileCreator> > * ) Removed. Use getEventProgress().connect() call instead (see migration details).
removeProgressCallback( void * ) Removed. Use getEventProgress().disconnect() call instead (see migration details).
clearProgressCallback( ) Removed for safety reasons (see migration details).
addBeginCallback( Unigine::CallbackBase1< Ptr<LandscapeMapFileCreator> > * ) Removed. Use getEventBegin().connect() call instead (see migration details).
removeBeginCallback( void * ) Removed. Use getEventBegin().disconnect() call instead (see migration details).
clearBeginCallback( ) Removed for safety reasons (see migration details).
addEndCallback( Unigine::CallbackBase1< Ptr<LandscapeMapFileCreator> > * ) Removed. Use getEventEnd().connect() call instead (see migration details).
removeEndCallback( void * ) Removed. Use getEventEnd().disconnect() call instead (see migration details).
clearEndCallback( ) Removed for safety reasons (see migration details).

LightEnvironmentProbe Class#

UNIGINE 2.17 UNIGINE 2.18
setRaymarchingDiffuseReconstructionSamplesScreen( int ) Removed.
getRaymarchingDiffuseReconstructionSamplesScreen( ) Removed.
setRaymarchingDiffuseReconstructionSamplesCubemap( int ) Removed.
getRaymarchingDiffuseReconstructionSamplesCubemap( ) Removed.
setRaymarchingSpecularReconstructionSamplesScreen( int ) Removed.
getRaymarchingSpecularReconstructionSamplesScreen( ) Removed.
setRaymarchingSpecularReconstructionSamplesCubemap( int ) Removed.
getRaymarchingSpecularReconstructionSamplesCubemap( ) Removed.

New Functions

LightVoxelProbe Class#

UNIGINE 2.17 UNIGINE 2.18
setAdditiveBlending( bool ) Removed. Use setBlendMode( LightVoxelProbe::BLEND ) instead.
isAdditiveBlending( ) Removed. Use getBlendMode( ) instead.

New Functions

LightWorld Class#

LoadingScreen Class#

UNIGINE 2.17 UNIGINE 2.18
addRenderBeginCallback( Unigine::CallbackBase * ) Removed. Use getEventRenderBegin().connect() call instead (see migration details).
removeRenderBeginCallback( void * ) Removed. Use getEventRenderBegin().disconnect() call instead (see migration details).
clearRenderBeginCallbacks( ) Removed for safety reasons (see migration details).
addRenderEndCallback( Unigine::CallbackBase * ) Removed. Use getEventRenderEnd().connect() call instead (see migration details).
removeRenderEndCallback( void * ) Removed. Use getEventRenderEnd().disconnect() call instead (see migration details).
clearRenderEndCallbacks( ) Removed for safety reasons (see migration details).

Log Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( int, Unigine::CallbackBase * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( int, Unigine::CallbackBase2< const char *, UGUID > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( int, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( int ) Removed for safety reasons (see migration details).
hasCallback( int ) Removed.
Old Enum to New Event Mapping:
- CALLBACK_MESSAGE -> getEventMessage()
- CALLBACK_WARNING -> getEventWarning()
- CALLBACK_ERROR -> getEventError()
- CALLBACK_FATAL -> getEventFatal()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = Log::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = Log::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
Log::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
Log::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = Log::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = Log::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
Log::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

Material Class#

Materials Class#

UNIGINE 2.17 UNIGINE 2.18
Enum LOADING_MODE Removed.
setLoadingMode( Materials::LOADING_MODE ) Removed.
getLoadingMode( ) Removed.
compileShaders( const Vector< Ptr<Material> > & ) Removed.
addBeginReloadCallback( Unigine::CallbackBase * ) Removed. Use getEventBeginReload().connect() call instead (see migration details).
removeBeginReloadCallback( void * ) Removed. Use getEventBeginReload().disconnect() call instead (see migration details).
clearBeginReloadCallbacks( ) Removed for safety reasons (see migration details).
addEndReloadCallback( Unigine::CallbackBase * ) Removed. Use getEventEndReload().connect() call instead (see migration details).
removeEndReloadCallback( void * ) Removed. Use getEventEndReload().disconnect() call instead (see migration details).
clearEndReloadCallbacks( ) Removed for safety reasons (see migration details).

New Functions

Node Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( CALLBACK_INDEX, Unigine::CallbackBase2< Ptr<Node>, Ptr<Property> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase3< Ptr<Node>, Ptr<Property>, int > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase3< Ptr<Node>, int, int > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_PROPERTY_NODE_SLOTS_CHANGED -> getEventPropertyNodeSlotsChanged()
- CALLBACK_PROPERTY_NODE_ADD -> getEventPropertyNodeAdd()
- CALLBACK_PROPERTY_NODE_SWAP -> getEventPropertyNodeSwap()
- CALLBACK_PROPERTY_NODE_REMOVE -> getEventPropertyNodeRemove()
- CALLBACK_PROPERTY_CHANGE_ENABLED -> getEventPropertyChangeEnabled()
- CALLBACK_PROPERTY_SURFACE_ADD -> getEventPropertySurfaceAdd()
- CALLBACK_PROPERTY_SURFACE_REMOVE -> getEventPropertySurfaceRemove()
- CALLBACK_CACHE_NODE_ADD -> getEventCacheNodeAdd()
- CALLBACK_NODE_LOAD -> getEventNodeLoad()
- CALLBACK_NODE_CLONE -> getEventNodeClone()
- CALLBACK_NODE_SWAP -> getEventNodeSwap()
- CALLBACK_NODE_REMOVE -> getEventNodeRemove()
- CALLBACK_NODE_CHANGE_ENABLED -> getEventNodeChangeEnabled()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = node->add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = node->add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
node->remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
node->clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = node->getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = node->getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
node->getEvent<CB_NAME>.disconnect(handler_id);

See Also:

New Functions

NodeTrigger Class#

UNIGINE 2.17 UNIGINE 2.18
addEnabledCallback( Unigine::CallbackBase1< Ptr<NodeTrigger> > * ) Removed. Use getEventEnabled().connect() call instead (see migration details).
removeEnabledCallback( void * ) Removed. Use getEventEnabled().disconnect() call instead (see migration details).
clearEnabledCallbacks( ) Removed for safety reasons (see migration details).
setEnabledCallback( int ) Removed.
addPositionCallback( Unigine::CallbackBase1< Ptr<NodeTrigger> > * ) Removed. Use getEventPosition().connect() call instead (see migration details).
removePositionCallback( void * ) Removed. Use getEventPosition().disconnect() call instead (see migration details).
clearPositionCallbacks( ) Removed for safety reasons (see migration details).
setPositionCallback( int ) Removed.

ObjectMeshSkinned Class#

New Functions

PackageUng Class#

PhysicalTrigger Class#

UNIGINE 2.17 UNIGINE 2.18
addEnterCallback( Unigine::CallbackBase1< Ptr<Body> > * ) Removed. Use getEventEnter().connect() call instead (see migration details).
removeEnterCallback( void * ) Removed. Use getEventEnter().disconnect() call instead (see migration details).
clearEnterCallbacks( ) Removed for safety reasons (see migration details).
setEnterCallback( int ) Removed.
addLeaveCallback( Unigine::CallbackBase1< Ptr<Body> > * ) Removed. Use getEventLeave().connect() call instead (see migration details).
removeLeaveCallback( void * ) Removed. Use getEventLeave().disconnect() call instead (see migration details).
clearLeaveCallbacks( ) Removed for safety reasons (see migration details).
setLeaveCallback( int ) Removed.

Properties Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< Ptr<Property> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_CREATED -> getEventCreated()
- CALLBACK_MOVED -> getEventMoved()
- CALLBACK_RENAMED -> getEventRenamed()
- CALLBACK_REPARENTED -> getEventReparented()
- CALLBACK_REMOVED -> getEventRemoved()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = Properties::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = Properties::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
Properties::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
Properties::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = Properties::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = Properties::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
Properties::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

Property Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( CALLBACK_INDEX, Unigine::CallbackBase1< Ptr<Property> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACK_INDEX, Unigine::CallbackBase2< Ptr<Property>, int > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_RELOADED -> getEventReloaded()
- CALLBACK_MOVED -> getEventMoved()
- CALLBACK_RENAMED -> getEventRenamed()
- CALLBACK_REPARENTED -> getEventReparented()
- CALLBACK_PARAMETER_CHANGED -> getEventParameterChanged()
- CALLBACK_DESTROY -> getEventDestroy()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = property->add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = property->add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
property->remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
property->clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = property->getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = property->getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
property->getEvent<CB_NAME>.disconnect(handler_id);

See Also:

Render Class#

UNIGINE 2.17 UNIGINE 2.18
setLightsInterleaved( bool ) Removed. Use setDirectLightingInterleaved( bool ) instead.
isLightsInterleaved() Removed. Use isDirectLightingInterleaved( ) instead.
setLightsInterleavedCatmullResampling( bool ) Removed. Use setDirectLightingInterleavedCatmullResampling( bool ) instead.
isLightsInterleavedCatmullResampling() Removed. Use isDirectLightingInterleavedCatmullResampling( ) instead.
setLightsInterleavedColorClamping( int ) Removed. Use setDirectLightingInterleavedColorClamping( int ) instead.
getLightsInterleavedColorClamping() Removed. Use getDirectLightingInterleavedColorClamping( ) instead.
setLightsInterleavedSamples( int ) Removed. Use setDirectLightingInterleavedSamples( int ) instead.
getLightsInterleavedSamples() Removed. Use getDirectLightingInterleavedSamples( ) instead.
setDenoiseDenoiseByVelocityThreshold( float ) Removed.
getDenoiseDenoiseByVelocityThreshold() Removed.
createCacheTextures( ) Removed.
Enum CALLBACK Removed.
addCallback( int, Unigine::CallbackBase1< Unigine::Renderer * > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( int, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( int ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_BEGIN -> getEventBegin()
- CALLBACK_BEGIN_ENVIRONMENT -> getEventBeginEnvironment()
- CALLBACK_END_ENVIRONMENT -> getEventEndEnvironment()
- CALLBACK_BEGIN_SHADOWS -> getEventBeginShadows()
- CALLBACK_BEGIN_WORLD_SHADOW -> getEventBeginWorldShadow()
- CALLBACK_END_WORLD_SHADOW -> getEventEndWorldShadow()
- CALLBACK_BEGIN_PROJ_SHADOW -> getEventBeginProjShadow()
- CALLBACK_END_PROJ_SHADOW -> getEventEndProjShadow()
- CALLBACK_BEGIN_OMNI_SHADOW -> getEventBeginOmniShadow()
- CALLBACK_END_OMNI_SHADOW -> getEventEndOmniShadow()
- CALLBACK_END_SHADOWS -> getEventEndShadows()
- CALLBACK_BEGIN_SCREEN -> getEventBeginScreen()
- CALLBACK_BEGIN_OPACITY_GBUFFER -> getEventBeginOpacityGBuffer()
- CALLBACK_END_OPACITY_GBUFFER -> getEventEndOpacityGBuffer()
- CALLBACK_BEGIN_OPACITY_DECALS -> getEventBeginOpacityDecals()
- CALLBACK_END_OPACITY_DECALS -> getEventEndOpacityDecals()
- CALLBACK_BEGIN_CURVATURE -> getEventBeginCurvature()
- CALLBACK_END_CURVATURE -> getEventEndCurvature()
- CALLBACK_BEGIN_CURVATURE_COMPOSITE -> getEventBeginCurvatureComposite()
- CALLBACK_END_CURVATURE_COMPOSITE -> getEventEndCurvatureComposite()
- CALLBACK_BEGIN_SSRTGI -> getEventBeginSSRTGI()
- CALLBACK_END_SSRTGI -> getEventEndSSRTGI()
- CALLBACK_BEGIN_OPACITY_LIGHTS -> getEventBeginOpacityLights()
- CALLBACK_END_OPACITY_LIGHTS -> getEventEndOpacityLights()
- CALLBACK_BEGIN_OPACITY_VOXEL_PROBES -> getEventBeginOpacityVoxelProbes()
- CALLBACK_END_OPACITY_VOXEL_PROBES -> getEventEndOpacityVoxelProbes()
- CALLBACK_BEGIN_OPACITY_ENVIRONMENT_PROBES -> getEventBeginOpacityEnvironmentProbes()
- CALLBACK_END_OPACITY_ENVIRONMENT_PROBES -> getEventEndOpacityEnvironmentProbes()
- CALLBACK_BEGIN_OPACITY_PLANAR_PROBES -> getEventBeginOpacityPlanarProbes()
- CALLBACK_END_OPACITY_PLANAR_PROBES -> getEventEndOpacityPlanarProbes()
- CALLBACK_BEGIN_AUXILIARY_BUFFER -> getEventBeginAuxiliaryBuffer()
- CALLBACK_END_AUXILIARY_BUFFER -> getEventEndAuxiliaryBuffer()
- CALLBACK_BEGIN_REFRACTION_BUFFER -> getEventBeginRefractionBuffer()
- CALLBACK_END_REFRACTION_BUFFER -> getEventEndRefractionBuffer()
- CALLBACK_BEGIN_TRANSPARENT_BLUR_BUFFER -> getEventBeginTransparentBlurBuffer()
- CALLBACK_END_TRANSPARENT_BLUR_BUFFER -> getEventEndTransparentBlurBuffer()
- CALLBACK_BEGIN_SSSS -> getEventBeginSSSS()
- CALLBACK_END_SSSS -> getEventEndSSSS()
- CALLBACK_BEGIN_SSR -> getEventBeginSSR()
- CALLBACK_END_SSR -> getEventEndSSR()
- CALLBACK_BEGIN_SSAO -> getEventBeginSSAO()
- CALLBACK_END_SSAO -> getEventEndSSAO()
- CALLBACK_BEGIN_SSGI -> getEventBeginSSGI()
- CALLBACK_END_SSGI -> getEventEndSSGI()
- CALLBACK_BEGIN_SKY -> getEventBeginSky()
- CALLBACK_END_SKY -> getEventEndSky()
- CALLBACK_BEGIN_COMPOSITE_DEFERRED -> getEventBeginCompositeDeferred()
- CALLBACK_END_COMPOSITE_DEFERRED -> getEventEndCompositeDeferred()
- CALLBACK_BEGIN_TRANSPARENT -> getEventBeginTransparent()
- CALLBACK_BEGIN_CLOUDS -> getEventBeginClouds()
- CALLBACK_END_CLOUDS -> getEventEndClouds()
- CALLBACK_BEGIN_WATER -> getEventBeginWater()
- CALLBACK_BEGIN_WATER_DECALS -> getEventBeginWaterDecals()
- CALLBACK_END_WATER_DECALS -> getEventEndWaterDecals()
- CALLBACK_BEGIN_WATER_LIGHTS -> getEventBeginWaterLights()
- CALLBACK_END_WATER_LIGHTS -> getEventEndWaterLights()
- CALLBACK_BEGIN_WATER_VOXEL_PROBES -> getEventBeginWaterVoxelProbes()
- CALLBACK_END_WATER_VOXEL_PROBES -> getEventEndWaterVoxelProbes()
- CALLBACK_BEGIN_WATER_ENVIRONMENT_PROBES -> getEventBeginWaterEnvironmentProbes()
- CALLBACK_END_WATER_ENVIRONMENT_PROBES -> getEventEndWaterEnvironmentProbes()
- CALLBACK_BEGIN_WATER_PLANAR_PROBES -> getEventBeginWaterPlanarProbes()
- CALLBACK_END_WATER_PLANAR_PROBES -> getEventEndWaterPlanarProbes()
- CALLBACK_END_WATER -> getEventEndWater()
- CALLBACK_END_TRANSPARENT -> getEventEndTransparent()
- CALLBACK_BEGIN_SRGB_CORRECTION -> getEventBeginSrgbCorrection()
- CALLBACK_END_SRGB_CORRECTION -> getEventEndSrgbCorrection()
- CALLBACK_BEGIN_ADAPTATION_COLOR_AVERAGE -> getEventBeginAdaptationColorAverage()
- CALLBACK_END_ADAPTATION_COLOR_AVERAGE -> getEventEndAdaptationColorAverage()
- CALLBACK_BEGIN_ADAPTATION_COLOR -> getEventBeginAdaptationColor()
- CALLBACK_END_ADAPTATION_COLOR -> getEventEndAdaptationColor()
- CALLBACK_BEGIN_TAA -> getEventBeginTAA()
- CALLBACK_END_TAA -> getEventEndTAA()
- CALLBACK_BEGIN_CAMERA_EFFECTS -> getEventBeginCameraEffects()
- CALLBACK_END_CAMERA_EFFECTS -> getEventEndCameraEffects()
- CALLBACK_BEGIN_POST_MATERIALS -> getEventBeginPostMaterials()
- CALLBACK_END_POST_MATERIALS -> getEventEndPostMaterials()
- CALLBACK_BEGIN_DEBUG_MATERIALS -> getEventBeginDebugMaterials()
- CALLBACK_END_DEBUG_MATERIALS -> getEventEndDebugMaterials()
- CALLBACK_BEGIN_VISUALIZER -> getEventBeginVisualizer()
- CALLBACK_END_VISUALIZER -> getEventEndVisualizer()
- CALLBACK_END_SCREEN -> getEventEndScreen()
- CALLBACK_END -> getEventEnd()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = Render::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = Render::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
Render::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
Render::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = Render::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = Render::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
Render::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

New Functions

Renderer Class#

UNIGINE 2.17 UNIGINE 2.18
getTextureLights( ) Removed. Use getTextureIndirectLights( ) or getTextureDirectLights( ) instead.

New Functions

Shader Class#

StructuredBuffer Class#

UNIGINE 2.17 UNIGINE 2.18
bindCompute( int ) Removed. Use the RenderState::setStructuredBuffer() method.
unbindCompute( int ) Removed. Use the RenderState::clearStructuredBuffer() method.
bindControl( int ) Removed. Use the RenderState::setStructuredBuffer() method.
unbindControl( int ) Removed. Use the RenderState::clearStructuredBuffer() method.
bindEvaluate( int ) Removed. Use the RenderState::setStructuredBuffer() method.
unbindEvaluate( int ) Removed. Use the RenderState::clearStructuredBuffer() method.
bindFragment( int ) Removed. Use the RenderState::setStructuredBuffer() method.
unbindFragment( int ) Removed. Use the RenderState::clearStructuredBuffer() method.
bindGeometry( int ) Removed. Use the RenderState::setStructuredBuffer() method.
unbindGeometry( int ) Removed. Use the RenderState::clearStructuredBuffer() method.
bindVertex( int ) Removed. Use the RenderState::setStructuredBuffer() method.
unbindVertex( int ) Removed. Use the RenderState::clearStructuredBuffer() method.

Stream Class#

New Functions

Socket Class#

UNIGINE 2.17 UNIGINE 2.18
Socket( int ) Removed.
Socket( int, int ) Removed.
Socket( int, const char *, int ) Removed.
SOCKET_STREAM Renamed as SOCKET_TYPE_STREAM.
SOCKET_DGRAM Renamed as SOCKET_TYPE_DGRAM.
create( ) Set of arguments changed.
create( ) Set of arguments changed.
create( ) Set of arguments changed.
close( ) Set of arguments changed.

SSLSocket Class#

Texture Class#

UNIGINE 2.17 UNIGINE 2.18
bindCompute( int ) Removed. Use the RenderState::setTexture() method with the BIND_ALL variable as an argument.
bindFragment( int ) Removed. Use the RenderState::setTexture() method with the BIND_FRAGMENT variable as an argument.
bindVertex( int ) Removed. Use the RenderState::setTexture() method with the BIND_ALL variable as an argument.
unbindCompute( int ) Removed. Use the RenderState::clearTexture() method.
unbindFragment( int ) Removed. Use the RenderState::clearTexture() method.
unbindVertex( int ) Removed. Use the RenderState::clearTexture() method.

TextureRamp Class#

UNIGINE 2.17 UNIGINE 2.18
addChangedCallback( Unigine::CallbackBase * ) Removed. Use getEventChanged().connect() call instead (see migration details).
removeChangedCallback( void * ) Removed. Use getEventChanged().disconnect() call instead (see migration details).
clearChangedCallbacks( ) Removed for safety reasons (see migration details).

New Functions

UserInterface Class#

UNIGINE 2.17 UNIGINE 2.18
addCallback( const char *, Gui::CALLBACK_INDEX, Unigine::CallbackBase * ) Removed.
addCallback( const char *, Gui::CALLBACK_INDEX, Unigine::CallbackBase1< Ptr<Widget> > * ) Removed.
addCallback( const char *, Gui::CALLBACK_INDEX, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > * ) Removed.
addCallback( const char *, Gui::CALLBACK_INDEX, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > * ) Removed.
removeCallback( const char *, Gui::CALLBACK_INDEX, void * ) Removed.
clearCallbacks( const char *, Gui::CALLBACK_INDEX ) Removed.

New Functions

Visualizer Class#

Viewport Class#

UNIGINE 2.17 UNIGINE 2.18
addCallback( int, Unigine::CallbackBase1< Unigine::Renderer * > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( int, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( int ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- Render::CALLBACK_BEGIN -> getEventBegin()
- Render::CALLBACK_BEGIN_ENVIRONMENT -> getEventBeginEnvironment()
- Render::CALLBACK_END_ENVIRONMENT -> getEventEndEnvironment()
- Render::CALLBACK_BEGIN_SHADOWS -> getEventBeginShadows()
- Render::CALLBACK_BEGIN_WORLD_SHADOW -> getEventBeginWorldShadow()
- Render::CALLBACK_END_WORLD_SHADOW -> getEventEndWorldShadow()
- Render::CALLBACK_BEGIN_PROJ_SHADOW -> getEventBeginProjShadow()
- Render::CALLBACK_END_PROJ_SHADOW -> getEventEndProjShadow()
- Render::CALLBACK_BEGIN_OMNI_SHADOW -> getEventBeginOmniShadow()
- Render::CALLBACK_END_OMNI_SHADOW -> getEventEndOmniShadow()
- Render::CALLBACK_END_SHADOWS -> getEventEndShadows()
- Render::CALLBACK_BEGIN_SCREEN -> getEventBeginScreen()
- Render::CALLBACK_BEGIN_OPACITY_GBUFFER -> getEventBeginOpacityGBuffer()
- Render::CALLBACK_END_OPACITY_GBUFFER -> getEventEndOpacityGBuffer()
- Render::CALLBACK_BEGIN_OPACITY_DECALS -> getEventBeginOpacityDecals()
- Render::CALLBACK_END_OPACITY_DECALS -> getEventEndOpacityDecals()
- Render::CALLBACK_BEGIN_CURVATURE -> getEventBeginCurvature()
- Render::CALLBACK_END_CURVATURE -> getEventEndCurvature()
- Render::CALLBACK_BEGIN_CURVATURE_COMPOSITE -> getEventBeginCurvatureComposite()
- Render::CALLBACK_END_CURVATURE_COMPOSITE -> getEventEndCurvatureComposite()
- Render::CALLBACK_BEGIN_SSRTGI -> getEventBeginSSRTGI()
- Render::CALLBACK_END_SSRTGI -> getEventEndSSRTGI()
- Render::CALLBACK_BEGIN_OPACITY_LIGHTS -> getEventBeginOpacityLights()
- Render::CALLBACK_END_OPACITY_LIGHTS -> getEventEndOpacityLights()
- Render::CALLBACK_BEGIN_OPACITY_VOXEL_PROBES -> getEventBeginOpacityVoxelProbes()
- Render::CALLBACK_END_OPACITY_VOXEL_PROBES -> getEventEndOpacityVoxelProbes()
- Render::CALLBACK_BEGIN_OPACITY_ENVIRONMENT_PROBES -> getEventBeginOpacityEnvironmentProbes()
- Render::CALLBACK_END_OPACITY_ENVIRONMENT_PROBES -> getEventEndOpacityEnvironmentProbes()
- Render::CALLBACK_BEGIN_OPACITY_PLANAR_PROBES -> getEventBeginOpacityPlanarProbes()
- Render::CALLBACK_END_OPACITY_PLANAR_PROBES -> getEventEndOpacityPlanarProbes()
- Render::CALLBACK_BEGIN_AUXILIARY_BUFFER -> getEventBeginAuxiliaryBuffer()
- Render::CALLBACK_END_AUXILIARY_BUFFER -> getEventEndAuxiliaryBuffer()
- Render::CALLBACK_BEGIN_REFRACTION_BUFFER -> getEventBeginRefractionBuffer()
- Render::CALLBACK_END_REFRACTION_BUFFER -> getEventEndRefractionBuffer()
- Render::CALLBACK_BEGIN_TRANSPARENT_BLUR_BUFFER -> getEventBeginTransparentBlurBuffer()
- Render::CALLBACK_END_TRANSPARENT_BLUR_BUFFER -> getEventEndTransparentBlurBuffer()
- Render::CALLBACK_BEGIN_SSSS -> getEventBeginSSSS()
- Render::CALLBACK_END_SSSS -> getEventEndSSSS()
- Render::CALLBACK_BEGIN_SSR -> getEventBeginSSR()
- Render::CALLBACK_END_SSR -> getEventEndSSR()
- Render::CALLBACK_BEGIN_SSAO -> getEventBeginSSAO()
- Render::CALLBACK_END_SSAO -> getEventEndSSAO()
- Render::CALLBACK_BEGIN_SSGI -> getEventBeginSSGI()
- Render::CALLBACK_END_SSGI -> getEventEndSSGI()
- Render::CALLBACK_BEGIN_SKY -> getEventBeginSky()
- Render::CALLBACK_END_SKY -> getEventEndSky()
- Render::CALLBACK_BEGIN_COMPOSITE_DEFERRED -> getEventBeginCompositeDeferred()
- Render::CALLBACK_END_COMPOSITE_DEFERRED -> getEventEndCompositeDeferred()
- Render::CALLBACK_BEGIN_TRANSPARENT -> getEventBeginTransparent()
- Render::CALLBACK_BEGIN_CLOUDS -> getEventBeginClouds()
- Render::CALLBACK_END_CLOUDS -> getEventEndClouds()
- Render::CALLBACK_BEGIN_WATER -> getEventBeginWater()
- Render::CALLBACK_BEGIN_WATER_DECALS -> getEventBeginWaterDecals()
- Render::CALLBACK_END_WATER_DECALS -> getEventEndWaterDecals()
- Render::CALLBACK_BEGIN_WATER_LIGHTS -> getEventBeginWaterLights()
- Render::CALLBACK_END_WATER_LIGHTS -> getEventEndWaterLights()
- Render::CALLBACK_BEGIN_WATER_VOXEL_PROBES -> getEventBeginWaterVoxelProbes()
- Render::CALLBACK_END_WATER_VOXEL_PROBES -> getEventEndWaterVoxelProbes()
- Render::CALLBACK_BEGIN_WATER_ENVIRONMENT_PROBES -> getEventBeginWaterEnvironmentProbes()
- Render::CALLBACK_END_WATER_ENVIRONMENT_PROBES -> getEventEndWaterEnvironmentProbes()
- Render::CALLBACK_BEGIN_WATER_PLANAR_PROBES -> getEventBeginWaterPlanarProbes()
- Render::CALLBACK_END_WATER_PLANAR_PROBES -> getEventEndWaterPlanarProbes()
- Render::CALLBACK_END_WATER -> getEventEndWater()
- Render::CALLBACK_END_TRANSPARENT -> getEventEndTransparent()
- Render::CALLBACK_BEGIN_SRGB_CORRECTION -> getEventBeginSrgbCorrection()
- Render::CALLBACK_END_SRGB_CORRECTION -> getEventEndSrgbCorrection()
- Render::CALLBACK_BEGIN_ADAPTATION_COLOR_AVERAGE -> getEventBeginAdaptationColorAverage()
- Render::CALLBACK_END_ADAPTATION_COLOR_AVERAGE -> getEventEndAdaptationColorAverage()
- Render::CALLBACK_BEGIN_ADAPTATION_COLOR -> getEventBeginAdaptationColor()
- Render::CALLBACK_END_ADAPTATION_COLOR -> getEventEndAdaptationColor()
- Render::CALLBACK_BEGIN_TAA -> getEventBeginTAA()
- Render::CALLBACK_END_TAA -> getEventEndTAA()
- Render::CALLBACK_BEGIN_CAMERA_EFFECTS -> getEventBeginCameraEffects()
- Render::CALLBACK_END_CAMERA_EFFECTS -> getEventEndCameraEffects()
- Render::CALLBACK_BEGIN_POST_MATERIALS -> getEventBeginPostMaterials()
- Render::CALLBACK_END_POST_MATERIALS -> getEventEndPostMaterials()
- Render::CALLBACK_BEGIN_DEBUG_MATERIALS -> getEventBeginDebugMaterials()
- Render::CALLBACK_END_DEBUG_MATERIALS -> getEventEndDebugMaterials()
- Render::CALLBACK_BEGIN_VISUALIZER -> getEventBeginVisualizer()
- Render::CALLBACK_END_VISUALIZER -> getEventEndVisualizer()
- Render::CALLBACK_END_SCREEN -> getEventEndScreen()
- Render::CALLBACK_END -> getEventEnd()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = viewport->add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = viewport->add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
viewport->remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
viewport->clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = viewport->getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = viewport->getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
viewport->getEvent<CB_NAME>.disconnect(handler_id);

See Also:

New Functions

Widget Class#

UNIGINE 2.17 UNIGINE 2.18
isCallback( int ) Removed.
setCallback( int, Variable ) Removed.
setCallback( int, Variable, Variable ) Removed.
setCallback( int, Variable, Variable, Variable ) Removed.
setCallback( int, Variable, Variable, Variable, Variable ) Removed.
setCallback( int, Variable, Variable, Variable, Variable, Variable ) Removed.
addCallback( Gui::CALLBACK_INDEX, Unigine::CallbackBase * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( Gui::CALLBACK_INDEX, Unigine::CallbackBase1< Ptr<Widget> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( Gui::CALLBACK_INDEX, Unigine::CallbackBase2< Ptr<Widget>, Ptr<Widget> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( Gui::CALLBACK_INDEX, Unigine::CallbackBase3< Ptr<Widget>, Ptr<Widget>, int > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( Gui::CALLBACK_INDEX, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( Gui::CALLBACK_INDEX ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- Gui::SHOW -> getEventShow()
- Gui::HIDE -> getEventHide()
- Gui::FOCUS_IN -> getEventFocusIn()
- Gui::FOCUS_OUT -> getEventFocusOut()
- Gui::CHANGED -> getEventChanged()
- Gui::CLICKED -> getEventClicked()
- Gui::DOUBLE_CLICKED -> getEventDoubleClicked()
- Gui::PRESSED -> getEventPressed()
- Gui::RELEASED -> getEventReleased()
- Gui::KEY_PRESSED -> getEventKeyPressed()
- Gui::TEXT_PRESSED -> getEventTextPressed()
- Gui::ENTER -> getEventEnter()
- Gui::LEAVE -> getEventLeave()
- Gui::DRAG_MOVE -> getEventDragMove()
- Gui::DRAG_DROP -> getEventDragDrop()
- Gui::REMOVE -> getEventRemove()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = widget->add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = widget->add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
widget->remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
widget->clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = widget->getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = widget->getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
widget->getEvent<CB_NAME>.disconnect(handler_id);

See Also:

setCallbackAccel( Gui::CALLBACK_INDEX, unsigned int, int, int, int ) Removed.
getCallbackAccel( Gui::CALLBACK_INDEX, unsigned int &, int &, int &, int & ) Removed.
isCallbackAccel( unsigned int, int, int, int ) Removed.
setCallbackEnabled( Gui::CALLBACK_INDEX, bool ) Removed.
isCallbackEnabled( Gui::CALLBACK_INDEX ) Removed.
runCallback( int ) Removed.

New Functions

WindowManager Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACKS Removed.
addCallback( CALLBACKS, Unigine::CallbackBase * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( CALLBACKS, Unigine::CallbackBase1< Ptr <EngineWindow> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( CALLBACKS, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( CALLBACKS ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_WINDOW_CREATED -> getEventWindowCreated()
- CALLBACK_WINDOW_REMOVED -> getEventWindowRemoved()
- CALLBACK_WINDOW_STACKED -> getEventWindowStacked()
- CALLBACK_WINDOW_UNSTACKED -> getEventWindowUnstacked()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = WindowManager::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = WindowManager::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
WindowManager::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
WindowManager::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = WindowManager::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = WindowManager::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
WindowManager::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

World Class#

UNIGINE 2.17 UNIGINE 2.18
Enum CALLBACK_INDEX Removed.
addCallback( int, Unigine::CallbackBase1< const char *> * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
addCallback( int, Unigine::CallbackBase2< const char *, Ptr <Node> > * ) Removed. Use one of the getEvent***().connect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
removeCallback( int, void * ) Removed. Use one of the getEvent***().disconnect() calls instead. See the list of separate replacement methods for the corresponding events here (see migration details).
clearCallbacks( int ) Removed for safety reasons (see migration details).
Old Enum to New Event Mapping:
- CALLBACK_PRE_WORLD_LOAD -> getEventPreWorldLoad()
- CALLBACK_POST_WORLD_LOAD -> getEventPostWorldLoad()
- CALLBACK_PRE_WORLD_SAVE -> getEventPreWorldSave()
- CALLBACK_POST_WORLD_SAVE -> getEventPostWorldSave()
- CALLBACK_PRE_WORLD_CLEAR -> getEventPreWorldClear()
- CALLBACK_POST_WORLD_CLEAR -> getEventPostWorldClear()
- CALLBACK_PRE_NODE_SAVE -> getEventPreNodeSave()
- CALLBACK_POST_NODE_SAVE -> getEventPostNodeSave()
- CALLBACK_PRE_WORLD_INIT -> getEventPreWorldInit()
- CALLBACK_POST_WORLD_INIT -> getEventPostWorldInit()
- CALLBACK_PRE_WORLD_SHUTDOWN -> getEventPreWorldShutdown()
- CALLBACK_POST_WORLD_SHUTDOWN -> getEventPostWorldShutdown()

Migration Example

UNIGINE 2.17UNIGINE 2.18
Source code (C++)
// callback ID to be used to remove callback later
void *callback_id;

// implement the <CB_NAME> callback
void <CB_NAME>_callback({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// add a <CB_NAME> callback and keep its ID
callback_id = World::add<CB_NAME>Callback(
				MakeCallback(<CB_NAME>_callback));

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
callback_id = World::add<CB_NAME>Callback(
				MakeCallback(
				sc_instance, 
				&SomeClass::event_handler));

// remove the callback by using its id
World::remove<CB_NAME>Callback(callback_id);

// clear all <CB_NAME> callbacks
World::clear<CB_NAME>Callbacks();
Source code (C++)
// connection ID to be used to unsubscribe later
EventConnectionId handler_id;

// implement the <CB_NAME> event handler
void event_handler({params})
{
	Log::message("\Handling <CB_NAME> event\n");
}

// subscribe for the <CB_NAME> event with a handler function
// and keep connection ID
handler_id = World::getEvent<CB_NAME>.connect(event_handler);

// or in case a handler method belongs to some class,
// passing a class instance
SomeClass *sc_instance;
// ...
handler_id = World::getEvent<CB_NAME>().connect(
			sc_instance, 
			&SomeClass::event_handler);

// remove the subscription later using the ID
World::getEvent<CB_NAME>.disconnect(handler_id);

See Also:

WorldSplineGraph Class#

UNIGINE 2.17 UNIGINE 2.18
addPointAddedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * ) Removed. Use getEventPointAdded().connect() call instead (see migration details).
removePointAddedCallback( void * ) Removed. Use getEventPointAdded().disconnect() call instead (see migration details).
clearPointAddedCallbacks( ) Removed for safety reasons (see migration details).
addPointChangedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * ) Removed. Use getEventPointChanged().connect() call instead (see migration details).
removePointChangedCallback( void * ) Removed. Use getEventPointChanged().disconnect() call instead (see migration details).
clearPointChangedCallbacks( ) Removed for safety reasons (see migration details).
addPointRemovedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * ) Removed. Use getEventPointRemoved().connect() call instead (see migration details).
removePointRemovedCallback( void * ) Removed. Use getEventPointRemoved().disconnect() call instead (see migration details).
clearPointRemovedCallbacks( ) Removed for safety reasons (see migration details).
addSegmentAddedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * ) Removed. Use getEventSegmentAdded().connect() call instead (see migration details).
removeSegmentAddedCallback( void * ) Removed. Use getEventSegmentAdded().disconnect() call instead (see migration details).
clearSegmentAddedCallbacks( ) Removed for safety reasons (see migration details).
addSegmentChangedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * ) Removed. Use getEventSegmentChanged().connect() call instead (see migration details).
removeSegmentChangedCallback( void * ) Removed. Use getEventSegmentChanged().disconnect() call instead (see migration details).
clearSegmentChangedCallbacks( ) Removed for safety reasons (see migration details).
addSegmentRemovedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * ) Removed. Use getEventSegmentRemoved().connect() call instead (see migration details).
removeSegmentRemovedCallback( void * ) Removed. Use getEventSegmentRemoved().disconnect() call instead (see migration details).
clearSegmentRemovedCallbacks( ) Removed for safety reasons (see migration details).

WorldTrigger Class#

UNIGINE 2.17 UNIGINE 2.18
addEnterCallback( Unigine::CallbackBase1< Ptr<Node> > * ) Removed. Use getEventEnter().connect() call instead (see migration details).
removeEnterCallback( void * ) Removed. Use getEventEnter().disconnect() call instead (see migration details).
clearEnterCallbacks( ) Removed for safety reasons (see migration details).
setEnterCallback( int ) Removed.
addLeaveCallback( Unigine::CallbackBase1< Ptr<Node> > * ) Removed. Use getEventLeave().connect() call instead (see migration details).
removeLeaveCallback( void * ) Removed. Use getEventLeave().disconnect() call instead (see migration details).
clearLeaveCallbacks( ) Removed for safety reasons (see migration details).
setLeaveCallback( int ) Removed.

FMODStudio Class#

Last update: 2024-01-18
Build: ()