1,079
edits
(→Overview: doxygen link updated) |
(Use GeSHi syntax coloring extension) |
||
Line 24: | Line 24: | ||
==== Example of minimal main() ==== | ==== Example of minimal main() ==== | ||
<syntax type="C++">int main(int argc, char *argv[]) { | |||
g_system = new OSystem_Foobar(); | |||
assert(g_system); | |||
// Invoke the actual ScummVM main entry point: | |||
int res = scummvm_main(argc, argv); | |||
g_system->quit(); | |||
return res; | |||
}</syntax> | |||
That's it. The difficult part is of course writing the OSystem subclass. More on that in the next section! | That's it. The difficult part is of course writing the OSystem subclass. More on that in the next section! | ||
Line 49: | Line 48: | ||
If you're writing a backend for such system, you may use code like this: | If you're writing a backend for such system, you may use code like this: | ||
<syntax type="C++">void updateScreen() { | |||
uint32 newTime = getMillis(); | |||
if (newTime - _oldTime < 1000 / MAX_FPS) | |||
return; | |||
_oldTime = newTime; | |||
// do actual screen update | |||
}</syntax> | |||
That should do the trick for you, | That should do the trick for you, |
edits