I have a very simple draw callback defined that uses a bool to decide if
the drawable should be drawn. The body of the callback's
drawImplementation() looks like:

  if (m_enable)
  {
    drawable->drawImplementation(renderInfo);
  }

I have drawables scattered all over my scene that use the same instance
of this callback. By doing this, I'm able to toggle all of those
drawables on or off by setting a single bool.

This only seems to work though if the drawable has display lists
disabled. My code to set the callback looks like:

  drawable->setUseDisplayList(false);
  // callback is my shared callback instance
  drawable->setDrawCallback(callback);

Is this expected behaviour? If I understand this correctly, to use
display lists, I would have to tell each drawable to recompile
(dirtyDisplayList()) whenever I toggle my m_enable bool. Since the whole
point of my shared draw callback is to avoid traversing my graph, doing
so would defeat the purpose of my callback. So, do I understand this
correctly?

It looks like display lists can prevent a draw callback from being
called. Is that right?

Cory



_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to