The PIGGE system consists of several main modules which control the overall program flow; several specialized modules that encapsulate various functional areas, such as physics models and particle effects; and a set of driver modules that handle low-level functions, including event handling, 3D rendering, and so on.
No modules outside of the drivers should contain any non-portable code; all API-specific functionality should appear only in the drivers. While the default supported APIs are fairly generic and portable (SDL, OpenGL, and so on), there will doubtless be environments that do not support them or have more colloquial local APIs. This separation will aid a porting effort for these platforms, and at the same time keeps a nice clean conceptual wall between design and implementation in the engine.
In order to maintain consistency (and sanity), functions in the rendering drivers must follow the following rules: