mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-14 23:56:07 +09:00
added sources for Slick
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
This commit is contained in:
22
lib/slick-source/org/newdawn/slick/opengl/GLUtils.java
Normal file
22
lib/slick-source/org/newdawn/slick/opengl/GLUtils.java
Normal file
@@ -0,0 +1,22 @@
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user