You can put a canvas into a window's body and do the game logic after the window's creation. Simple enough, right?