All pastes #453151 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-22 19:54 UTC
rendered paste body
vl_function(void) Draw2D(BITMAP * src,int x,int y) {
	// Set the texture
	GLuint tex=allegro_gl_make_texture(src);
	glBindTexture(GL_TEXTURE_2D,tex);
	
	// Set the texture coordinates, clockwise
	glTexCoord2d(0.0,0.0);
	glTexCoord2d(1.0,0.0);
	glTexCoord2d(1.0,1.0);
	glTexCoord2d(0.0,1.0);

	// Wipe something, can't remember what..
	glLoadIdentity();

	// Start drawing a quad
	glBegin(GL_QUADS);

	// Draw the points, clockwise
	glVertex3f(x,y,0);
	glVertex3f(x+src->w,y,0); 
	glVertex3f(x+src->w,y+src->h,0);
	glVertex3f(x,y+src->w,0);

	// Finished now :)
	glEnd();
}