WorldWind中显示图像的是一个继承自Control的WorldWindow控件,代码:
public class WorldWindow : Control, IGlobe
初始化代码:
public WorldWindow() { } |
初始化代码中主要的是:
(1) 设置窗体的样式:
(2) 初始化DirectX,具体的关于DirectX的初始化参见《WorldWind-Direct3D的初始化》 :
WorldWindow控件的 OnPaint() 方法:
protected override void OnPaint(PaintEventArgs e) { } |
从代码中可以看出,主要的渲染操作都存在于 Render() 方法中。
Render()方法:
public void Render() { } |
图像逻辑处理线程方法:
private void WorkerThreadFunc() { } |
WorldWind渲染循环:
/// <summary> /// The world render loop. /// </summary> public void OnApplicationIdle(object sender, EventArgs e) { } |
IsAppStillIdle属性
/// <summary> /// Determine whether any window messages is queued. /// </summary> private static bool IsAppStillIdle { } |
WorldWind的渲染循环是在 Application Idle 时进行的:
Application.ThreadException += new ThreadExceptionEventHand MainApplication app = new MainApplication(); Application.Idle += new EventHandler(app.WorldWindow.OnApplicationIdle); Application.Run(app); |