Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/**
 * Copyright 2015 Michael Leahy / TyphonRT, Inc.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import android.opengl.GLES20;

public class Main {
    /**
     * Checks the GL_EXTENSIONS String for the given "extension". This method must only be called when a valid context
     * and surface is valid.
     *
     * @param extension
     * @return boolean
     */
    public static boolean hasExtension(String extension) {
        String extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS);

        boolean foundExtension = false;

        if (extensions != null) {
            foundExtension = extensions.toLowerCase().contains(extension.toLowerCase());
        }

        return foundExtension;
    }
}