void CTexture::DrawNumStr (const char *s, int x, int y, float size, TColor col) { if (!BindTex ("ziff032")) { Message ("DrawNumStr: missing texture"); return; } glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable (GL_TEXTURE_2D); int qw = (int)(22 * size); int qh = (int)(32 * size); for (int i=0; i<int(strlen(s)); i++) { DrawNumChr (s[i], x + i*qw, y, qw, qh, col); } }
void CTexture::DrawNumStr(const std::string& s, int x, int y, float size, const sf::Color& col) { if (!BindTex(NUMERIC_FONT)) { Message("DrawNumStr: missing texture"); return; } glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_TEXTURE_2D); int qw = (int)(22 * size); int qh = (int)(32 * size); glColor(col); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); for (std::size_t i=0; i < s.size(); i++) { DrawNumChr(s[i], x + (int)i*qw, y, qw, qh); } glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); }