Skip to content

evangipson/CFlat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CFlat

A native AoT .NET C# audio engine using FMOD Core, with an example C++ project invoking the exposed C# methods.

All of the C# code is entirely native AoT, with a few methods exposed in Shared Native project intended to be called from unmanaged code.

Getting Started

  1. Download the repo
  2. Run dotnet publish src\Shared -c Release --use-current-runtime --property:PublishDir=src\Examples\cpp\lib to publish the Shared native AoT .dll, .lib, and .pdb files to the C++ example project's lib directory
  3. Open the C++ example solution in Visual Studio
  4. Run the project to see C# code being invoked from C++

Architecture

C#

The CFlat.Core project mainly houses models, extensions, and constants for the application.

The CFlat.Application project contains all of the services and factories.

The CFlat.Native project contains events, which are "exposed" methods that are intended to be invoked from unmanaged code.

C++

The CFlat.Example project is an example of invoking the exposed events from the Shared Native project.

The InteropService manages loading the native AoT libraries and creating function pointers from the exposed events in CFlat.Application.

The AudioEngineService and SoundService invoke the functions created by the InteropService.

The main function shows the final result, a simple and easy way to invoke methods defined in C# from C++!

Releases

No releases published

Packages

No packages published