<commit_before>package com.sometrik.framework;

import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.content.res.AssetManager;
import android.opengl.EGLConfig;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.DisplayMetrics;

public class MyGLRenderer implements GLSurfaceView.Renderer {

  private MyGLRenderer renderer;
  public Handler mHandler;
  AssetManager assetManager;
  MyGLSurfaceView GLView;
  FrameWork frame;
  Context context;
  float xSize;
  float ySize;
  long endTime;
  long startTime;

  public native void nativeOnDraw();

  public native void onInit(AssetManager assetManager, MyGLSurfaceView view, float xSize, float ySize, float displayScale, Boolean hasEs3);

  public native void Draw();

  public native void onResize(float xSize, float ySize);

  public native void onTouchesBegin(int fingerIndex);

  public native void onTouchesEnded(int fingerIndex);

  public native void onTouchesMoved(int fingerIndex);

  public MyGLRenderer(Context context, float x, float y) {

    frame = (FrameWork) context;
    startTime = System.currentTimeMillis();
    assetManager = context.getAssets();
    this.xSize = x;
    this.ySize = y;
  }

  public void onDrawFrame(GL10 unused) {
      // Calls onDraw in AndroidPlatform
      nativeOnDraw();
  }

  public void onSurfaceChanged(GL10 unused, int width, int height) {
    System.out.println("(Renderer) onSurfaceChanged called");
    GLES20.glViewport(0, 0, width, height);

    onResize(width, height);
  }

  @Override
  public void onSurfaceCreated(GL10 gl, javax.microedition.khronos.egl.EGLConfig config) {
    System.out.println("(Renderer)onSurfaceCreated(override) called");

    renderer = this;
    System.out.println("surface check: " + frame.getSurfaceView());

    DisplayMetrics displayMetrics = frame.getDisplayMetrics();
    System.out.println("Display scale: " + displayMetrics.scaledDensity);
    // Calls onInit in AndroidPlatform
    onInit(assetManager, frame.getSurfaceView(), xSize, ySize, displayMetrics.scaledDensity, false);

    xSize = displayMetrics.widthPixels / displayMetrics.scaledDensity;
    ySize = displayMetrics.heightPixels / displayMetrics.scaledDensity;

  }

  // Wanhaa
  public static int loadShader(int type, String shaderCode) {

    // create a vertex shader type (GLES20.GL_VERTEX_SHADER)
    // or a fragment shader type (GLES20.GL_FRAGMENT_SHADER)
    int shader = GLES20.glCreateShader(type);

    // add the source code to the shader and compile it
    GLES20.glShaderSource(shader, shaderCode);
    GLES20.glCompileShader(shader);

    return shader;
  }

}<commit_msg>Remove unused code<commit_after>package com.sometrik.framework;

import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.content.res.AssetManager;
import android.opengl.EGLConfig;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.DisplayMetrics;

public class MyGLRenderer implements GLSurfaceView.Renderer {

  private MyGLRenderer renderer;
  public Handler mHandler;
  AssetManager assetManager;
  MyGLSurfaceView GLView;
  FrameWork frame;
  Context context;
  float xSize;
  float ySize;
  long endTime;
  long startTime;

  public native void nativeOnDraw();

  public native void onInit(AssetManager assetManager, MyGLSurfaceView view, float xSize, float ySize, float displayScale, Boolean hasEs3);

  public native void Draw();

  public native void onResize(float xSize, float ySize);

  public native void onTouchesBegin(int fingerIndex);

  public native void onTouchesEnded(int fingerIndex);

  public native void onTouchesMoved(int fingerIndex);

  public MyGLRenderer(Context context, float x, float y) {

    frame = (FrameWork) context;
    startTime = System.currentTimeMillis();
    assetManager = context.getAssets();
    this.xSize = x;
    this.ySize = y;
  }

  public void onDrawFrame(GL10 unused) {
      // Calls onDraw in AndroidPlatform
      nativeOnDraw();
  }

  public void onSurfaceChanged(GL10 unused, int width, int height) {
    System.out.println("(Renderer) onSurfaceChanged called");
    GLES20.glViewport(0, 0, width, height);

    onResize(width, height);
  }

  @Override
  public void onSurfaceCreated(GL10 gl, javax.microedition.khronos.egl.EGLConfig config) {
    System.out.println("(Renderer)onSurfaceCreated(override) called");

    renderer = this;
    System.out.println("surface check: " + frame.getSurfaceView());

    DisplayMetrics displayMetrics = frame.getDisplayMetrics();
    System.out.println("Display scale: " + displayMetrics.scaledDensity);
    // Calls onInit in AndroidPlatform
    onInit(assetManager, frame.getSurfaceView(), xSize, ySize, displayMetrics.scaledDensity, false);

    xSize = displayMetrics.widthPixels / displayMetrics.scaledDensity;
    ySize = displayMetrics.heightPixels / displayMetrics.scaledDensity;

  }

}
{'fraction_non_alphanumeric': 0.0904640689250049, 'fraction_numerical': 0.007832386919913843, 'mean_word_length': 4.534127843986999, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1081846', 'n_tokens_mistral': 1591, 'n_tokens_neox': 1521, 'n_words': 388}