Hi Wojtek,
I've now merged your changes but have yet to test them. What is the
best way to test them? Do we have an examples that I can run to find
out if everything is working as intended?
--
As for the topic of the mask type. Personally when I think about masks
I think of unsigned int, but alas C++ enum being what they are - just
int's I guess we have to live with it and either adopt int's or do
casting to avoid warnings. In this instance I've introduced a
typedef:
typedef int ImplicitBufferAttachmentMask;
To abstract away from the choice of using int's or uint's for the
mask, this will allow us to change the type easily without breaking
code. I haven't made a final decision about whether this typedef
should be an int or a uint, it's a wider issue to think about as there
are lots of other masks in the OSG that we'll need to make consistent
once a final decision is made.
As for using const defines, or #define's or even template magic to
hide this issue, frankly all of them are far more long winded, less
clear in what they do and less matainable - a uint enum is really what
we need for best coding economy and clarity, but the crankly old int
enum still beat these other possibilities.
Cheers,
Robert.
2009/10/27 Wojciech Lewandowski <[email protected]>:
> Hi Paul, Robert,
>
> Building on earlier Paul's submission "[osg-users] Main branch MSFBO support
> change", I have added implicit buffer mask variables to DisplaySettings for
> setting global defaults for Camera FBOs. These mask variables are named
> after variables in Camera class. In Paul's submission they were named
> _renderBufferMask & _resolveBufferMask but I renamed them to
> _implicitBufferAttachmentRenderMask & _implicitBufferAttachmentResolveMask.
> DisplaySettings implementation includes reading of environment vars and
> command line options. Setters and getters follow typical OSG naming
> convention. I also updated names of ImplictBufferAttachment enum bits
> to match changed naming scheme.
>
> DisplaySettings now define COLOR and DEPTH as defaults for implicit
> buffers. Consequently Camera by default uses the same defaults through
> USE_DISPLAY_SETTINGS_MASK. However, particular Camera mask can be easily
> overriden through Camera::setImplicitBufferAttachmentMask method. I hope,
> that in this way we can have global control over implicit buffer
> defaults, and we can still retain fine grained control at Camera level.
>
> I have also replaced original unsigned ints used to store masks to signed
> ints because complier resolves enums as signed integer (I got a number of
> warnings with unsigned int).
>
> I struggled to define clear self explanatory names. Feel free to change them
> again, if you decide such naming scheme is too bloated.
>
> Cheers,
> Wojtek Lewandowski
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org