All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mathiewz.slick.opengl.GLUtils Maven / Gradle / Ivy

Go to download

The main purpose of this libraryis to modernize and maintain the slick2D library.

The newest version!
package com.github.mathiewz.slick.opengl;

import com.github.mathiewz.slick.SlickException;
import com.github.mathiewz.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 SlickException("OpenGL based resources (images, fonts, sprites etc) must be loaded as part of init() or the game loop. They cannot be loaded before initialisation.");
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy