DirectX10/ShapDX 自定義控件 (DirectX10/ShapDX Custom control)


問題描述

DirectX10/ShapDX 自定義控件 (DirectX10/ShapDX Custom control)

我正在嘗試使用 directx10/direct2D 輸出(面板,而不是表單)創建自定義控件。我在重寫的 OnPaint 方法中進行所有渲染,但是我在某處讀到它是錯誤的,應該改用 RenderLoop。但是,如果我只能在控件內部編寫代碼,我應該在哪裡插入 RenderLoop.Run?謝謝。


參考解法

方法 1:

You would create a thread, and have RenderLoop.Run inside the thread. When you do this you have to make sure that events sent back and forth between the components are invoked in a safe manner.

(by user1500581Spizmar)

參考文件

  1. DirectX10/ShapDX Custom control (CC BY‑SA 2.5/3.0/4.0)

#slimdx #sharpdx #direct2d #directx






相關問題

使用紋理作為渲染目標時的大小限制 (Size limitation when using a texture as a render target)

如何安全地將事件傳遞到線程中。SlimDX / DX9 (How to safely pass events into a thread. SlimDX / DX9)

將directdx轉換為slimdx (Converting directdx to slimdx)

Toán véc tơ nhanh trong .NET - Các tùy chọn là gì? (Fast Vector Math in .NET - What are the options?)

DirectX10/ShapDX 自定義控件 (DirectX10/ShapDX Custom control)

使用 GDI 繪製散點圖太慢 (Drawing scatter plot is too slow with GDI)

防止 Direct3D 視口圖像縮放 (SlimDX) (Prevent Direct3D viewport image from scaling (SlimDX))

如何使用 SlimDX 設置 HLSL 統一變量的值? (How do I set the value of a HLSL uniform variable with SlimDX?)

使用 Direct3D 繪製帶有圓角末端的線條 (Drawing lines with rounded endings with Direct3D)

如何使圖元在 DirectX (2D) 中正確覆蓋精靈 (How to make primitives correctly overlay sprites in DirectX (2D))

多個渲染目標不保存數據 (Multiple Render Targets not saving data)

SlimDX VertexDeclaration 內存洩漏?- 如何避免? (SlimDX VertexDeclaration memory leak? - How to avoid it?)







留言討論