* Fix construction of GLContextAttrs
EndList returns None. I thought it returned self like the rest of the methods.
* Tweaked OpenGL context construction
The constructors now return the context if everything is valid.
If not valid it returns None.
The OpenGL 2.1 constructor now checks if GL_ARB_explicit_attrib_location is supported by the system.
If the system does not support it an error will be raised at construction rather than when drawing.
* Hopefully improve OpenGL context creation
First try creating a 3.3 core profile.
If that fails try a 2.1 compatibility profile.
If the system does not support OpenGL 2.1 it should fail here rather than generating errors for each frame.
* Reformatted
The previous changes meant that events listening for camera change were not bound when the camera position was set.
This manually sets them on the renderer as well as the camera.
Reading into OpenGL I found some issues with how we were doing things.
OpenGL functions cannot be called until the window is shown which might be the reason some users are getting errors.
Created a function that runs the first time the window is shown. Moved all the initial OpenGL state setting into this function. Enable is run once this function is done.
Other OpenGL initialisation is moved into the drawing functions which are run after the window is shown for the first time.
Some worlds take a while to close (particularly Bedrock which runs the compaction logic on close) and the program will hang while this is happening.
If closing takes more than 200ms a closing dialog will be shown to let the user know that something is happening.
Fixed a recursion issue when closing from the button in the canvas.
Fixed a crash when closing from the button in the canvas and saving.