About engine
-
phlith
About engine
Can someone tell me why there is for example, IGUIWindow.h, CGUIWindow.cpp, and CGUIWindow.h. What do the files starting with I do? If CGUIWindow defines the class that CGUIWindow.cpp needs, why is IGUIWindow present? Does the I stand for something?
To further enlighten you, Interfaces help make a clean interface into the library. None of the I classes are actual classes, they are all abstract base classes. You will notice you can never make an instance of one-- your compiler will complain. You can only use pointers to them.
The C classes all inherit from an I class, and when you 'addCamera' or the like, it creates an instance of a C class. The important thing, as Niko said, is that as a user of the library, you dont need to know about the C classes. You can just pretend all you have is the simple I class interface.
This makes it easy to define what part of the engine the user can touch, limiting them from messing themselves up.
The C classes all inherit from an I class, and when you 'addCamera' or the like, it creates an instance of a C class. The important thing, as Niko said, is that as a user of the library, you dont need to know about the C classes. You can just pretend all you have is the simple I class interface.
This makes it easy to define what part of the engine the user can touch, limiting them from messing themselves up.
a screen cap is worth 0x100000 DWORDS