[GtkGLExt] (no subject)



Is it possible to rander antialiased text inside a glarea?  If so, how?

I have a PyGtk + GtkGLext program which currently uses pango fonts:

        glEnable(GL_POINT_SMOOTH)
        glEnable(GL_LINE_SMOOTH)
        glEnable(GL_POLYGON_SMOOTH)
        glEnable(GL_BLEND)
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
        glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE)
        ...
        self.__font_string = 'courier bold 14'
        self.__font_list_base = glGenLists(128)
        self.__font_desc = pango.FontDescription(self.__font_string)
        self.__font = gtk.gdkgl.font_use_pango_font(self.__font_desc, 0, 128, self.__font_list_base)
        ...
        glRasterPos2f(-10.0, 6.0)
        glListBase(self.__font_list_base)
        glCallLists(node.label)

However, using this approach the fonts are not rendered with antialiasing (presumably because of the list rasterization).

I have experimented with calling gdk_draw_text(...) directly, but (a) the text is still blocky; (b) the text flickers despite my tinkering with _GLArea__expose_event to alter the double buffer swapping; and (c) I must additionally transform OpenGL co-ordinates into window co-ordinates.

The text in the widgets surrounding the glarea is all antialiased by default, which only serves to highlight the blocky text inside the glarea.

Before I waste any more time on this, can someone point me in the right direction.

Thanks in advance,
Matt



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]