Note
You have to include the header InstantTerra.h.
InstantTerra
The main class of the API.
Error – In any of
these commands, if the communication is off, the following error
code will be thrown ErrorCode::CommunicationError
.
// Create an instant of Instant Terra
InstantTerra instantTerra = CreateInstantTerra();
InstantTerra::
Start
()Starts a new instance of Instant Terra
Error − If Instant
Terra is already started, an Error will be reported with the code
ErrorCode::InstantTerraAlreadyStarted
.
Error − If Instant
Terra is not found, or cannot be opened, an Error will be reported
with the code
ErrorCode::CouldNotStartInstantTerra
.
instantTerra.Start();
InstantTerra::
Close
()Closes Instant Terra instance
Error − If Instant
Terra is not started, an Error will be reported with the code
ErrorCode::InstantTerraNotStarted
.
instantTerra.Stop();
InstantTerra::
IsRunning
()Returns true if an Instant Terra instance is currently running
bool isRunning = instantTerra.IsRunning();
InstantTerra::
OpenProject
(const wchar_t
*projectName)Opens a .terrain project
Error − If the file
is not found, an Error will be reported with the code ErrorCode::UnableToOpenFile
.
// Open the file "MyProject.terrain"
Project project = instantTerra.OpenProject(L"MyProject.terrain");
InstantTerra::
NewProject
()Create a new default project
// New default project
Project project = instantTerra.NewProject();
InstantTerra::
GetProject
()Returns the current project
// Current project
Project project = instantTerra.GetProject();
Copyright © 2022 · All Rights Reserved · Wysilab