Open main menu

Difference between revisions of "HOWTO-Engines"

507 bytes added ,  01:57, 14 February 2006
Elaborated more on our engine requirements
(Added code for a minimal example "engine")
(Elaborated more on our engine requirements)
Line 121: Line 121:
// in particular, do not load data from files; rather, if you
// in particular, do not load data from files; rather, if you
// need to do such things, do them from init().
// need to do such things, do them from init().
// Do not initialize graphics here
// However this is the place to specify all default directories
File::addDefaultDirectory(_gameDataPath + "sound/");
printf("QuuxEngine::QuuxEngine\n");
printf("QuuxEngine::QuuxEngine\n");
}
}
Line 130: Line 136:


int QuuxEngine::init(GameDetector &detector) {
int QuuxEngine::init(GameDetector &detector) {
// Initialize graphics using following template
// You have to use transactions
_system->beginGFXTransaction();
// This is handled by base Engine class and processes command
// line parameters
_vm->initCommonGFX(detector);
// Specify dimensions of game graphics window
_system->initSize(width, height);
_system->endGFXTransaction();
// Additional setup.
// Additional setup.
printf("QuuxEngine::init\n");
printf("QuuxEngine::init\n");
Line 145: Line 162:
} // End of namespace Quux
} // End of namespace Quux
</pre>
</pre>


=== Example: engines/quux/module.mk ===
=== Example: engines/quux/module.mk ===