<commit_before>/* A colored 3D pyramid
 * by <NAME>
 * June 28 20100100 */

#include "pyramid.h"

pyramid add_pyramid(int x, int y, int w, int h, int texture_id);
void draw_pyramid(void *pp);

pyramid add_pyramid(int x, int y, int w, int h, int texture_id)
{
	pyramid p;

	// allocate and initialize a new pyramid
	p = malloc(sizeof(*p));
	p->x = x;
	p->y = y;
	p->w = w;
	p->h = h;
	p->gl_id = textures[texture_id].gl_id;

	add_object_3d(p, &draw_pyramid, NULL, NULL);
	return p;
}

void draw_pyramid(void *pp)
{
	// restore pyramid structure
	pyramid p = pp;

	glColor3f(1.0,1.0,1.0);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, *p->gl_id);

	glBegin(GL_TRIANGLES);
		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Front)
		glVertex3f(-100.0f,-100.0f, 100.0f);			// Left Of Triangle (Front)
		glVertex3f( 100.0f,-100.0f, 100.0f);			// Right Of Triangle (Front)

		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Right)
		glVertex3f( 100.0f,-100.0f, 100.0f);			// Left Of Triangle (Right)
		glVertex3f( 100.0f,-100.0f, -100.0f);			// Right Of Triangle (Right)

		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Back)
		glVertex3f( 100.0f,-100.0f, -100.0f);			// Left Of Triangle (Back)
		glVertex3f(-100.0f,-100.0f, -100.0f);			// Right Of Triangle (Back)

		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Left)
		glVertex3f(-100.0f,-100.0f,-100.0f);			// Left Of Triangle (Left)
		glVertex3f(-100.0f,-100.0f, 100.0f);			// Right Of Triangle (Left)
	glEnd();						// Done Drawing The Pyramid

	glDisable(GL_TEXTURE_2D);
}<commit_msg>tex coords for pyramid<commit_after>/* A colored 3D pyramid
 * by <NAME>
 * June 28 20100100 */

#include "pyramid.h"

pyramid add_pyramid(int x, int y, int w, int h, int texture_id);
void draw_pyramid(void *pp);

pyramid add_pyramid(int x, int y, int w, int h, int texture_id)
{
	pyramid p;

	// allocate and initialize a new pyramid
	p = malloc(sizeof(*p));
	p->x = x;
	p->y = y;
	p->w = w;
	p->h = h;
	p->gl_id = textures[texture_id].gl_id;

	add_object_3d(p, &draw_pyramid, NULL, NULL);
	return p;
}

void draw_pyramid(void *pp)
{
	// restore pyramid structure
	pyramid p = pp;

	glColor3f(1.0,1.0,1.0);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, *p->gl_id);

	glBegin(GL_TRIANGLES);
		
		glTexCoord2f(0.5,1.);
		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Front)
		glTexCoord2f(0.,0.);
		glVertex3f(-100.0f,-100.0f, 100.0f);			// Left Of Triangle (Front)
		glTexCoord2f(1.,0.);
		glVertex3f( 100.0f,-100.0f, 100.0f);			// Right Of Triangle (Front)

		glTexCoord2f(0.5,1.);
		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Right)
		glTexCoord2f(0.,0.);
		glVertex3f( 100.0f,-100.0f, 100.0f);			// Left Of Triangle (Right)
		glTexCoord2f(1.,0.);
		glVertex3f( 100.0f,-100.0f, -100.0f);			// Right Of Triangle (Right)

		glTexCoord2f(0.5,1.);
		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Back)
		glTexCoord2f(0.,0.);
		glVertex3f( 100.0f,-100.0f, -100.0f);			// Left Of Triangle (Back)
		glTexCoord2f(1.,0.);
		glVertex3f(-100.0f,-100.0f, -100.0f);			// Right Of Triangle (Back)

		glTexCoord2f(0.5,1.);
		glVertex3f( 0.0f, 100.0f, 0.0f);			// Top Of Triangle (Left)
		glTexCoord2f(0.,0.);
		glVertex3f(-100.0f,-100.0f,-100.0f);			// Left Of Triangle (Left)
		glTexCoord2f(1.,0.);
		glVertex3f(-100.0f,-100.0f, 100.0f);			// Right Of Triangle (Left)
	glEnd();						// Done Drawing The Pyramid

	glDisable(GL_TEXTURE_2D);
}
{'fraction_non_alphanumeric': 0.1794425087108014, 'fraction_numerical': 0.10569105691056911, 'mean_word_length': 3.226993865030675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '1721332', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1601, 'n_words': 347}