예제 #1
0
파일: text.cpp 프로젝트: arrosado/2d-engine
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();
}
예제 #2
0
파일: main.cpp 프로젝트: arrosado/2d-engine
bool PointinRect(Point p, ScreenRect r)
{
	return p.x >= r.fLeft() && p.x <= r.fRight() && p.y<=r.fBottom() && p.y >= r.fTop();
}