Open main menu

Difference between revisions of "HOWTO-Engines"

292 bytes added ,  03:45, 15 November 2008
→‎Example: engines/quux/quux.cpp: update to new graphics transaction features
(add link to HOWTO-Open Pages, fix some typos)
(→‎Example: engines/quux/quux.cpp: update to new graphics transaction features)
Line 191: Line 191:


int QuuxEngine::init() {
int QuuxEngine::init() {
// Initialize graphics using following template
// Initialize graphics using following:
// You have to use transactions
initGraphics(320, 200, false);
_system->beginGFXTransaction();
// This is handled by base Engine class and processes command
// line parameters
initCommonGFX(true);


// Specify dimensions of game graphics window.
// You could use backend transactions directly as an alternative,
// In this example: 320x200
// but it isn't recommended, until you want to handle the error values
_system->initSize(320, 200);
// from OSystem::endGFXTransaction yourself.
_system->endGFXTransaction();
// This is just an example template:
//_system->beginGFXTransaction();
// // This setup the graphics mode according to users seetings
// initCommonGFX(false);
//
// // Specify dimensions of game graphics window.
// // In this example: 320x200
// _system->initSize(320, 200);
//FIXME: You really want to handle
//OSystem::kTransactionSizeChangeFailed here
//_system->endGFXTransaction();
// Create debugger console. It requires GFX to be initialized
// Create debugger console. It requires GFX to be initialized
561

edits