Dirk Reiners wrote: > > 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.
I have a class on PotentialContributions which maps gl-enums to/from strings. It's fairly brute-force, but it gets the job done. > 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. There is something like that as well (EnumUtil). It's currently just a simple way to provide iostream <</>> operators for any enum type, but it might be something to start with. /Marcus ------------------------------------------------------------------------- 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
