
destroy GameWindow
Posted Thursday, 7 May, 2009 - 10:10 by puklaus inHey.
Im using window that is created by GameWindow, but im not using its loop (Run()).
I have problem when I stop program, it always crashes (stack trace etc) on
linux, so I made new method (copied from GameWindow.cs, from Run() methods):
public void DestroyGameWindow() { OnUnloadInternal(EventArgs.Empty); if (Exists) { glContext.Dispose(); glContext = null; glWindow.DestroyWindow(); } while (this.Exists) this.ProcessEvents(); }
and when I call that on my Destroy() method, it works, no crash.
So, is there another way to do this because this is kind of hack?
Or then maybe add this or like this in the opentk?


Comments
Re: destroy GameWindow
Yes, OpenTK will gain support for custom main loops. You will simply inherit from GameWindow (or NativeWindow) and override the implementation (or even provide a completely custom interface in the case of the NativeWindow).
The work right now goes to the gw-next branch, but it is not yet ready for public consumption.
Re: destroy GameWindow
"You will simply inherit from GameWindow "
:) I think im tired, i havent even think that when I start modified opentk sources.
So i made this, and it seems work because linux doesnt throw stacks:
Thanks :)