12 Commits

Author SHA1 Message Date
gentlegiantJGC
8de6846c79
Fix construction of GLContextAttrs (#1073)
* 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.
2024-07-05 13:23:37 +01:00
gentlegiantJGC
dd7146b079
Hopefully improve OpenGL context creation (#1053)
* 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
2024-05-29 09:07:17 +01:00
gentlegiantJGC
47243392b8 Fix opengl on windows 2023-01-14 09:39:11 +00:00
gentlegiantJGC
7de65e423f Fixed opengl issue on MacOS 2022-12-12 11:55:06 +00:00
gentlegiantJGC
64cee77dcc Removed debug print line 2022-05-15 11:02:23 +01:00
gentlegiantJGC
be71b10398 Fixed a chunk loading issue
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.
2022-05-14 17:00:57 +01:00
gentlegiantJGC
047e5bb508 Improved the OpenGL handling
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.
2022-05-14 15:19:45 +01:00
gentlegiantJGC
2aa9506079 Added a loading bar when closing the world if it takes more than 200ms
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.
2021-06-23 12:27:24 +01:00
gentlegiantJGC
0ae6ffcd11 Attempt to fix opengl again 2021-02-23 09:43:23 +00:00
gentlegiantJGC
c21356c091 Set opengl version to 2.1
It looks like if a newer version is supported that will be used regardless
2021-02-17 13:36:37 +00:00
gentlegiantJGC
0509d2dd4f Added support for OpenGL 2.1 2021-02-17 11:48:28 +00:00
gentlegiantJGC
805fba2a48 Moved the event canvas into the main api package 2021-01-20 14:14:48 +00:00