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.util.Log;

import static android.opengl.GLES20.*;

public class Main {
    private static final String s_LOG_TAG = "AndroidGLES20Util";

    public static int checkGlError() {
        return checkGlError(false);
    }

    public static int checkGlError(boolean throwException) {
        int error = glGetError();
        if (error != GL_NO_ERROR) {
            Log.d(s_LOG_TAG, "GL error = 0x" + Integer.toHexString(error));
            if (throwException) {
                throw new RuntimeException("GL ERROR = 0x" + Integer.toHexString(error));
            }
        }

        return error;
    }
}