Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Code reuse  (Read 1548 times)

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Code reuse
« on: March 17, 2006, 12:24:47 PM »

Ok, so I started throwing some source together. And, I thought about a loggin class.. which would also be good to have an exception class.. etc etc.

Then, it struck me. THe app will already have to deal with Ogre::Exceptions, OIS::Exceptions, CEGUI::Exceptions.. Ogre::Log, CEGUI::Logs... So, why add yet another logger and exception class? The answer i came up with was not to. Just use either CEGUI or Ogre log and use all the exception classes.

I do not want to abstract everything out, so this is fine. The only question.. which logger to use? Well, I think that the CEGUI one is to specific dealing with just Windows and widgets. The Ogre one has everything else - materials, meshes, videos, etc, etc.. So, that is a good choice. Plus, I can catch CEGUI exceptions (anything else is not worth logging) and have a flag to disable the CEGUI logger. For debug builds for instance, having all logs is benificial - in release mode, you don't really want to have a million log files for users to see.

Anyway, this does not apply to just logs and exceptions. I will use as much code from each lib as needed. Sure, this will lead to a tight integration, but that is the point. I will probably use CEGUI::Strings when dealing with text input/output (since I hear it has good unicode support). And internally, the lib will just make use of std::string's.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Code reuse
« Reply #1 on: March 19, 2006, 05:04:54 PM »

Hmm, I was just thinking about this. And, as far as I know, CEGUI has no dual licensing availiable.. so, i may abstract out most of CEGUI through the GuiManager so that it can be replaced easily enough on platforms without shared lib usage.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Code reuse
« Reply #2 on: March 21, 2006, 04:57:30 PM »

And, I just looked at the CEGUI Faq again.. and there is a question about dual license, and the answer is there are no plans now or in the future. It, doesn't rule out any plans specifically, but makes no claim to having them. Kind of unfortunate.. I think because of this, I will not incorporate CEGUI in WGE (it is probably the best in game complete Gui around I admit).. Well, most games don't use standard or very complex Gui systems anyway... I am happy with just implementing some text controls, edit boxes, and button like widgets.. Hopefully, this will also see a speed improvement over the more complete and complex CEGUI.

Simple Overlays should suffice for the Gui for the time being.. However, later on perhas some 3D elements or any other type of element could be added (ie particles). For now, I will just work on exposing the Ogre overlay and text features...
Logged