Class GLContextTracker


  • public class GLContextTracker
    extends Object
    GLContextTracker is a utility class to track GL context validity.
    • Constructor Detail

      • GLContextTracker

        public GLContextTracker()
    • Method Detail

      • init

        public void init()
        Capture current thread id and GL context. After it's safe to call isValid().
      • isValid

        public boolean isValid()
        Use it to determine whether GL resources can be released on this thread. If a GL resource was allocated on another thread or context, there is nothing that can be done in the current scope. The GL resource is either already has been released automatically on GL context release or it will be.
        Returns:
        whether current thread's GL context is the one init() was called with.
      • reset

        public void reset()
        Reset thread id and GL context.