Skip to content
Jean-Philippe Bruyère edited this page Dec 23, 2021 · 1 revision

Introduction

Crow has 3 rendering backends with their respective nuget package:

When creating a new crow application, add also a backend package:

dotnet add package Crow --prerelease
dotnet add package Crow.CairoBackend --prerelease

If your cairo library is compiled with egl enabled, you may use the Interface.PreferedBackendType static field to select the Cairo.EglBackend:

Interface.PreferedBackendType = BackendType.Egl

Backend instantiation is done in the overridable initBackend() method that you may override:

protected override void initBackend () {
	backend = new Crow.VkvgBackend.DefaultBackend (clientRectangle.Width, clientRectangle.Height, hWin);
	hWin = backend.hWin;
	ownWindow = backend.ownGlfwWinHandle;
	clipping = Backend.CreateRegion ();
	registerGlfwCallbacks ();
}

If you pass a null pointer to the backend constructor, the backend will create a new glfw window and the ownWindow boolean will be set to true so that crow will destroy the window on termination.

Each backend must implement two constructors, one with the glfw window pointer, and one without for offscreen context.

public DefaultBackend (int width, int height, IntPtr nativeWindoPointer)...
public DefaultBackend (int width, int height)...
Clone this wiki locally