On Wed, Mar 4, 2009 at 5:00 PM, Carsten Neumann <[email protected]> wrote:
> Aron Bierbaum wrote:
>> Any hints on what these may be.
>
> TypesFieldMask       |
> LengthsFieldMask     |
> PropertiesFieldMask  |
> PropIndicesFieldMask |
> DlistCacheFieldMask
>
>  Do you also think we should split the
>> check for DlistCacheField changing into a separate block. Something
>> like:
>>
>> // Handle changes to display list caching flag.
>> if (whichField & DlistCacheFieldMask)
>> {
>>    if (getDlistCache())
>>    {
>>         if(getClassicGLId() == 0)
>>         {
>>             setClassicGLId(
>>                 Window::registerGLObject(
>>                     boost::bind(&Geometry::handleClassicGL,
>>                                 GeometryMTPtr(this),
>>                                 _1, _2, _3, _4),
>>                     &Geometry::handleClassicDestroyGL));
>>         }
>>         if(getAttGLId() == 0)
>>         {
>>             setAttGLId(
>>                 Window::registerGLObject(
>>                     boost::bind(&Geometry::handleAttGL, GeometryMTPtr(this),
>>                                 _1, _2, _3, _4),
>>                     &Geometry::handleAttDestroyGL));
>>         }
>>    }
>>    else
>>    {
>>         if(getClassicGLId() != 0)
>>         {
>>             Window::destroyGLObject(getClassicGLId(), 1);
>>
>>             setClassicGLId(0);
>>         }
>>         if(getAttGLId() != 0)
>>         {
>>             Window::destroyGLObject(getAttGLId(), 1);
>>
>>             setAttGLId(0);
>>         }
>>    }
>>
>>     if(getDlistCache())
>>     {
>>         if(whichField & (TypesFieldMask | LengthsFieldMask |
>> PropertiesFieldMask |
>>                                PropIndicesFieldMask |
>> ClassicGLIdFieldMask | AttGLIdFieldMask))
>>         {
>>            Window::refreshGLObject(getClassicGLId());
>>            Window::refreshGLObject(getAttGLId    ());
>>         }
>> }
>
> personally I find a sequence of
>
> if(A)
> {
> }
> else
> {
> }
>
> if(A)
> {
> }

I'm sorry I entered the wrong text, it should have been:

if (whichField & DlistCacheFieldMask)
{

   // Handle the change to the display list field.
   if (getDlistCache())
   {
      // Ensure that we have OpenGL objects for display lists.
   }
   else
   {
      // Delete old display lists.
   }
}

if (getDlistCache())
{
   // If something changed in the geometry
   if(whichField & (TypesFieldMask | LengthsFieldMask | PropertiesFieldMask |
                          PropIndicesFieldMask | ClassicGLIdFieldMask
| AttGLIdFieldMask))
   {
      // Refresh the OpenGL objects.
   }
}

I think that it is worth asking, if we change the dlist mode do we
need to refresh the OpenGL objects? We shouldn't need to because they
were either just created or removed so on the next render they will be
validated. Right? Doesn't make a difference to me what the logic is as
long as we minimize the places where we refresh and force a upload.

-Aron


> confusing, but that may just be me ;)
>
>> I don't know if I need to check for ClassicGLIdFieldMask |
>> AttGLIdFieldMask here for sure though.
>
> These should only be changed by the Geoemtry itself, so they should not
> be in there; it smells like this could actually introduce a loop if they
> are.
>        Cheers,
>                Carsten
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to