Difference between revisions of "Modular Backends"

Jump to navigation Jump to search
1,179 bytes added ,  21:43, 30 April 2006
Added notes on we could organize the source.
m (Typo)
(Added notes on we could organize the source.)
Line 31: Line 31:


It's usually a good idea to look at how SDL manages its backends & modules. For example, graphics, input and event code are usually all found in <code>src/video/FOO</code>.
It's usually a good idea to look at how SDL manages its backends & modules. For example, graphics, input and event code are usually all found in <code>src/video/FOO</code>.


== Potential modules ==
== Potential modules ==
Line 44: Line 45:
* Native MIDI drivers (already modular, backends/midi/)
* Native MIDI drivers (already modular, backends/midi/)
* Scaler code (see common/scaler*) -> we already share some scaler code, but that could probably be done in a better way, and maybe some more generic scalers could be added (e.g. a good & fast downscaler).
* Scaler code (see common/scaler*) -> we already share some scaler code, but that could probably be done in a better way, and maybe some more generic scalers could be added (e.g. a good & fast downscaler).
== Source layout ==
Regarding the source layout: I imagine we will add subdirs to backends based on functionality, while retaining some / all of the current platform specific dirs (though we might be move the latter into a new subdir called "platform" or so). I.e. I envision the source hierarchy to eventually look something like this:
* <code>backends/fs/posix</code>
* <code>backends/fs/windows</code>
* <code>backends/fs/..</code>
* <code>backends/saves/default</code>
* <code>backends/saves/dc</code>
* <code>backends/saves/psp</code>
* <code>backends/timer/default</code>
* <code>backends/timer/morphos</code>
* <code>backends/video/x11</code>
* <code>backends/sound/oss</code>
* <code>backends/midi</code>
* <code>...</code>
* <code>backends/platform/sdl</code>
* <code>backends/platform/dc</code>
I don't want to be too strict on how far we use subdirs or not. E.g. <code>backends/midi</code> currently does not use subdirs. And the subdirs in <code>backends/fs</code> are not really needed either, since each implementation so far consists of a single source file only, so we might want to flatten it. Those are fine details we still can decide (and change) latter.




1,079

edits

Navigation menu