Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

JimCrafton

C++ Framework

This topic is 6394 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I don''t know if this is the best place for this but here goes nothin'' ! I have been working on a cross platform C++ framework, that has 3 pieces, a FoundationKit, a GraphicsKit, and a AppliciationKit. The FoundationKit, I thought, might be of interest to game engine developers, as it has a fairly advanced RTTI system that I have noticed other 3D scenegraphs (for game enginges) try to implement (most notable Alchemys Intrinsic game engine). The RTTI should/will work on any standards compliant C++ compiler and allows the following: Class meta information like the class name, class ID ( a UUID represented in the form of a string), super class, and can also identify the properties of the class and get or set those values dynamically at run time. You can also list the methods of the class as well. The only catch is you have to derive your classes from a common base class, whose overhead is 20 bytes. The FoundationKit compiles under Win32 as static lib or DLL (dll is a little over 120k in release ). If you''re interested please see http://sourceforge.net/projects/vcf or http://vcf.sourceforge.net. While it was originally designed for application a friend who saw it at work thought it might be of interest to game developers. Hope this is helpful Jim Crafton

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Sounds like Borland''s RTTI. I use it a lot in the creation of tools, but in-game I have not found it so useful. If you have Borland Delphi or C++ Builder, take a look at typinfo.pas. It is the undocumented unit that exposes the RTTI for the application to use.

Share this post


Link to post
Share on other sites
Dang... forgot to log in with my username with that previous response.

Borland have had the same RTTI as you suggest since 1995 when Delphi 1 came out and it works extremely well. It is not a bad thing to be doing the same as Borland though. If it has already been done correctly, then why change it for change''s sake?

Share this post


Link to post
Share on other sites
Yeah borland has RTTI but it is unusable outside of the VCL and the VCL is useless outside of the borland compiler environment. This works with any standards compliant C++ compiler

Share this post


Link to post
Share on other sites
RTTI may be useful if you want to do the following things
-create a class from only a classname
-dynamically interrogate any object in the system for it''s properties. This might be used to write a custom persistence mechanism.
-figure out the super class of an object.
-dynamically interrogate any object in the system for it''s
methods adn invoke them if neccessary.

Share this post


Link to post
Share on other sites
- a classname is merely a key; use a factory class template
- ditto
- indicates ignorance of the language
- indicates poor design

Do you know why a 950-page book written by the author of the C++ language contains exactly three pages that reference RTTI? The answer is that it is pointless to do things at run-time that could be done at compile-time.

Share this post


Link to post
Share on other sites
RTTI is used to great effect in Borland''s IDE for Delphi and C++ Builder in the Object Inspector. The Object Inspector allows properties of components to be edited visually. Now these properties are not known at compile-time because the Object Inspector is part of the IDE. The components, or classes, are dynamically loaded by the IDE from packages (DLLs) and then it extracts the RTTI from them to know what properties they expose and what types these properties are.

Your VCF is very similar to Borland''s RTTI, but VCF is still held back by being based in C++. C++ was never intended to provide this kind of RTTI. Borland''s VCL is written in Delphi and can therefore take advantage of the built-in RTTI that the Delphi compiler provides.

The mere three pages of RTTI in a 950-page C++ book that you refer to is simply an indication of the lack of foresight by Bjarne Stroustrop (sp?) into the real strengths and usefulness of RTTI. Borland are certainly leading the way in this area by a long shot.

Steve ''Sly'' Williams  Code Monkey  Krome Studios

Share this post


Link to post
Share on other sites
Actually VCF is not held back by being C++, it can do any of the things that the VCL can do.
It may be that for game engines it is not useful, however I know of several 3D scene graphs that attempt to implement the same kind of system with varying degrees of success.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!