2dog.qt
4.7.2.134
dotnet add package 2dog.qt --version 4.7.2.134
NuGet\Install-Package 2dog.qt -Version 4.7.2.134
<PackageReference Include="2dog.qt" Version="4.7.2.134" />
<PackageVersion Include="2dog.qt" Version="4.7.2.134" />
<PackageReference Include="2dog.qt" />
paket add 2dog.qt --version 4.7.2.134
#r "nuget: 2dog.qt, 4.7.2.134"
#:package 2dog.qt@4.7.2.134
#addin nuget:?package=2dog.qt&version=4.7.2.134
#tool nuget:?package=2dog.qt&version=4.7.2.134
2dog.qt
Embed a Godot viewport in a Qt Quick application built with
Qt Bridge for C#. The GodotView item from the TwoDog QML module
shows the engine inside the scene, so QML items render on top of the running game.
using Qt.Quick;
using twodog;
static void Main(string[] args)
{
using var session = new QtGodotSession("mygame", args: args);
Qml.LoadFromRootModule("Main");
Qml.WaitForExit();
}
import QtQuick
import TwoDog
Window {
visible: true
GodotView { anchors.fill: parent; focus: true }
}
- The session owns the engine (one per process). The engine starts once the first
GodotViewrenders and is pumped on Qt's GUI thread, once per Qt Quick frame.Started,FrameAdvanced,ActiveModeChangedandStoppedrun there, as do C# methods that QML calls, so both can use the Godot API directly. Qt Bridge runsMainon a different thread. - Dispose the session after
Qml.WaitForExit(): it waits until the engine has shut down on the GUI thread. When Godot quits, the application quits. - On Windows, Qt Quick's default Direct3D 11 backend shares GPU textures with the engine (zero-copy). Other platforms
and backends use CPU readback, which is also the automatic fallback;
PresentationModeforces either andActiveModereports which one runs. - While the window is minimized or hidden the engine keeps running at a background rate without rendering, as long
as Qt's event loop runs. Pausing is the app's call: set
IsPaused. OneGodotViewshows the engine at a time.
The TwoDog module ships as C++ source and builds against the Qt your app uses, with the toolchain Qt Bridge
already requires (CMake, Ninja, and MSVC on Windows). The build copies it to <app>/TwoDog. Qt comes from Qt
Bridge's QtDir: bundled in QtGroup.Qt.Bridge.CSharp.win-x64, and set by you on Linux and macOS.
Requires an explicit reference to 2dog.engine or 2dog.engine.double, and a
QtGroup.Qt.Bridge.CSharp.<rid> package.
2dog.qt contains no Qt code. Qt Bridge for C# and Qt are licensed under LGPL-3.0 or a commercial license; an app that ships their binaries takes on those terms. See https://2dog.dev/hosts/qt#licensing.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.