1,079
edits
(Add notes about updateScreen()) |
(→Step by step: This page was (is) heavily outdated -- made some fixes) |
||
Line 16: | Line 16: | ||
In the following I assume your port is named "foobar" (very clever, isn't it? :-). | In the following I assume your port is named "foobar" (very clever, isn't it? :-). | ||
# Create a new backends/ subdirectory matching your engines name, i.e. <tt>backends/foobar/</tt> | # Create a new <code>backends/platform</code> subdirectory matching your engines name, i.e. <tt>backends/foobar/</tt> | ||
# Populate the new directory as you need to. If you want to use our regular build system, you will want to provide <tt>backends/foobar/module.mk</tt> file. Take a look at < | # Populate the new directory as you need to. If you want to use our regular build system, you will want to provide <tt>backends/foobar/module.mk</tt> file. Take a look at <code>backends/platform/sdl/module.mk</code> for an example. | ||
# Subclass OSystem. You could copy the content of <tt>backends/null/null.cpp</tt> to <tt>backends/foobar/foobar.cpp</tt> to get a skeleton. As you progress, it might be helpful to look at other backends to learn how they do things. | # Subclass OSystem. You could copy the content of <tt>backends/platform/null/null.cpp</tt> to <tt>backends/platform/foobar/foobar.cpp</tt> to get a skeleton. As you progress, it might be helpful to look at other backends to learn how they do things. | ||
# Make sure to provide the <tt>main</tt> function in your backend (the actual main function of ScummVM is <tt>scummvm_main</tt>, which your backend must invoke at some point). | # Make sure to provide the <tt>main</tt> function in your backend (the actual main function of ScummVM is <tt>scummvm_main</tt>, which your backend must invoke at some point). | ||
# Instantiate OSystem class and assign it to <tt>g_system</tt>, do that before calling <tt>scumm_main</tt> | # Instantiate OSystem class and assign it to <tt>g_system</tt>, do that before calling <tt>scumm_main</tt> | ||
# Deinit properly after calling <tt>scumm_main</tt>, particularly call <tt>g_system->quit()</tt> | # Deinit properly after calling <tt>scumm_main</tt>, particularly call <tt>g_system->quit()</tt> | ||
# If appropriate, edit <tt>configure</tt> to add your backend (this is only necessary if you are going to use the "./configure && make" build system). | # If appropriate, edit <tt>configure</tt> to add your backend (this is only necessary if you are going to use the "./configure && make" build system). | ||
==== Example of minimal main() ==== | ==== Example of minimal main() ==== |
edits