top of page

Introducing Donatello

Writer: Daniel Bellido Chueco
Daniel Bellido Chueco
Oct 6
5 min read

Donatello is a personal project in which I aim to develop a basic 3D content creation tool from scratch, using C++, DirectX 12, C#, and .NET.


The idea is to build a desktop application for creating and editing 3D models and scenes, taking inspiration from professional Digital Content Creation (DCC) software such as Autodesk Maya.


The name comes from the Italian Renaissance sculptor Donatello, which seemed appropriate for a tool intended to create and manipulate 3D geometry.


Although the long-term vision is ambitious, the initial scope will focus on fundamental polygonal modelling tools rather than attempting to reproduce a complete professional application.



Motivation and Objectives


As a C++ programmer interested in real-time rendering and game engine development, I wanted to explore another side of graphics programming: building the tools used to create and manipulate 3D content.


While developing game engines has given me experience with rendering systems and graphics APIs, creating a content editor introduces different challenges, including geometry manipulation, user interaction, scene management, and application architecture.


Donatello is also an opportunity to deepen my knowledge of DirectX 12 while learning C# and the .NET ecosystem. My intention is to combine a native C++ backend, responsible for rendering and other low-level systems, with a WPF desktop interface.


The initial development goals include:


  • A DirectX 12 viewport with camera navigation and different display modes.

  • A scene hierarchy and property inspector.

  • Object, vertex, edge, and face selection.

  • Transformation tools and basic polygonal modelling operations.

  • Undo/redo and a non-destructive Mirror modifier.

  • Basic materials and UV editing.

  • Project serialization and asset import/export.


Features such as animation, rigging, sculpting, and simulation are outside the initial scope.

The project is independent of my game engine, STAGE, allowing me to explore different architectural approaches without introducing dependencies between them.



Starting From the Foundations


Before implementing a renderer or modelling tools, I needed to establish the application's basic architecture.


My first objective was to create a working WPF desktop application and connect it to a native C++ library through Platform Invocation Services (P/Invoke).


This first milestone focuses on setting up the Visual Studio solution, configuring both projects, establishing the native API, and verifying that C# can successfully execute functions implemented in C++.



Setting Up the Solution


I started by creating a Visual Studio 2022 solution containing two projects:


  • Donatello.App: A C# WPF desktop application targeting .NET 9.

  • Donatello.Native: A native C++20 Dynamic Link Library (DLL), intended to host the future DirectX 12 rendering backend and other native systems.


This separation establishes a clear boundary between the desktop interface and the underlying C++ implementation.


WPF provides the application's windows and UI controls, while the native library will manage systems requiring low-level access to graphics APIs and resources.


Both projects are configured for x64 to ensure compatibility between the application process and the DLL it loads.


Rather than introducing additional libraries or modules prematurely, I kept the initial solution limited to these two projects.



Creating the First Native API


The next step was exporting a function from the C++ library that could be called from C#.

I introduced a small API entry point in DonatelloApi.h:


extern "C" __declspec(dllexport)
int __cdecl Donatello_GetApiVersion();

Its implementation simply returns the current API version:

int __cdecl Donatello_GetApiVersion()
{
    return 1;
}

Several details of this declaration are important:


  • extern "C" establishes C language linkage, avoiding C++ name mangling for the exported function.

  • __declspec(dllexport) makes the function available outside the DLL.

  • __cdecl explicitly declares the calling convention.


This provides a straightforward entry point for interoperability without exposing C++ classes or implementation details to the managed application.


Returning an integer also makes the first test easy to validate, avoiding the additional complexity of strings, memory allocation, and ownership across the language boundary.



Integrating the Native Library into the Build


One of the first practical issues was ensuring that the native library was available when the WPF application started.


The two projects produce their outputs in different directories. Compiling the DLL successfully does not automatically make it available to the .NET application.


To solve this, I configured the solution so that Donatello.App depends on Donatello.Native.

I also introduced an MSBuild target that copies the native DLL into the application's output directory after compilation.


The configuration uses relative project paths and the active build configuration, allowing the setup to work without depending on a specific user directory.


This establishes a repeatable development workflow in which building the application also builds and deploys the native library it requires.



Calling Native C++ from C#


With the DLL correctly deployed, I introduced a C# declaration in NativeMethods.cs using P/Invoke:


[DllImport(
    "Donatello.Native.dll",
    EntryPoint = "Donatello_GetApiVersion",
    CallingConvention = CallingConvention.Cdecl,
    ExactSpelling = true)]
internal static extern int GetApiVersion();

P/Invoke allows managed .NET code to call functions exported by unmanaged native libraries.


The declaration specifies the DLL name, exported function, and expected calling convention. The method can then be called from C# without exposing the native implementation.

This creates a small but clearly defined interface between both parts of the application.


As Donatello develops, this interface will need to support more complex operations, including resource creation, object handles, and error reporting.

For now, the version query is sufficient to validate the initial connection.



Verifying the Connection


The final step was calling the native function from the WPF application's main window.

After initializing the interface, the application requests the API version and uses the returned value to update its title:

int nativeVersion = NativeMethods.GetApiVersion();

Title = $"Donatello — Native API v{nativeVersion}";

Launching the application displays:

Donatello — Native API v1

The version number is obtained directly from the C++ DLL rather than being hardcoded in the interface.

This confirms that the application can locate the native library, resolve the exported function, execute native code, and receive a result through P/Invoke.

The test does not yet validate complex data exchange or resource ownership, but it establishes the basic communication path required for subsequent development.



Key Takeaways


This first milestone helped me understand several important aspects of developing applications that combine managed and native code.

The most relevant were establishing a clear C++ API boundary, understanding DLL exports and P/Invoke declarations, managing build dependencies, and ensuring that the native library is deployed correctly.

It also highlighted the importance of validating interoperability with a simple function before introducing more complicated systems.

As the application grows, the boundary between C# and C++ will require careful consideration of resource ownership, lifetime management, and error handling.



What's Next?


The next milestone will focus on initializing DirectX 12 inside Donatello.Native.

I plan to introduce device creation, graphics adapter selection, and the initial resource-management infrastructure. The native API will also need a way to report initialization results and errors back to the C# application.


This will move Donatello from a working native connection toward its first graphics subsystem.


For now, the foundation is in place: a WPF desktop application, a native C++ library, and a verified communication path between them.

Recent Posts

See All
Separating Content from Rendering

In the previous milestone, Donatello successfully rendered its first coloured triangle using a custom DirectX 12 graphics pipeline. Although the result was simple, it provided a working foundation for

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

Let's build something great

  • LinkedIn

©2022 
Last update: 14/10/2026

bottom of page