| 1 | (some) OMAP hardware support for SDL |
| 2 | by notaz (notasas@gmail.com) |
| 3 | |
| 4 | |
| 5 | About |
| 6 | ----- |
| 7 | |
| 8 | This is a quick SDL driver to make use of some OMAP features, namely double |
| 9 | buffering and hardware scaler. |
| 10 | |
| 11 | The backstory of this is that SDL on Pandora console was suffering from tearing |
| 12 | and stuttering problems because SDL default x11 driver doesn't work that well |
| 13 | there. Almost 6 months have passed after pandora's release, no improved |
| 14 | SDL versions appeared (not blaming anyone here, pandora's availability was low |
| 15 | and there where were several SDL improvement in the works though). This |
| 16 | encouraged me to create this quick version until something better appears |
| 17 | (if ever). |
| 18 | |
| 19 | Although this was created for pandora, there is nothing preventing this to work |
| 20 | on other OMAP platforms as well (well, nothing intentional at least). |
| 21 | |
| 22 | |
| 23 | Usage / environment |
| 24 | ------------------- |
| 25 | |
| 26 | To enable this driver, SDL_VIDEODRIVER environment variable must be set to |
| 27 | "omapdss". It can be set by calling setenv() in the code, but it's better to |
| 28 | just set it in launcher script so that it can be changed easily without |
| 29 | recompiling as needed: |
| 30 | --- |
| 31 | #!/bin/sh |
| 32 | export SDL_VIDEODRIVER=omapdss |
| 33 | ./your_program_here |
| 34 | --- |
| 35 | |
| 36 | Other environment variables: |
| 37 | SDL_OMAP_LAYER_SIZE: |
| 38 | Output layer size. Regardless what you set with SDL_SetVideoMode(), output |
| 39 | will be scaled to this size using hardware. Valid values: |
| 40 | "WxH", for example "640x480" |
| 41 | "fullscreen" for to cover whole screen. |
| 42 | SDL_OMAP_VSYNC: |
| 43 | Enables waiting for vertical sync on SDL_Flit() calls. |
| 44 | Set to "1" to enable, "0" to disable. |
| 45 | |
| 46 | |
| 47 | Config file |
| 48 | ----------- |
| 49 | |
| 50 | Optionally a file named "omapsdl.cfg" can be created in the game's working |
| 51 | directory. It has lower priority than environment variables, and has these |
| 52 | options (only when omapdss driver is active): |
| 53 | |
| 54 | # same as SDL_OMAP_VSYNC |
| 55 | force_vsync = 1/0 |
| 56 | |
| 57 | # can be used to bind a key to SDL keysym, good for quick ports. |
| 58 | # Example: |
| 59 | # bind ev_home = sdlk_space |
| 60 | bind ev_<evdev_key> = <sdl_key> |
| 61 | |
| 62 | |
| 63 | Source |
| 64 | ------ |
| 65 | |
| 66 | Available at git://notaz.gp2x.de/~notaz/sdl_omap.git |
| 67 | |