Livia Koch wrote:

        I moved the glViewPort() call to the !valid() section, and
        that solved the 'unexpected art' problem.

        But I notice if I uncomment your call to generate_model(),
        this causes these errors in my linux console:

XRequest.143: GLXBadContextState 0x1200006
XRequest.143: GLXBadContextState 0x1200006

        So it seems there's something wrong with how the lists are
        being created.

        One thing that came to mind just looking at the code is the use
        of std::string in the draw_[xy]_axis() functions.

        The way you're using it, you're calling the function with static 
strings,
        and those get converted to std::strings during the call, which go out of
        scope the minute the draw_[xy]_axis() functions return.

        That should be fine for non-display list contexts where the string
        is drawn immediately.

        But in the context of a display list, that's probably bad, since your
        call to gl_draw() gets delayed until later, when the glCallList() is 
called,
        and by that time your c_str() call will have resolved to a pointer in 
memory
        that long since went out of scope when the glCallList() is actually 
called.
        So that /may/ a problem there.

        But that's not /the/ problem; I ripped out all your std::string stuff
        so that static strings were being passed around, and I'm still getting
        the "bad context state" errors from the generate_model() call..

        Just thought I'd bring these items up, though.

        I've never used display lists myself, so I'm using your app as kinda
        an introduction to their use.

        They seem interesting, but are probably not saving you much in the
        way of speed here. Might be useful if you were computing really large
        models, where the computation of the model is slow, so doing it once
        and saving the rendering as a display list would help.

        But using it to draw a few lines and text probably isn't saving any
        time at all, since there's no computations being done.. all the overhead
        is in the gl calls themselves, which isn't really saved by a display 
list.
_______________________________________________
fltk-opengl mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-opengl

Reply via email to