thanks. you are right. (should work with qt as well. i will try)
Windows Form
public partial class Form1 : Form
{
UnitTestMitForm game;
public Form1() {
InitializeComponent();
game = new UnitTestMitForm(this.Handle);
game.Run();
}
public void RenderFrame() {
game.RenderFrame();
}
}
Game.RenderFrame()
public void RenderFrame() {
float deltaTime = window.GetFrameTime();
// Events feuern
window.DispatchEvents();
// spiel aktualisieren
Update(deltaTime);
// spiel malen
window.Clear();
Draw(gameDrawer, deltaTime);
window.Display();
}
Program
Form1 form = new Form1();
form.Show();
while(form.Created) {
form.RenderFrame();
Application.DoEvents();
}
seems to work. i will try to use it and i will see if there is something wrong i cant see right now.