Duxel.Windows.App 0.1.8-preview

This is a prerelease version of Duxel.Windows.App.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Duxel.Windows.App --version 0.1.8-preview
                    
NuGet\Install-Package Duxel.Windows.App -Version 0.1.8-preview
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Duxel.Windows.App" Version="0.1.8-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Duxel.Windows.App" Version="0.1.8-preview" />
                    
Directory.Packages.props
<PackageReference Include="Duxel.Windows.App" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Duxel.Windows.App --version 0.1.8-preview
                    
#r "nuget: Duxel.Windows.App, 0.1.8-preview"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Duxel.Windows.App@0.1.8-preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Duxel.Windows.App&version=0.1.8-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Duxel.Windows.App&version=0.1.8-preview&prerelease
                    
Install as a Cake Tool

Duxel

.NET 10 전용 크로스플랫폼 즉시 모드(Immediate-Mode) GUI 프레임워크. Vulkan 렌더러 + GLFW 윈도우/입력 백엔드로 Dear ImGui 동등 수준의 위젯·렌더링·텍스트 품질을 목표합니다.

현재 버전: 0.1.8-preview · Display/Render 프로필 · 동적 MSAA(1x/2x/4x/8x) · VSync 토글

NuGet License: MIT

Repository: https://github.com/dimohy/Duxel

0.1.8-preview 개선 사항 (최신)

  • 배포 패키지 전략을 2개(Duxel.App, Duxel.Windows.App)로 단순화하고, 하위 구성요소를 상위 패키지에 번들링하도록 정리했습니다.
  • Duxel.App에서 Windows 직접 종속 코드를 제거하고 플랫폼 서비스 주입 훅(ClipboardFactory, ImeHandlerFactory, KeyRepeatSettingsProvider)을 추가했습니다.
  • Duxel.Windows.App를 추가해 Windows 환경에서는 패키지 하나 설치만으로 실행 가능하도록 구성했습니다.
  • DSL 소스 생성기(Duxel.Core.Dsl.Generator)를 Duxel.App 패키지 analyzer로 포함해 단일 설치에서도 소스 생성이 동작하도록 보장했습니다.

이전 버전 변경 내역은 Version History에서 누적 확인할 수 있습니다.

주요 특징

  • 즉시 모드 UI — Dear ImGui 스타일의 Begin/End 패턴 기반 위젯 API
  • Vulkan 렌더러 — 프로필 기반 기본값(Display=MSAA2, Render=MSAA1), VSync 토글, Triple Buffering, Persistent Mapped Buffers
  • GLFW 윈도우/입력 — 키보드·마우스·스크롤·IME 입력 지원
  • 스크롤바/팝업 — 통합 스크롤바 렌더러 (Child/Combo/ListBox/InputMultiline), 팝업 차단 레이어
  • NativeAOT 지원PublishAot=true 배포 가능 (리플렉션/동적 로딩 없음)
  • UI DSL.ui 파일로 선언적 UI 정의, 소스 생성기 기반 빌드 타임 코드 생성, 핫리로드 지원
  • 폰트 아틀라스 — TTF 파싱(컴파운드 글리프 포함), HiDPI 스케일링, 빠른 시작을 위한 Built-in ASCII 폰트
  • ImGui API 전체 커버리지 — 400+ API 구현 완료 (상세 목록)

패키지 구조

패키지 설명
Duxel.App OS 비종속 앱 파사드(공용 실행 파이프라인, 플랫폼 서비스 주입점)
Duxel.Windows.App Windows 올인원 앱 패키지 (DuxelWindowsApp.Run)

내부 구성요소(별도 NuGet 배포 안 함, 상위 패키지에 포함):

  • Duxel.Core — UI 컨텍스트, 위젯 API, 드로우 리스트, 폰트 아틀라스, DSL 런타임
  • Duxel.Platform.Glfw — GLFW 기반 윈도우/입력 백엔드
  • Duxel.Platform.Windows — Windows 전용 플랫폼 지원 (키 반복, IME)
  • Duxel.Vulkan — Vulkan 렌더러 백엔드

