Finally, I found a way to delete the scene. Specifically I delete the objects, not the world itself.
using System;
using System.Drawing;
using System.Windows.Forms;
using DarkGDK;
namespace Test
{
public partial class MainForm : Form
{
private DarkGDK.Basic3D.Cube cube;
private Timer timer;
public MainForm()
{
InitializeComponent();
timer = new Timer();
timer.Interval = 10;
timer.Tick += new EventHandler(timer_Tick);
}
void timer_Tick(object sender, EventArgs e)
{
cube.RotateRelative(1f, 0.5f, 0.8f);
DarkGDK.Core.Sync();
}
protected override void OnLoad(EventArgs e)
{
Start();
timer.Start();
}
private void Start()
{
DarkGDK.Core.Sync();
DarkGDK.Basic3D.Basic3D.FlushVideoMemory();
cube = new DarkGDK.Basic3D.Cube(1f);
System.Diagnostics.Debug.WriteLine(cube.Id.ToString());
}
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
DarkGDK.Engine.StopGDKLoop();
}
void ButtonRestartClick(object sender, System.EventArgs e)
{
timer.Stop();
cube.Delete();
Start();
timer.Start();
}
}
}