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;
}
ramses::RamsesClient
Entry point of RAMSES client API.
Definition:
RamsesClient.h:34
ramses::RamsesFramework
Class representing ramses framework components that are needed to initialize an instance of ramses cl...
Definition:
RamsesFramework.h:35
ramses::RamsesFramework::connect
status_t connect()
Tries to establish a connection to the RAMSES system.
ramses::RamsesFramework::createClient
RamsesClient * createClient(const char *applicationName)
Create a new RamsesClient linked to this framework. Creation of multiple clients is supported....
ramses::RamsesFramework::disconnect
status_t disconnect()
Disconnects the RamsesClient from the system.
ramses::Scene
The Scene holds a scene graph. It is the essential class for distributing content to the ramses syste...
Definition:
Scene.h:83
ramses::Scene::unpublish
status_t unpublish()
Unpublish the scene from the ramses system.
ramses::Scene::publish
status_t publish(EScenePublicationMode publicationMode=EScenePublicationMode_LocalAndRemote)
Publishes the scene to the ramses system.
ramses::Scene::flush
status_t flush(sceneVersionTag_t sceneVersionTag=InvalidSceneVersionTag)
Commits all changes done to the scene since the last flush or since scene creation....
ramses::StronglyTypedValue
Helper class to create strongly typed values out of various types.
Definition:
StronglyTypedValue.h:23
ramses
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition:
AnimatedProperty.h:15
ramses-client.h
main
int main(int argc, char *argv[])
Definition:
main.cpp:21
Generated by
1.9.1