Duxel.Windows.App 0.1.10-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.10-preview
                    
NuGet\Install-Package Duxel.Windows.App -Version 0.1.10-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.10-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.10-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.10-preview
                    
#r "nuget: Duxel.Windows.App, 0.1.10-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.10-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.10-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Duxel.Windows.App&version=0.1.10-preview&prerelease
                    
Install as a Cake Tool

Duxel

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

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

NuGet License: MIT

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

0.1.10-preview 개선 사항 (최신)

  • 레이어 캐시 Texture 백엔드에서 opacity 태그가 포함된 정적 태그(...:cbt:oXXXXXXXX)를 올바르게 판별하도록 수정해 compose 재사용 경로가 안정 동작합니다.
  • idle_layer_validation FBA 샘플에 DUXEL_LAYER_BENCH_OPACITY 환경변수를 추가해 opacity 회귀 벤치를 자동화할 수 있습니다.
  • Duxel_perf_test_fba의 충돌 반응에 각속도/회전 방향 충격과 감쇠를 추가해 충돌 시 회전 연출이 물리 상태와 함께 변합니다.
  • 성능 샘플/벤치 실행 기본 정책(요청 프레임/아이들 스킵)에 맞춰 최신 최적화 경로를 검증했습니다.

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

주요 특징

  • 즉시 모드 UI — 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 호환성 — 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.Windows.App/Duxel.Windows.App.csproj" />
</ItemGroup>

샘플

프로젝트 샘플

프로젝트 설명 실행
Duxel.Sample DSL .ui + 소스 생성기 + 바인딩 데모 dotnet run --project samples/Duxel.Sample/

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 배포 (DSL 프로젝트 샘플)

dotnet publish samples/Duxel.Sample/ -c Release -r win-x64 /p:PublishAot=true

문서

라이선스

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.2-preview 46 4/2/2026
0.2.1-preview 48 3/25/2026
0.2.0-preview 47 3/9/2026
0.1.15-preview 45 3/4/2026
0.1.14-preview 48 2/27/2026
0.1.13-preview 50 2/20/2026
0.1.12-preview 48 2/20/2026
0.1.11-preview 48 2/17/2026
0.1.10-preview 72 2/15/2026
0.1.9-preview 50 2/14/2026
0.1.8-preview 51 2/14/2026