<commit_before>/*
 * BatteryTech
 * Copyright (c) 2010 Battery Powered Games, LLC.
 *
 * This code is a component of BatteryTech and is subject to the 'BatteryTech
 * End User License Agreement'.  Among other important provisions, this
 * license prohibits the distribution of source code to anyone other than
 * authorized parties.  If you have any questions or would like an additional
 * copy of the license, please contact: <EMAIL>
 */

//============================================================================
// Name        : DemoAppView16.java
// Description : BatteryTech's view for Android 2.0+ - capable of OpenGL ES 1.0/1.1 and 2.0
//============================================================================

package com.batterypoweredgames.batterytech;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;

import com.batterypoweredgames.batterytech.TrueColorEGLConfigChooser;

import android.app.Activity;
import android.content.Context;
import android.graphics.PixelFormat;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.util.Log;

/**
 * Android 2.0+ App View
 * 
 * Supports creating a GLES 1.0, 1.1 and 2.0 context
 * 
 * @author rgreen
 *
 */
public class BatteryTechView20 extends GLSurfaceView implements BatteryTechView {
	private static final String TAG = "DemoAppView";
	
	private static final boolean DEBUG = false;
	
	private BatteryTechRenderer renderer;

	public BatteryTechView20(BatteryTechActivity activity) {
		super(activity);
		boolean usingGLES2 = false;
		GLSettings settings = activity.createGLSettings();
		if (settings.useTrueColor()) {
			getHolder().setFormat(PixelFormat.TRANSLUCENT);
			//setEGLConfigChooser(new TrueColorEGLConfigChooser(DEPTH, STENCIL));
		}
		if (settings.supportGLES2() && checkGL20Support(activity)) {
			initGLES2(settings.useTrueColor(), settings.getDepthBits(), settings.getStencilBits());
			usingGLES2 = true;
		}
		renderer = new BatteryTechRenderer(activity, this, usingGLES2);
		setRenderer(renderer);
		setRenderMode(RENDERMODE_CONTINUOUSLY);
	}
	
	/* (non-Javadoc)
	 * @see com.batterypoweredgames.demoapp.DemoAppView#getRenderer()
	 */
	public BatteryTechRenderer getRenderer() {
		return renderer;
	}
	
	/* (non-Javadoc)
	 * @see com.batterypoweredgames.demoapp.DemoAppView#onPause()
	 */
	@Override
	public void onPause() {<commit_msg>BT2 - fixed GLES 1.x transparency bug<commit_after>/*
 * BatteryTech
 * Copyright (c) 2010 Battery Powered Games, LLC.
 *
 * This code is a component of BatteryTech and is subject to the 'BatteryTech
 * End User License Agreement'.  Among other important provisions, this
 * license prohibits the distribution of source code to anyone other than
 * authorized parties.  If you have any questions or would like an additional
 * copy of the license, please contact: <EMAIL>
 */

//============================================================================
// Name        : DemoAppView16.java
// Description : BatteryTech's view for Android 2.0+ - capable of OpenGL ES 1.0/1.1 and 2.0
//============================================================================

package com.batterypoweredgames.batterytech;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;

import com.batterypoweredgames.batterytech.TrueColorEGLConfigChooser;

import android.app.Activity;
import android.content.Context;
import android.graphics.PixelFormat;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.util.Log;

/**
 * Android 2.0+ App View
 * 
 * Supports creating a GLES 1.0, 1.1 and 2.0 context
 * 
 * @author rgreen
 *
 */
public class BatteryTechView20 extends GLSurfaceView implements BatteryTechView {
	private static final String TAG = "DemoAppView";
	
	private static final boolean DEBUG = false;
	
	private BatteryTechRenderer renderer;

	public BatteryTechView20(BatteryTechActivity activity) {
		super(activity);
		boolean usingGLES2 = false;
		GLSettings settings = activity.createGLSettings();
		if (settings.useTrueColor()) {
			getHolder().setFormat(PixelFormat.TRANSLUCENT);
			//setEGLConfigChooser(new TrueColorEGLConfigChooser(DEPTH, STENCIL));
		}
		if (settings.supportGLES2() && checkGL20Support(activity)) {
			initGLES2(settings.useTrueColor(), settings.getDepthBits(), settings.getStencilBits());
			usingGLES2 = true;
		} else {
			if (settings.useTrueColor()) {
				setEGLConfigChooser(8, 8, 8, 8, settings.getDepthBits(), settings.getStencilBits());
			} else {
				setEGLConfigChooser(5, 6, 5, 0, settings.getDepthBits(), settings.getStencilBits());
			}
		}
		renderer = new BatteryTechRenderer(activity, this, usingGLES2);
		setRenderer(renderer);
		setRenderMode(RENDERMODE_CONTINUOUSLY);
	}
	
	/* (non-Javadoc)
	 * @see com.batterypoweredgames.demoapp.DemoAppView#getRenderer()
	 */
	public BatteryTechRenderer getRenderer() {
		return renderer;
	}
	
	/* (non-Javadoc)
	 * @see com.batterypoweredgames.demoapp.DemoAppView#onPause()
	 */
	@Override
	public void onPause() {
{'fraction_non_alphanumeric': 0.15415396341463414, 'fraction_numerical': 0.01524390243902439, 'mean_word_length': 5.068208092485549, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6127295', 'n_tokens_mistral': 1776, 'n_tokens_neox': 1560, 'n_words': 387}