빠른 시작

NuGet 패키지 사용 (FBA — File-Based App)

// hello.cs
#:property TargetFramework=net10.0
#:package Duxel.Windows.App@*-*

using Duxel.App;
using Duxel.Windows.App;
using Duxel.Core;

DuxelWindowsApp.Run(new DuxelAppOptions
{
    Window = new DuxelWindowOptions { Title = "Hello Duxel" },
    Screen = new HelloScreen()
});

public sealed class HelloScreen : UiScreen
{
    protected override void OnUI(UiImmediateContext ui)
    {
        ui.BeginWindow("Hello");
        ui.Text("Hello, Duxel!");
        if (ui.Button("Click me"))
            ui.Text("Clicked!");
        ui.End();
    }
}
dotnet run hello.cs

DSL 방식

// dsl_hello.cs
#:property TargetFramework=net10.0
#:package Duxel.Windows.App@*-*

using Duxel.App;
using Duxel.Windows.App;
using Duxel.Core.Dsl;

var dslText = """
Window "Hello DSL"
  Text "Hello from DSL!"
  Button Id="greet" Text="Greet"
  Checkbox Id="dark" Text="Dark Mode" Default=true
  SliderFloat Id="volume" Text="Volume" Min=0 Max=1
""";

var doc = UiDslParser.Parse(dslText);

DuxelWindowsApp.Run(new DuxelAppOptions
{
    Window = new DuxelWindowOptions { Title = "DSL Hello" },
    Dsl = new DuxelDslOptions
    {
        State = new UiDslState(),
        Render = emitter => doc.Emit(emitter)
    }
});

프로젝트 참조 방식

<ItemGroup>
  <ProjectReference Include="src/Duxel.App/Duxel.App.csproj" />
</ItemGroup>

샘플

프로젝트 샘플

프로젝트 설명 실행
Duxel.Sample DSL .ui + 소스 생성기 + 바인딩 데모 dotnet run --project samples/Duxel.Sample/
Duxel.Sample.NativeAot NativeAOT 배포 검증 (DSL + AOT) dotnet publish -c Release
Duxel.PerfTest 대량 폴리곤 물리 시뮬레이션 성능 벤치마크 dotnet run --project samples/Duxel.PerfTest/

FBA 샘플 (samples/fba/)

FBA(File-Based App)는 단일 .cs 파일로 dotnet run만으로 바로 실행할 수 있는 샘플이며, 개발용 run-fba.ps1는 기본적으로 NativeAOT 게시를 수행합니다.

# NuGet 패키지 참조(외부 사용자)
dotnet run samples/fba/all_features.cs

# 로컬 프로젝트 참조(개발자, 기본 NativeAOT)
./run-fba.ps1 samples/fba/all_features.cs

# 로컬 프로젝트 참조(개발자, Managed 실행)
./run-fba.ps1 samples/fba/all_features.cs -Managed

# 기본 동작 프로필 전환(코드 기본값: Display)
$env:DUXEL_APP_PROFILE='render'; ./run-fba.ps1 samples/fba/Duxel_perf_test_fba.cs -Managed
파일 모드 설명
all_features.cs 즉시 모드 전체 위젯 종합 데모 (400+ API 사용)
dsl_showcase.cs DSL DSL 정적 레이아웃 — 입력/탭/테이블/트리
dsl_interaction.cs DSL DSL 인터랙션 — Drag/Slider/Color/Child/Popup
menu_submenu_zorder.cs DSL 메뉴/서브메뉴 중첩 Z-Order 테스트
advanced_layout.cs 즉시 모드 PushID, Cursor, Scroll, StyleVar, ClipRect
columns_demo.cs 즉시 모드 Legacy Columns API 전체 시연
image_and_popups.cs 즉시 모드 Image/Popup/Tooltip/TreeNodeV/TextLink
image_widget_effects_fba.cs 즉시 모드 웹 PNG/JPG/GIF + GIF 애니메이션 + 이미지 효과(Zoom/Rotation/Alpha/Pixelate)
input_queries.cs 즉시 모드 키보드/마우스 상태, Shortcut, 클립보드
item_status.cs 즉시 모드 IsItemActive/Focused/Clicked, MultiSelect
Duxel_perf_test_fba.cs 즉시 모드 대량 폴리곤 물리 시뮬레이션 성능 벤치마크
ui_mixed_stress.cs 즉시 모드 다중 창/텍스트/테이블/리스트/입력/드로우 복합 스트레스

