mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 05:41:51 +09:00
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
23 lines
634 B
Java
23 lines
634 B
Java
package org.newdawn.slick.opengl;
|
|
|
|
import org.newdawn.slick.opengl.renderer.Renderer;
|
|
|
|
/**
|
|
* A collection of utilities to allow aid interaction with the GL provider
|
|
*
|
|
* @author kevin
|
|
*/
|
|
public final class GLUtils {
|
|
|
|
/**
|
|
* Check that we're in the right place to be doing GL operations
|
|
*/
|
|
public static void checkGLContext() {
|
|
try {
|
|
Renderer.get().glGetError();
|
|
} catch (NullPointerException e) {
|
|
throw new RuntimeException("OpenGL based resources (images, fonts, sprites etc) must be loaded as part of init() or the game loop. They cannot be loaded before initialisation.");
|
|
}
|
|
}
|
|
}
|