Add support for border removal
[sdl_omap.git] / README.OMAP
CommitLineData
50339c93 1(some) OMAP hardware support for SDL
2by notaz (notasas@gmail.com)
3
4
5About
6-----
7
8This is a quick SDL driver to make use of some OMAP features, namely double
9buffering and hardware scaler.
10
11The backstory of this is that SDL on Pandora console was suffering from tearing
12and stuttering problems because SDL default x11 driver doesn't work that well
13there. Almost 6 months have passed after pandora's release, no improved
14SDL versions appeared (not blaming anyone here, pandora's availability was low
15and there where were several SDL improvement in the works though). This
16encouraged me to create this quick version until something better appears
17(if ever).
18
19Although this was created for pandora, there is nothing preventing this to work
20on other OMAP platforms as well (well, nothing intentional at least).
21
22
23Usage / environment
24-------------------
25
26To 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
28just set it in launcher script so that it can be changed easily without
29recompiling as needed:
30---
31#!/bin/sh
32export SDL_VIDEODRIVER=omapdss
33./your_program_here
34---
35
36Other environment variables:
5d957fa5 37
50339c93 38SDL_OMAP_LAYER_SIZE:
39 Output layer size. Regardless what you set with SDL_SetVideoMode(), output
455c8c43 40 will be scaled to this size using hardware with zero processing cost.
41 Note: scaling amount range is limited to roughly 1/4x-8x. The exact range
42 depends on various factors like version of the driver or OMAP hardware itself.
43 Valid values:
50339c93 44 "WxH", for example "640x480"
0bb19c41 45 "fullscreen" to cover whole screen.
5d957fa5 46
455c8c43 47SDL_OMAP_BORDER_CUT:
48 This can be used to move parts of SDL surface out of screen, in other
49 words cut borders and zoom in. Format: <left>,<right>,<top>,<bottom>
50 For example, "0,0,16,0" would hide top 16 lines offscreen, making 17th
51 (16th if you count from 0) line the first visible.
52 Note: like for layer size ranges are limited.
53
50339c93 54SDL_OMAP_VSYNC:
5d957fa5 55 Enables waiting for vertical sync on SDL_Flip() calls.
50339c93 56 Set to "1" to enable, "0" to disable.
57
5d957fa5 58SDL_OMAP_DEFAULT_MODE:
59 If the app doesn't specify resolution in SDL_SetVideoMode(), then use this.
60 Should be specified in "WxH" format, for example "640x480".
61
0bb19c41 62SDL_OMAP_FORCE_DOUBLEBUF:
63 This can force double buffering to on, which can help to eliminate tearing.
64 Note that if app isn't updating whole buffer each frame, it will glitch.
65 This is the same as specifying SDL_DOUBLEBUF to SDL_SetVideoMode.
66
5f4b1fd3 67SDL_OMAP_NO_TS_TRANSLATE:
68 Disable automatic touchscreen screen -> layer coordinate translation,
69 return real screen coordinates.
70
50339c93 71
72Config file
73-----------
74
75Optionally a file named "omapsdl.cfg" can be created in the game's working
76directory. It has lower priority than environment variables, and has these
77options (only when omapdss driver is active):
78
79# same as SDL_OMAP_VSYNC
80force_vsync = 1/0
81
0bb19c41 82# same as SDL_OMAP_FORCE_DOUBLEBUF
83force_doublebuf = 1/0
84
5f4b1fd3 85# same as SDL_OMAP_NO_TS_TRANSLATE
86no_ts_translate = 1/0
87
50339c93 88# can be used to bind a key to SDL keysym, good for quick ports.
89# Example:
90# bind ev_home = sdlk_space
91bind ev_<evdev_key> = <sdl_key>
92
7b66578c 93
94Source
95------
96
97Available at git://notaz.gp2x.de/~notaz/sdl_omap.git
98