GDevelop C++ Platform
Platform for developing native games based on OpenGL and SFML with GDevelop
 All Classes Namespaces Files Functions Variables Modules Pages
Overview of the C++ Platform

Some important classes from the game engine

RuntimeScene

When a game is played, a RuntimeScene is used to represent a scene. A RuntimeScene contains the objects instances or functions for rendering the scene in a window.

RuntimeObject

RuntimeObject is used as a base class for all objects. It defines some common properties like position, angle, size or visibility of an object.

Some important classes used by the IDE or for

storage

The C++ platform also make uses of some classes provide by GDevelop Core: These classes are in the namespace gd.

It is important to make the distinction between the classes used by the IDE or for storage only and the classes used by the game engine.
When a game is being played, it is first loaded using the classes listed below. Then, in a second part, the game engine classes are initialized, most of the time using their edittime class counterpart (For example, a RuntimeScene is loaded from a gd::Layout: see below).

Edittime is often used to refer to a class being used for storage or by the IDE, while Runtime is used to refer to the class belonging to the game engine.

gd::Project (also named Game)

A game is represented by a gd::Project class. This class contains the scenes of the game (see below), as well as the images, the global objects and some game properties.
When a game is played, the RuntimeScene being rendered contains a pointer to its parent gd::Project.

gd::Layout

A scene is called a layout in GDevelop Core. It is used only for storage or by the IDE: It contains the objects and the initial instances of a scene. gd::Layout classes representing the scenes of a game are stored inside a gd::Project.
RuntimeScene are not stored inside a gd::Project. RuntimeScene is a runtime class used only by the game engine.

gd::Object

Objects are represented by the gd::Object class. Again, this class is used only for the storage or by the IDE: When a game is played, RuntimeObject is used.

gd::Behavior

Each behavior is an instance of a class that derive from gd::Behavior. Behaviors are linked to an object (thus, behaviors can access to their object by using their member object) and they are also managed by this object.
gd::Behavior is the only exception to the rule explained below: Whereas the classes described in this section are used only for storage, this class is used both for storage and by the game engine.

gd::BaseEvent

BaseEvent is the base class for all events.
Each event type is represented by a class, which define how the event is rendered (BaseEvent::Render), how the code is generated (BaseEvent::GenerateEventCode), and various properties (BaseEvent::CanHaveSubEvents for example)...
As the other classes list in this section, this class is only at edittime used by the IDE.

The classes described in this section are not documented here: please refer to the documentation of GDevelop Core if you need help using them.

About shared pointers

GDevelop use shared pointers (std::shared_ptr), for managing lots of objects like scenes or objects.

Shared pointers are used like raw pointers (*myPointer to dereference the pointer and get the object, myPointer->myMember to access to a function/member of the object...). They don't need to be deleted manually: The pointed object is deleted when no more shared pointers are pointing to the object. For instance, scenes don't have to manually delete the objects they own in their destructors.

UTF8 strings

GDevelop uses UTF8 encoded gd::String as string parameters passed to actions/conditions and expressions and as return value for string expressions. This class is a wrapper around std::string and is UTF8-aware.

For more information, see gd::String reference in the GDCore documentation.