성능 자동 비교 스크립트(./scripts/run-fba-bench.ps1)의 기본 동작은 아래 2개 샘플을 순차 벤치합니다.

  • samples/fba/Duxel_perf_test_fba.cs
  • samples/fba/ui_mixed_stress.cs

단일 샘플만 벤치하려면 -SamplePath를 사용합니다.

./scripts/run-fba-bench.ps1 -SamplePath samples/fba/Duxel_perf_test_fba.cs

UI DSL

Duxel은 .ui 확장자의 선언적 DSL로 UI를 정의할 수 있습니다.

Window "My App"
  MenuBar
    Menu "File"
      MenuItem Id="new" Text="New"
      MenuItem Id="exit" Text="Exit"
  Row
    Button Id="play" Text="Play"
    Checkbox Id="vsync" Text="VSync" Default=true
  SliderFloat Id="volume" Text="Volume" Min=0 Max=1
  Combo Id="quality" Text="Quality" Items="Low|Medium|High"
  TabBar "tabs"
    TabItem "Settings"
      Text "Settings content"
    TabItem "About"
      Text "About content"

DSL 상세 문서: docs/ui-dsl.md

아키텍처

┌──────────────┐
│  DuxelApp    │  ← 앱 진입점 (옵션/DSL/테마 설정)
├──────────────┤
│  UiContext   │  ← 프레임 라이프사이클 (NewFrame → UI → Render → GetDrawData)
│  UiImmediate │  ← 즉시 모드 위젯 API (400+ 메서드)
│  Context     │
├──────────────┤
│  DSL Runtime │  ← .ui 파서/AST/이미터/상태 바인딩
│  DSL Gen     │  ← .ui → C# 소스 생성기
├──────────────┤
│  Vulkan      │  ← 렌더러 (DrawData 소비, 파이프라인/버퍼/텍스처 관리)
│  Renderer    │
├──────────────┤
│  GLFW        │  ← 윈도우/입력 백엔드
│  Platform    │
└──────────────┘

API 옵션

DuxelApp.Run(new DuxelAppOptions
{
    Window = new DuxelWindowOptions
    {
        Width = 1280,          // 기본값
        Height = 720,
        Title = "Duxel",
        VSync = true
    },
    Renderer = new DuxelRendererOptions
    {
        MinImageCount = 3,     // Triple Buffering
      EnableValidationLayers = false,
      Profile = DuxelPerformanceProfile.Display, // Display|Render
      MsaaSamples = 0         // 0=프로필 기본값, 또는 1/2/4/8 강제
    },
    Font = new DuxelFontOptions
    {
        FontSize = 26,
        FastStartup = true,    // Built-in ASCII → 비동기 TTF 전환
        InitialGlyphs = ["한글 글리프 문자열"]
    },
    Theme = UiTheme.ImGuiDark, // Dark/Light/Classic
    Screen = new MyScreen()    // 또는 Dsl = new DuxelDslOptions { ... }
});

빌드

dotnet build
dotnet run --project samples/Duxel.Sample/

NativeAOT 배포

dotnet publish samples/Duxel.Sample.NativeAot/ -c Release

문서

라이선스

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0-preview 37 3/9/2026
0.1.15-preview 38 3/4/2026
0.1.14-preview 44 2/27/2026
0.1.13-preview 47 2/20/2026
0.1.12-preview 44 2/20/2026
0.1.11-preview 45 2/17/2026
0.1.10-preview 69 2/15/2026
0.1.9-preview 47 2/14/2026
0.1.8-preview 49 2/14/2026