コード例 #1
0
ファイル: Renderer.cpp プロジェクト: trudeHisa/workspace
void Renderer::DrawString(const std::string& text, const GSvector2* _position, const GSuint size,
	const GScolor* _color, const GSbitfield& fontcode,const char* fontname)
{
	gsFontParameter(fontcode,size,fontname);
	glColor4f(_color->r, _color->g, _color->b, _color->a);
	gsTextPos(_position->x, _position->y);
	gsDrawText(text.c_str());
}
コード例 #2
0
	void ShootingApplication::draw()
	{
		scemeManager.draw();

		//fpsっぽいもの
		frame += 1;
		nowtime = clock();
		if (nowtime - basetime > 1000)
		{
			fps = frame * 1000.0 / (nowtime - basetime);
			basetime = nowtime;
			frame = 0;
		}
		int fps_ = (fps - (int)fps) * 10;
		gsFontParameter(1, 24, "MS 明朝");
		gsTextPos(900, 700);
		gsDrawText("%i.%i fps", (int)fps, fps_);
	}