Package com.leia.sdk.graphics
Class GLContextTracker
- java.lang.Object
-
- com.leia.sdk.graphics.GLContextTracker
-
public class GLContextTracker extends Object
GLContextTracker is a utility class to track GL context validity.
-
-
Constructor Summary
Constructors Constructor Description GLContextTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
init()
Capture current thread id and GL context.boolean
isValid()
Use it to determine whether GL resources can be released on this thread.void
reset()
Reset thread id and GL context.
-
-
-
Method Detail
-
init
public void init()
Capture current thread id and GL context. After it's safe to callisValid()
.
-
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.
-
-