問題描述
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 user1500581、Spizmar)