Code example for GL10

Methods: glGetString

         * @param gl 
         * @param extension 
         * @return true if the extension is present in the current context. 
        private boolean checkIfContextSupportsExtension(GL10 gl, String extension) {
            String extensions = " " + gl.glGetString(GL10.GL_EXTENSIONS) + " ";
            // The extensions string is padded with spaces between extensions, but not 
            // necessarily at the beginning or end. For simplicity, add spaces at the 
            // beginning and end of the extensions string and the extension string. 
            // This means we can avoid special-case checks for the first or last 
            // extension, as well as avoid special-case checks when an extension name 
            // is the same as the first part of another extension name. 
            return extensions.indexOf(" " + extension + " ") >= 0;
    /** A grid is a topologically rectangular array of vertices. 
     * This grid class is customized for the vertex data required for this 
     * example. 
Stop searching for code, let great code find you!  Add Codota to your java IDE