<commit_before>#include <math.h>
#include "geometry.h"

#include <GL/gl.h>

static GLdouble vertices[POLYGON_DEPTH][NUMBER_OF_COORDINATES];

static const GLfloat colors[NUMBER_OF_ELEMENTS][NUMBER_OF_COMPONENTS] = {
    { 0, 0, 1, OPACITY, }, /* "Black Tortoise" (water, north) */
    { 1, 1, 1, OPACITY, }, /* "White Tiger" (metal, west) */
    { 1, 1, 0, OPACITY, }, /* "Yellow Dragon" (earth, center) */
    { 1, 0, 0, OPACITY, }, /* "Vermillion Bird" (fire, south) */
    { 0, 1, 0, OPACITY, }, /* "Green Dragon" (wood, east) */
};

GLvoid init_GL_state(void)
{
    GLfloat point_size_limits[2];
    GLfloat point_size;
    register size_t vertex_ID;

    for (vertex_ID = 0; vertex_ID < POLYGON_DEPTH; vertex_ID++) {
        vertices[vertex_ID][X] = cosd(ROTATION + INTERVAL*vertex_ID);
        vertices[vertex_ID][Y] = sind(ROTATION + INTERVAL*vertex_ID);
        vertices[vertex_ID][Z] = PLANE_Z;
        vertices[vertex_ID][W] = 1.0 / RADIUS;
    }

    glEnable(GL_BLEND);<commit_msg>Vertically center the pentagon to avoid off-screen rendering.<commit_after>#include <math.h>
#include "geometry.h"

#include <GL/gl.h>

static GLdouble vertices[POLYGON_DEPTH][NUMBER_OF_COORDINATES];

static const GLfloat colors[NUMBER_OF_ELEMENTS][NUMBER_OF_COMPONENTS] = {
    { 0, 0, 1, OPACITY, }, /* "Black Tortoise" (water, north) */
    { 1, 1, 1, OPACITY, }, /* "White Tiger" (metal, west) */
    { 1, 1, 0, OPACITY, }, /* "Yellow Dragon" (earth, center) */
    { 1, 0, 0, OPACITY, }, /* "Vermillion Bird" (fire, south) */
    { 0, 1, 0, OPACITY, }, /* "Green Dragon" (wood, east) */
};

GLvoid init_GL_state(void)
{
    GLfloat point_size_limits[2];
    GLfloat point_size;
    double distance_between_polygon_and_screen_boundary;
    register size_t vertex_ID;

    for (vertex_ID = 0; vertex_ID < POLYGON_DEPTH; vertex_ID++) {
        vertices[vertex_ID][X] = cosd(ROTATION + INTERVAL*vertex_ID);
        vertices[vertex_ID][Y] = sind(ROTATION + INTERVAL*vertex_ID);
        vertices[vertex_ID][Z] = PLANE_Z;
        vertices[vertex_ID][W] = 1.0 / RADIUS;
    }

/*
 * Now drop the pentagon lower, slightly, to vertically center it on the
 * screen and minimize the chance of rendering outside the OpenGL canvas.
 */
    distance_between_polygon_and_screen_boundary = 1 + vertices[FIRE][Y];
    for (vertex_ID = 0; vertex_ID < POLYGON_DEPTH; vertex_ID++)
        vertices[vertex_ID][Y] -=
            distance_between_polygon_and_screen_boundary
          / 2
        ;

    glEnable(GL_BLEND);
{'fraction_non_alphanumeric': 0.14537444933920704, 'fraction_numerical': 0.016419703644373247, 'mean_word_length': 3.6173752310536043, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 7, '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': '3037106', 'n_tokens_mistral': 986, 'n_tokens_neox': 919, 'n_words': 203}