RAMSES Documentation  27.0.130
Information for RAMSES users and developers
ramses-example-minimal/src/main.cpp

Minimal Example

// -------------------------------------------------------------------------
// Copyright (C) 2014 BMW Car IT GmbH
// -------------------------------------------------------------------------
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// -------------------------------------------------------------------------
#include "ramses-client.h"
#include <thread>
int main(int argc, char* argv[])
{
// register at RAMSES daemon
ramses::RamsesFramework framework(argc, argv);
ramses::RamsesClient& ramses(*framework.createClient("ramses-example-minimal"));
framework.connect();
// create a scene and register it at RAMSES daemon
ramses::Scene* scene = ramses.createScene(ramses::sceneId_t(123u));
// signal the scene it is in a state that can be rendered
scene->flush();
// distribute the scene to RAMSES
scene->publish();
// application logic
uint32_t loops = 100;
while (--loops)
{
std::this_thread::sleep_for(std::chrono::seconds(1));
}
// unregister and destroy scene
scene->unpublish();
ramses.destroy(*scene);
// disconnect from RAMSES daemon
framework.disconnect();
return 0;
}
Entry point of RAMSES client API.
Definition: RamsesClient.h:34
Class representing ramses framework components that are needed to initialize an instance of ramses cl...
Definition: RamsesFramework.h:35
status_t connect()
Tries to establish a connection to the RAMSES system.
RamsesClient * createClient(const char *applicationName)
Create a new RamsesClient linked to this framework. Creation of multiple clients is supported....
status_t disconnect()
Disconnects the RamsesClient from the system.
The Scene holds a scene graph. It is the essential class for distributing content to the ramses syste...
Definition: Scene.h:83
status_t unpublish()
Unpublish the scene from the ramses system.
status_t publish(EScenePublicationMode publicationMode=EScenePublicationMode_LocalAndRemote)
Publishes the scene to the ramses system.
status_t flush(sceneVersionTag_t sceneVersionTag=InvalidSceneVersionTag)
Commits all changes done to the scene since the last flush or since scene creation....
Helper class to create strongly typed values out of various types.
Definition: StronglyTypedValue.h:23
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
int main(int argc, char *argv[])
Definition: main.cpp:21