Find file
Fetching contributors…
Cannot retrieve contributors at this time
145 lines (100 sloc) 4.73 KB
Debug vs Release
---------------------------
The WRATH library and all demos not only have an SDL and Qt variants,
but also each such has a debug variant. The debug versions run slowly
but should be used if any issues arise on device.
Demo Options
----------------------------------
All demos have command line options, visible by running:
#./the-demo -help
The demos use a widget class defined for the build target
implemented in demos/common/XXX_demo.[ch]pp.
That demo-widget class is NOT part of WRATH and is
not required to use WRATH, it is simply a conveniance
class to allow the demos to build on multiple targets
easily.
Specific Demos (text-viewer, cells and image-demo)
------------------------------------
Each of these 3 demos has the option emulate_touch that should be
used when trying out on the desktop or deplying on a device
with a backend that does not have native touch support (like SDL):
emulate_touch=true.
In addition each has ability to select how text is rendered
(this has many options), the main choices is handled by the
option
text_renderer=N
where N determines the text renderer as follows:
0:Alpha bitmap generated by freetype
1:multi-res coverage [poor render results usually]
2:distance field (popularized by Valve)
3:analytic (keeps corners sharp but uses much more memory than distance field)
4:curve_analytic (handles curves of font directly, compicated glyphs can
have rendering anomolies)
In addition, the pixel size of how the font is stored is specified with
wrath_font_size=S
where S is a pixel size (integer). The default value is 64 which is
usually much larger than necessary; Recommneded values are:
Alpha bitmap --> 32
multi-res coverage --> 32
distance field --> 48
curve_analytic --> 32
Lastly an additional option exists to select weather or not
to anti-alias text and how to render text if the font is
minified from its pixel size, that is controlled by:
text_renderer_sub_choice=N
where N determines the text rendering for font minification:
0=no anti-aliasing, same font and renderer for minified
1=anti-aliased, same font and renderer for minified
2=anti-aliased, minified font rendered with alpha coverage
3=anti-aliased, minified font rendered with multi-res coverage,
4=anti-aliased, minified fonr rendered with same algorithm but
font data is realized for minificaiton render
at a smaller size
The when minificaiton render kicks in is determined by:
mix_font_inflate_factor=x
and the resolution at which the minified font data is realized
is controlled by:
min_font_div=x
See the -help for details for tweaking these.
text-viewer-demo is a:
- file browser,
- formatted text viewer,
- font viewer
- and image viewer.
To launch it as a file browser do:
./XXX-text-viewer filename=./path/to/start/file/browsing
Touching (or clicking if emulate_touch=true is used) files
and directories opens up those files and directories. The
default value for filename opens up a file describing the
"formatting language" that text-viewer understands.
Scrolling is done via panning gestures and zooming is single touch
zoom interface as follows: Hold down for half a second, then
dragging up zooms out and dragging down zooms in
cells:
-demos having many cells yet few draw calls.
double tapping(or clicking) on a cell triggers an animation
to remove it from the main table and place it in the foreground.
Scrolling is done via panning gestures and zooming is single touch
zoom interface as follows: Hold down for half a second, then
dragging up zooms out and dragging down zooms in
For each cell to have an image, specify a value for image_dir
as a directory where images are stored:
image_dir=/some/path/to/images
image-demo:
- is a stress test to demo batching, the most important options are:
count=N (determines number of "widgets" drawn)
draw_text=true or draw_text=false (sets to draw text on each widget or not)
draw_image=true or draw_image=false (sets to draw image on each widget or not)
ignore_time=true or ignore_time=false (if true demo runs until user taps bottom right corner)
time=N (if ignore_time is false, gives number of ms demo runs before ending)
image_dir=/path/to/images (sets directory from which to read image files)
while the demo is running, tapping on top right makes the demo
rotate in perspective, tapping bottom right quites and tapping anywhere
else pauses.
Deploying Demos
-----------------------------------
The demos are built in the root directory of WRATH, the release libs
for WRATH are located in release/lib*.so* and debug in debug/lib*.so* .
Several of the demos require additional files on device to run:
text_viewer_data
images