Setting Up with .NET CLI - sinusinu/Flora GitHub Wiki

This document assumes that you have already installed .NET 6 SDK or newer.

Creating a Project

  1. Open Command Prompt on selected location.

  2. Create a new project with dotnet new console.

Setting Target Platform to x64

⚠️ Flora strictly supports x64 platform only. If any other platform (including Any CPU) is used, it may cause random crashes and memory corruption.
  1. Open (Your project name).csproj file with text editor.

  2. On left pane, Click Configuration Properties.

  3. Inside <PropertyGroup>, Insert following line:

<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>

Like this:

<PropertyGroup>
    ...
    <PlatformTarget>x64</PlatformTarget>
    <Platforms>x64</Platforms>
    ...
</PropertyGroup>
  1. Save.

Adding Flora project reference

  1. On Project's root directory, Open Command Prompt.

  2. Add reference to Flora with dotnet add reference path\to\flora\Flora.csproj

Copying external libraries

Flora requires external libraries to work properly. These files need to be copied into build folder whenever the project is built.

By using simple post-build event, we can automate copying process.

  1. On Project's root directory, Create a new folder named extlibs.

  2. Open (Your project name).csproj file with text editor.

  3. Inside <Project>, Insert following lines:

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command='xcopy "$(ProjectDir)extlibs\\*.*" "$(TargetDir)" /Y' />
</Target>

Like this:

<Project Sdk="...">
    ...
    <Target Name="PostBuild" AfterTargets="PostBuildEvent">
        <Exec Command='xcopy "$(ProjectDir)extlibs\\*.*" "$(TargetDir)" /Y' />
    </Target>
    ...
</Project>
  1. Save.

  2. Place these files into extlibs folder.

⚠️ Get 64-bit version of these.
SDL2.dll (2.0.22)
SDL2_ttf.dll (2.0.18)
soloud_x64.dll (20200207)

All done!

Now you may continue to Simple Program.

⚠️ **GitHub.com Fallback** ⚠️