<commit_before>package io.indy.beepboard;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.nio.FloatBuffer;

import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.opengl.GLUtils;

import android.util.Log;

class GLBackground
{
    private static final String TAG = "GLBackground";


    private FloatBuffer mVertexBuffer;

    public GLBackground()
    {
    }

    public void setup(GL10 gl, int width, int height)
    {
        float surfaceWidth = (float)width;
        float surfaceHeight = (float)height;

        int tileNumCorners = 4;
        int tileDimensions = 3;
        float[] vertices;
        vertices = new float[tileNumCorners * tileDimensions];

        vertices[ 0] = 0f;
        vertices[ 1] = 0f;
        vertices[ 2] = -0.3f;

        vertices[ 3] = surfaceWidth;
        vertices[ 4] = 0f;
        vertices[ 5] = -0.3f;

        vertices[ 6] = 0f;
        vertices[ 7] = surfaceHeight;
        vertices[ 8] = -0.3f;

        vertices[ 9] = surfaceWidth;
        vertices[10] = surfaceHeight;
        vertices[11] = -0.3f;

        ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);
        vbb.order(ByteOrder.nativeOrder());
        mVertexBuffer = vbb.asFloatBuffer();
        mVertexBuffer.put(vertices);
        mVertexBuffer.position(0);
    }

    public void draw(GL10 gl)
    {
        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mVertexBuffer);

        gl.glColor4f(0f, 0f, 0f, 0.5f);<commit_msg>background covers calculated plane area<commit_after>package io.indy.beepboard;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.nio.FloatBuffer;

import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.opengl.GLUtils;

import android.util.Log;

class GLBackground
{
    private static final String TAG = "GLBackground";


    private FloatBuffer mVertexBuffer;

    public GLBackground()
    {
    }

    public void setup(GL10 gl, float width, float height, float fov)
    {
        float surfaceWidth = width;
        float surfaceHeight = height;

        float rfov = (float)Math.toRadians(fov);
        float planeDistance = 100f;
        float planeHeight = 2f * planeDistance * (float)Math.sin(rfov/2f);
        float planeWidth = (width/height) * planeHeight;
        float planeMaxSize = Math.min(planeWidth, planeHeight);


        int tileNumCorners = 4;
        int tileDimensions = 3;
        float[] vertices;
        vertices = new float[tileNumCorners * tileDimensions];

        vertices[ 0] = -(planeWidth / 2f);
        vertices[ 1] = -(planeHeight / 2f);
        vertices[ 2] = -planeDistance;

        vertices[ 3] = (planeWidth / 2f);
        vertices[ 4] = -(planeHeight / 2f);
        vertices[ 5] = -planeDistance;

        vertices[ 6] = -(planeWidth / 2f);
        vertices[ 7] = (planeHeight / 2f);
        vertices[ 8] = -planeDistance;

        vertices[ 9] = (planeWidth / 2f);
        vertices[10] = (planeHeight / 2f);
        vertices[11] = -planeDistance;

        ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);
        vbb.order(ByteOrder.nativeOrder());
        mVertexBuffer = vbb.asFloatBuffer();
        mVertexBuffer.put(vertices);
        mVertexBuffer.position(0);
    }

    public void draw(GL10 gl)
    {
        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mVertexBuffer);

        gl.glColor4f(0f, 1f, 0f, 0.5f);
{'fraction_non_alphanumeric': 0.11123348017621146, 'fraction_numerical': 0.025605726872246697, 'mean_word_length': 2.6659939455095865, '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': '5203180', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1143, 'n_words': 264}