Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#86 wxfont does not show up

OpenGLContext v2.0
closed-fixed
Context (22)
6
2003-06-03
2003-06-03
Mike C. Fletcher
No

wxFont text does not show up when rendered in any of
the contexts under RHLinux 8.0. When run under
wxPython context, nothing shows up, when run under
GLUT, segfaults. Note that the segfaults are likely
going to have to be avoided by not using wxFont for
text when not using wxPython context under Linux, but
the lack of effect under wxPython context is a definite
bug.

Discussion

  • Logged In: YES
    user_id=34901

    For some strange reason, glDrawPixels doesn't seem to get
    included in display-lists under RHLinux! It certainly does
    under Win2K, but I don't actually see anything in the spec
    saying it's required :( . The GLUT font is using glBitmap,
    which apparently *does* get included in display-lists, but
    all the other image-based fonts are using glDrawPixels.

     
  • Logged In: YES
    user_id=34901

    Display-lists simply don't work (can't be generated) under
    wxPython + Linux, and for some strange reason, glGenLists
    doesn't raise an error on failure (return value 0), so I
    wasn't noticing the problem.

     
  • Logged In: YES
    user_id=34901

    Getting closer! Display-lists works as expected iff the
    display-lists are created within a paint handler (not the
    __init__ or OnInit) methods of the context, nor the initial
    2 OnSize events the window receives before the first OnPaint
    event it gets. Seems as though something in wxWindows is
    delaying setting something up until it can decide what type
    of context it is creating. Result is that during the
    __init__ (and therefor the OnInit) method, there's no valid
    context set. I've worked around this for a few tests, but
    it's not suitable for general use because the general
    pattern is to use OnInit for exactly this kind of setup.
    Might wind up using an EVT_ macro to delay OnInit until the
    window is actually created for wxPython contexts.

     
  • Logged In: YES
    user_id=34901

    Okay, this is now fixed, though the fixes are not the most
    beautiful things in the world. Turns out that the wxPython
    wxGLCanvas only creates the actual context during a "window
    realization" callback. The fixes involved providing a new
    customization point in the context base class, and a
    specialization in the wxPython context. There is also a new
    flag in the wxPython context which provides a last resort
    attempt to initialize during the paint event. This appears
    to work in most cases, though the meta-test is showing a few
    rendering artifacts.

     
    • status: open --> closed-fixed