on-demand tracing: Initial hook up of on-demand frame tracing based on
frame number or file existence
* Command line parameters have been added to allow specifying frames to trace or to enable tracing of a range of frames.
* Add usage information to cli_trace.
* Supports Windows, and OSX

* The following examples show how to capture frame 30 or all frames between 30 and 130 (inclusive).

* Single-frame tracing can be enabled using:
** -f30 or --trace-frame=30 on the command line.
** Setting env var TRACE_FRAME to 30

* Ranges can be specified by:
** -f30-130 or --trace_frame=30-130 on the command line.
** TRACE_FRAME environment variable can be set to 30-130

* on-demand tracing (of arbitrary frames) can be enabled using:
** -fx or --trace-frame=x (x can be any non-digit character)
** Setting env var TRACE_FRAME to any non-digit character

* After on-demand tracing is enabled, activate the trace using:
** Create an empty file called "snap" in the applications working directory to
capture the single frame immediately after the "snap" file is detected.
(ie, "touch snap")
** Create a file called "snap" containing a single number to capture that
many frames after the "snap" file is detected. (ie, "echo 100 > snap" will
record 100 frames starting from the time the snap file is created.)
** Create a file called "starttrace" in the working directory to start
tracing all frames, then create a file called "stoptrace" to stop
recording frames. (ie, "touch starttrace" to start tracing, and "touch
stoptrace" to stop tracing)

* The trace file is closed after on-demand tracing has completed.
** This flushes the trace file and allows it to be replayed without having
to exit the application. Recording a second single frame or range of
frames in the same trace file is not supported and specific protected
against (the 'snap', 'starttrace', and 'stoptrace' files will not be
detected).

* gltrace has been extended to support incrementing the frame number
** glFrameTerminatorGREMEDY does not cause the frame number to be
incremented because it was causing empty frames to be recorded as the
frame of interest depending on the timing of the 'snap' file creation and
would cause the frame count to increment faster than expected.

* I have manually confirmed that single-frame traces contain the same calls as a full trace. The current functionality will result in a trace file that is similar to what the 'trim' functionality will produce, but without the need for recording an entire session of the application. These traces cannot be replayed since context creation will likely not be recorded, but can be viewed in qapitrace correctly.
Merge branch 'start-stop-trace3' of https://github.com/PeterLValve/apitrace into on-demand-tracing

Conflicts:
	wrappers/gltrace.py
	wrappers/trace.cpp
	wrappers/trace.hpp
	wrappers/trace.py