Distributed under the LGPL
*/
-#include <GL/gl.h>
+#include "gl.h"
#include "font.h"
#include "texture2d.h"
create_glyph_vertices(glyph, *va_builder);
}
-float Font::get_string_width(const string &str) const
-{
- float x=0;
-
- for(string::const_iterator i=str.begin(); i!=str.end(); ++i)
- x+=get_glyph_advance(static_cast<unsigned char>(*i));
-
- return x;
-}
-
float Font::get_string_width(const string &str, Codecs::Decoder &dec) const
{
float x=0;
return x;
}
-void Font::draw_string(const string &str) const
-{
- prepare_render();
-
- for(string::const_iterator i=str.begin(); i!=str.end(); ++i)
- draw_glyph(static_cast<unsigned char>(*i));
-
- glPopMatrix();
-}
-
void Font::draw_string(const string &str, Codecs::Decoder &dec) const
{
prepare_render();
if(i==glyphs.end())
return;
+ const Glyph &glyph=i->second;
+ (void)glyph;
+
glDrawArrays(GL_QUADS, i->second.index*4, 4);
glTranslatef(i->second.advance, 0, 0);