Hi Allen,
Allen Bierbaum wrote:
> With the ability to get the fcd xml data, it is possible to add
> additional metadata to the fcd file and use it without extending the
> current APIs. (just read and parse the XML data at run-time to get at
> the information). I have started using this in one application and just
> committed a test to show everyone some of the things I am thinking of
> adding.
>
> Take a look at: http://opensg.vrsource.org/trac/changeset/230
>
> This adds min_value and max_value for Real fields and a list of
> potential_value enums for GLenum fields.
>
> Any comments?
I like the basic idea. I think the interface (having to parse the XML
string) is powerful but pretty complicated, so I don't know if I like
that very much.
For the min/max values there is not much to say, those work well.
The problems I see with the enums is how to map them to actual values,
as OpenGL does not have that ability. The same is true for other kinds
of enums. It might make sense to do
potential_values="GL_AMBIENT=0x8a20,GL_DIFFUSE=0x8a21"
instead, which would also allow an inverse mapping. This mapping needs
to be correct and correspond to the one in the code, but we might be
able to create a unit test for that using some preprocessor magic and
fcdProcess.
This info could also be used to create a new interface for enums that is
string-based, and maybe also to create the code for defining the enum
automatically in the base class (not for external constants like OpenGL,
but maybe for internal ones). I have been toying with the idea of an
Enum Field over the years, but never got to a good implementation
option. This might be a way to get there.
Yours
Dirk
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users