2.0 Help

C++ Project Generation

There are multiple ways to get custom C++ code into Plasma. The best way is to create an engine plugin, because this way the code can be executed directly inside the editor. Additionally such a plugins can be hot reloaded to some degree.

Plasma uses CMake for its build infrastructure. See this chapter about different ways to integrate your own project into the Plasma build.

The most convenient way, however, is to let the editor create a stand-alone project for you. This way you get a CMake based project that only contains your code, but has all the necessary references set up to link against Plasma and output its DLLs to the right folder.

How to Generate a New Solution

  1. Select Editor > Open C++ Project....

  2. Choose the desired MSVC solution version.

  3. Press the Generate Solution button and wait for it to finish.

    The CMake output is output in the Output window. In case of errors, please have a look here.

    If everything went fine, you can open the project and compile the code.

Opening an Existing Solution

If you have generated the solution before, the Open Solution button will be active right away when you open this dialog. In this case you don't need to generate the solution again.

Regenerating a Solution

If you have added or removed source files on disk, you need to regenerate the solution for those changes to show up in the Visual Studio solution. You have two options to do so:

  1. Run CMake yourself. For example you can use the CMake GUI app, point it to the plugin's build directory, and then Configure and Generate the solution at any point you like.

  2. Rerun Generate Solution from the dialog above. This will clear the CMake cache and fully regenerate the solution. Be aware that this resets all CMake options to their default values and often takes longer than strictly necessary.

See Also

Last modified: 09 June 2024