Ejemplo n.º 1
0
	void drawGradQuad(const FRect &rect, Color a, Color b, bool is_vertical) {
		Color colors[4] = { a, b, b, a };
		if(is_vertical)
			swap(colors[1], colors[3]);
		drawQuad(rect, FRect(0, 0, 1, 1), colors);
	}
Ejemplo n.º 2
0
void ANGLETest::drawQuad(GLuint program,
                         const std::string &positionAttribName,
                         GLfloat positionAttribZ)
{
    drawQuad(program, positionAttribName, positionAttribZ, 1.0f);
}
Ejemplo n.º 3
0
void IplTexture::drawQuad(float r) {
    drawQuad(-r,-r,2*r,2*r);
}
Ejemplo n.º 4
0
void TextObject::draw(bool outlined, float x, float y) {
	glEnable(0x84F5); //GL_TEXTURE_RECTANGLE_NV = GL_TEXTURE_RECTANGLE_ARB = 0x84F5

	glBindTexture(m_texture->getType(), m_texture->getTextureId());

	glPushMatrix();

	glRotatef(0.0f, 0.0f, 0.0f, 1.0f);
	glScalef(1.0f, 1.0f, 1.0f);
	glColor4f(0.0f, 0.0f, 0.0f, pow(AMask, 2));

	glPushMatrix();
	glTranslatef(x - 1.0f, y, 0.0f);
	drawQuad();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(x - 1.0f, y - 1.0f, 0.0f);
	drawQuad();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(x, y - 1.0f, 0.0f);
	drawQuad();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(x + 1.0f, y - 1.0f, 0.0f);
	drawQuad();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(x + 1.0f, y, 0.0f);
	drawQuad();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(x + 1.0f, y + 1.0f, 0.0f);
	drawQuad();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(x, y + 1.0f, 0.0f);
	drawQuad();
	glPopMatrix();

	glPushMatrix();
	glTranslatef(x - 1.0f, y + 1.0f, 0.0f);
	drawQuad();
	glPopMatrix();

	glColor4f(RMask, GMask, BMask, AMask);

	glPushMatrix();
	glTranslatef(x, y, 0.0f);
	drawQuad();
	glPopMatrix();

	glPopMatrix();

	glDisable(0x84F5); //GL_TEXTURE_RECTANGLE_NV = GL_TEXTURE_RECTANGLE_ARB = 0x84F5
}
Ejemplo n.º 5
0
void drawHexahedron(GLint textureWidth, GLint textureHeight, const Point_t& fbl, const Point_t& fbr, const Point_t& ftl, const Point_t& ftr,
		      	  	  	  	  	  	  	  	  	  	         const Point_t& bbl, const Point_t& bbr, const Point_t& btl, const Point_t& btr, bool flipped) {

	//Left Side
	// fbl
	// ftl
	// btl
	// bbl
	GLdouble leftSide[] = {fbl.x, fbl.y, fbl.z,
			   	   	   	   ftl.x, ftl.y, ftl.z,
						   btl.x, btl.y, btl.z,
						   bbl.x, bbl.y, bbl.z};
	//Right side
	// fbr
	// ftr
	// btr
	// bbr
	GLdouble rightSide[] = {fbr.x, fbr.y, fbr.z,
			   	   	   	    ftr.x, ftr.y, ftr.z,
						    btr.x, btr.y, btr.z,
						    bbr.x, bbr.y, bbr.z};
	//Top side
	// btr
	// btl
	// ftl
	// ftr
	GLdouble topSide[] = {btr.x, btr.y, btr.z,
			   	   	   	  btl.x, btl.y, btl.z,
						  ftl.x, ftl.y, ftl.z,
						  ftr.x, ftr.y, ftr.z};
	//Bottom side
	// bbr
	// bbl
	// fbl
	// fbr
	GLdouble bottomSide[] = {bbr.x, bbr.y, bbr.z,
			   	   	   	     bbl.x, bbl.y, bbl.z,
						     fbl.x, fbl.y, fbl.z,
						     fbr.x, fbr.y, fbr.z};
	//Front side
	// fbr
	// fbl
	// ftl
	// ftr
	GLdouble frontSide[] = {fbr.x, fbr.y, fbr.z,
			   	   	   	    fbl.x, fbl.y, fbl.z,
						    ftl.x, ftl.y, ftl.z,
						    ftr.x, ftr.y, ftr.z};

	//Back side
	// bbr
	// bbl
	// btl
	// btr
	GLdouble backSide[] = {bbr.x, bbr.y, bbr.z,
			   	   	   	   bbl.x, bbl.y, bbl.z,
						   btl.x, btl.y, btl.z,
						   btr.x, btr.y, btr.z};


	drawQuad(textureWidth, textureHeight, leftSide,flipped);
	drawQuad(textureWidth, textureHeight, rightSide,flipped);
	drawQuad(textureWidth, textureHeight, topSide,flipped);
	drawQuad(textureWidth, textureHeight, bottomSide,flipped);
	drawQuad(textureWidth, textureHeight, frontSide,flipped);
	drawQuad(textureWidth, textureHeight, backSide,flipped);

}