Skip to content

Instantly share code, notes, and snippets.

@jesusdesantos
Created March 28, 2016 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesusdesantos/1038b749b4908c5dc29e to your computer and use it in GitHub Desktop.
Save jesusdesantos/1038b749b4908c5dc29e to your computer and use it in GitHub Desktop.
How do we detect when Unity recreates the GL context?
1. By using XXXGetCurrentContext (eg: glXGetCurrentContext). Problem: sometimes the context is different but the pointer returned by XXXGetCurrentContext is the same.
2. By using glIsBuffer(name) against a VAO. This is not 100% safe because 'name' could be a valid handle in the current context, one created by Unity for example.
3. Using the native callback API (UnityGfxDeviceEventType). Problem: not implemented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment