https://github.com/Microsoft/Win2D
microsoft/Win2D
Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration. It is available to C#, C++ and VB developers writing apps for the Windows Universal Platf...
github.com
https://microsoft.github.io/Win2D/html/Introduction.htm
Introduction
Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration. It is available to C#, C++ and VB developers writing apps for the Windows Universal Platform (UWP). It utilizes the power of Direct2D, and integrate
microsoft.github.io
특별한걸 없고 윈도우 런타임 2D 렌더링 API 이다.
게임엔진쓰기는 무겁고 귀찮고, 그렇다고 타이머써서 직접 Update 구현하기도 귀찮아서 찾던도중에 나왔다.
ms 공식이니까 믿고쓸만하고
XAML
<Grid>
<canvas:CanvasAnimatedControl x:Name="RedDotCanvas" Draw="CanvasControl_Draw" Update="CanvasControl_Update" ClearColor="Black"/>
</Grid>
XAML 에서는 Canvas타입과 해당 타입에 맞는 이벤트를 선언해주면 된다.
void CanvasControl_Draw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEventArgs args)
{
//
}
void CanvasControl_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args)
{
//
}
C#에서는 이벤트를 정의해주면 된다.
여기에서는 게임엔진마냥 Update, Draw 이벤트를 사용하였다.
'프로그래밍 언어 노트 > C#' 카테고리의 다른 글
크로스 쓰레드 문제해결하기 (컨트롤 제어하기) (0) | 2019.11.26 |
---|---|
[UWP] Fullscreen (0) | 2019.08.24 |
[C#] C# 으로 작성하는 풀스택 웹앱 Blazor (0) | 2019.07.09 |
[C#] Json / XML to Class 붙여넣기 (0) | 2019.06.30 |
[C#] orderby를 활용한 간단한 셔플 (0) | 2018.12.28 |