API reference¶
Note
You have to include the header Main.h.
-
void
SetMemoryAllocator
(MemoryAllocator *memoryAllocator)¶ Sets a custom memory allocator. Only one memory allocator can be set. A memory allocator cannot be removed or replaced. This function must be called before calling the Init function.
-
void
Init
()¶ Initializes InstantTerraApi. Must be called once before calling the CreateInstantTerra function.
- Throws
Error – If the Instant Terra is already initialized, an Error will be reported with the code
ErrorCode::InstantTerraApiAlreadyInitialized
.
Init(); // Init InstantTerraApi
-
void
Close
()¶ Closes InstantTerraApi. It must be the last call. If a memory allocator or an error handler have been set, they will be deleted.
Close(); // Close InstantTerraApi
-
void
SetErrorHandler
(ErrorHandler *errorHandler)¶ Sets a custom error handler. Only one error handler can be set at the same time. Setting a new error handler will remove and delete the previous one, if any. Pass nullptr to remove the current error handler.
-
InstantTerra
CreateInstantTerra
()¶ This is the entry point of the API. Create an InstantTerra object and use it to start an instance of the Instant Terra application.
- Throws
Error – If the Instant Terra is not initialized, an Error will be reported with the code
ErrorCode::InstantTerraApiIsNotInizialized
.
// Create an instant of Instant Terra InstantTerra instantTerra = CreateInstantTerra();