Only in ../fluxus.orig/src/: CVS Only in src/: FluxusMain.o diff -C2 ../fluxus.orig/src/GLEditor.cpp src/GLEditor.cpp *** ../fluxus.orig/src/GLEditor.cpp Thu Nov 1 18:33:07 2007 --- src/GLEditor.cpp Thu Nov 15 14:25:17 2007 *************** *** 116,123 **** m_Height=h; } ! void GLEditor::StrokeCharacter(wchar_t c) { ! m_PolyGlyph->Render(c); } --- 116,123 ---- m_Height=h; } ! void GLEditor::StrokeCharacter(wchar_t c) { ! m_PolyGlyph->Render(c,m_TextColourRed,m_TextColourGreen,m_TextColourBlue); } *************** *** 287,296 **** glTranslatef(0,ypos,0); } ! else { if (xcount>=m_LeftTextPosition) { - glColor3f(m_TextColourRed,m_TextColourGreen,m_TextColourBlue); - if ((m_Text[n] & 0xC0) == 0xC0) // two byte utf8 { --- 287,294 ---- glTranslatef(0,ypos,0); } ! else { if (xcount>=m_LeftTextPosition) { if ((m_Text[n] & 0xC0) == 0xC0) // two byte utf8 { *************** *** 298,306 **** mbstowcs(dst,&(m_Text[n]),1); StrokeCharacter(dst[0]); ! n++; } else { ! StrokeCharacter(m_Text[n]); } BBExpand(xpos,ypos); --- 296,304 ---- mbstowcs(dst,&(m_Text[n]),1); StrokeCharacter(dst[0]); ! n++; } else { ! StrokeCharacter(m_Text[n]); } BBExpand(xpos,ypos); Only in src/: GLEditor.o Only in src/: GLFileDialog.o Only in src/: Interpreter.o diff -C2 ../fluxus.orig/src/PolyGlyph.cpp src/PolyGlyph.cpp *** ../fluxus.orig/src/PolyGlyph.cpp Thu Nov 1 18:33:07 2007 --- src/PolyGlyph.cpp Thu Nov 15 14:33:57 2007 *************** *** 6,12 **** { FT_Error error; ! error = FT_Init_FreeType(&m_Library); error = FT_New_Face(m_Library, ttffilename.c_str(), 0, &m_Face); ! if (error) { --- 6,12 ---- { FT_Error error; ! error = FT_Init_FreeType(&m_Library); error = FT_New_Face(m_Library, ttffilename.c_str(), 0, &m_Face); ! if (error) { *************** *** 14,20 **** assert(0); } ! ! // use 5pt at 100dpi ! error = FT_Set_Char_Size(m_Face, 50 * 64, 0, 100, 0); m_Slot = m_Face->glyph; } --- 14,20 ---- assert(0); } ! ! // use 5pt at 100dpi ! error = FT_Set_Char_Size(m_Face, 50 * 64, 0, 100, 0); m_Slot = m_Face->glyph; } *************** *** 26,54 **** } ! void PolyGlyph::Render(wchar_t ch) ! { map::iterator i = m_Cache.find(ch); if (i!=m_Cache.end()) { ! glCallList(i->second); } else ! { FT_Error error; error = FT_Load_Char(m_Face, ch, FT_LOAD_DEFAULT); ! if (error) return; ! ! int glList = glGenLists(1); GlyphGeometry* geo = new GlyphGeometry; BuildGeometry(m_Slot,*geo); ! ! glNewList(glList, GL_COMPILE); RenderGeometry(*geo); ! glTranslatef(m_Slot->metrics.horiAdvance,0,0); ! glEndList(); delete geo; ! m_Cache[ch]=glList; ! glCallList(glList); } } --- 26,64 ---- } ! void PolyGlyph::Render(wchar_t ch, float r, float g, float b) ! { map::iterator i = m_Cache.find(ch); if (i!=m_Cache.end()) { ! glColor3f(r, g, b); ! glCallList(i->second); ! glColor3f(1-r, 1-g, 1-b); ! glCallList(i->second+1); } else ! { FT_Error error; error = FT_Load_Char(m_Face, ch, FT_LOAD_DEFAULT); ! if (error) return; ! ! int glList = glGenLists(2); GlyphGeometry* geo = new GlyphGeometry; BuildGeometry(m_Slot,*geo); ! ! glNewList(glList, GL_COMPILE); RenderGeometry(*geo); ! glEndList(); delete geo; ! ! glNewList(glList+1, GL_COMPILE); ! RenderOutline(m_Slot); ! glTranslatef(m_Slot->metrics.horiAdvance,0,0); ! glEndList(); ! m_Cache[ch]=glList; ! glColor3f(r, g, b); ! glCallList(glList); ! glColor3f(1-r, 1-g, 1-b); ! glCallList(glList+1); } } *************** *** 69,73 **** return m_Slot->metrics.vertAdvance; } ! void PolyGlyph::BuildGeometry(const FT_GlyphSlot glyph, GlyphGeometry &geo) { --- 79,83 ---- return m_Slot->metrics.vertAdvance; } ! void PolyGlyph::BuildGeometry(const FT_GlyphSlot glyph, GlyphGeometry &geo) { *************** *** 98,102 **** for(int c=0; coutline.n_contours; c++) { ! unsigned int end = glyph->outline.contours[c]+1; for(unsigned int p = start; poutline.n_contours; c++) { ! unsigned int end = glyph->outline.contours[c]+1; for(unsigned int p = start; poutline.n_contours; c++) { ! unsigned int end = glyph->outline.contours[c]+1; gluTessBeginContour(t); for(unsigned int p = start; poutline.n_contours; c++) { ! unsigned int end = glyph->outline.contours[c]+1; gluTessBeginContour(t); for(unsigned int p = start; poutline.n_contours; c++) + { + glBegin(GL_LINE_LOOP); + unsigned int end = glyph->outline.contours[c]+1; + for(unsigned int p = start; poutline.points[p].x, glyph->outline.points[p].y, 0); + } + glEnd(); + start=end; + } + } + void PolyGlyph::RenderGeometry(const GlyphGeometry &geo) { *************** *** 160,164 **** glDrawArrays(i->m_Type,0,i->m_Data.size()); }*/ ! // i don't like em, but display lists + glbegin are faster than vertex arrays for (vector::const_iterator i=geo.m_Meshes.begin(); i!=geo.m_Meshes.end(); i++) --- 186,190 ---- glDrawArrays(i->m_Type,0,i->m_Data.size()); }*/ ! // i don't like em, but display lists + glbegin are faster than vertex arrays for (vector::const_iterator i=geo.m_Meshes.begin(); i!=geo.m_Meshes.end(); i++) diff -C2 ../fluxus.orig/src/PolyGlyph.h src/PolyGlyph.h *** ../fluxus.orig/src/PolyGlyph.h Thu Nov 1 18:33:07 2007 --- src/PolyGlyph.h Thu Nov 15 14:18:27 2007 *************** *** 27,31 **** GlyphGeometry() {} ~GlyphGeometry() {} ! template class Vec3 --- 27,31 ---- GlyphGeometry() {} ~GlyphGeometry() {} ! template class Vec3 *************** *** 35,39 **** T x,y,z; }; ! class Mesh { --- 35,39 ---- T x,y,z; }; ! class Mesh { *************** *** 55,75 **** PolyGlyph(const string &ttffile); ~PolyGlyph(); ! ! void Render(wchar_t ch); float CharacterWidth(wchar_t ch); float CharacterHeight(wchar_t ch); private: ! void Generate(wchar_t ch); void BuildGeometry(const FT_GlyphSlot glyph, GlyphGeometry &geo); void RenderGeometry(const GlyphGeometry &geo); FT_Library m_Library; FT_Face m_Face; FT_GlyphSlot m_Slot; ! map m_Cache; ! static void TessError(GLenum errCode, GlyphGeometry* geo); static void TessVertex(void* data, GlyphGeometry* geo); --- 55,76 ---- PolyGlyph(const string &ttffile); ~PolyGlyph(); ! ! void Render(wchar_t ch, float r, float g, float b); float CharacterWidth(wchar_t ch); float CharacterHeight(wchar_t ch); private: ! void Generate(wchar_t ch); void BuildGeometry(const FT_GlyphSlot glyph, GlyphGeometry &geo); void RenderGeometry(const GlyphGeometry &geo); + void RenderOutline(const FT_GlyphSlot glyph); FT_Library m_Library; FT_Face m_Face; FT_GlyphSlot m_Slot; ! map m_Cache; ! static void TessError(GLenum errCode, GlyphGeometry* geo); static void TessVertex(void* data, GlyphGeometry* geo); Only in src/: PolyGlyph.o Only in src/: Recorder.o Only in src/: Repl.o Only in src/: main.o