Exemple #1
0
void Font::BitmapCharacter(float x, float y, float w, float h, int character)
{
	WorldRect dstRect(x, y, w, h);
	ScreenRect* psrcRect;
	psrcRect = &atlas->sourceRectangles[character];
	glBegin(GL_QUADS);
	{
		glTexCoord2d(psrcRect->fLeft(), psrcRect->fTop());	glVertex2f(dstRect.iLeft(), dstRect.iBottom());
		glTexCoord2d(psrcRect->fRight(), psrcRect->fTop());	glVertex2f(dstRect.iRight(), dstRect.iBottom());
		glTexCoord2d(psrcRect->fRight(), psrcRect->fBottom());	glVertex2f(dstRect.iRight(),  dstRect.iTop());
		glTexCoord2d(psrcRect->fLeft(), psrcRect->fBottom());	glVertex2f(dstRect.iLeft(),  dstRect.iTop());
	}
	glEnd();
}
Exemple #2
0
bool PointinRect(Point p, ScreenRect r)
{
	return p.x >= r.fLeft() && p.x <= r.fRight() && p.y<=r.fBottom() && p.y >= r.fTop();
}