Application crashes during GraphicsWindow method

Some of your global variables like GFXWindow never get initializes as far I can see.