retrace: Remove the -c/--compare=PREFIX .

That is, remove the ability to compare images while replaying.

For several reasons:

- This duplicates diff-images command.

- It is less versatile -- it is unable to output diff images.

- It will be necessary to change how snapshots are done to properly
  accommodate APIs that have no concept of current context, like
  Direct3D APIs, so the less fat on this code the better.
Fix bug: glLinkProgram* was not called if tracing was disabled.
Fix bug: marker functions were not exposed if tracing was disabled.
Update cli_trace to accept options for single-frame and on-demand tracing.
--frame=30 or -f30 will trace frame number 30
--frame=x or -fx will enable on-demand tracing; create a file called 'snap' in the working directory to trace a single frame (touch snap); create a file called 'starttrace' to start tracing a range of calls (touch starttrace) and create a file called 'stoptrace' to end tracing of a range of calls (touch stoptrace). You if the file named 'snap' contains a number (echo 30 > snap), that number of frames will be traced.
Moving scoped_allocator.hpp from \retrace\ to \common\
Added a bunch of *.hpp files to the Common project so that they will appear in Visual Studio
gui retracer: Always retrace with --singlethread option
* some traces would hit a deadlock in the windowing calls, preventing the retrace from playing; this works around the issue.
gui: initialize a variable to remove a build warning
trace: This adds on-demand tracing of OpenGL on Windows, Linux, and OS X.

* File organization: In order to achieve this functionality, the wrapper scripts had to be split into three different files. Previously the generated entrypoints were declared at the top of the file, defined below, and immediately emitted the API calls into the trace file. Now, the main entrypoints are declared and defined in a single file (generated by wgltrace.py cgltrace.py or glxtrace.py), but will use the result of IsTracingEnabled() to either call into the system GL entrypoint, or a _trace_* entrypoint which emits the call into the trace file. The _trace_* entrypoints are declared in a header file (generated by *trace_tracefuncsDecl.py) and implemented in a cpp file (generated by *trace_tracefuncs.py). By separating the declaration from the definition, the header file can now be included by other files who which to emit API calls into the trace; in particular gltrace_state_snapshot which recreates all the state before the first frame which needs to be traced.

DX and EGL trace scripts have been updated so that entrypoint declarations, entrypoints, and trace functions are still generated into the same file, maintaining previous behavior.

* State snapshot: There are a set of 'state_setup_entrypoints' which create and delete objects which are always traced into the trace file. This ensures that all objects which were created in the running application will also be recreated in the trace file (including a lot of WGL, GLX, and CGL entrypoints). Most of these objects can be queried at runtime to have state recreated; others are special cased and will have the _trace_* entrypoint always called at runtime, but are not emitted into the trace and instead the parameters are stored so that the state can properly be recreated when on-demand tracing begins. Examples of these special cased entrypoints are those related to supplying shader source and texture contents / mipmap levels. All the state_setup_entrypoints also check isTracingStateSetupFunctions() in addition to isTracingEnabled() in the main entrypoints.

A lot of the code in glstate_snapshot.py which performs the snapshot is taken from glstate_params.py that was part of the glretrace_common project, but obviously modified to perform state setting instead of getting.

When the next frame is recognized as the first one to trace, snapshotParameters() is called to snapshot the current state and emit calls into the trace file to generate the same state. This is currently written to handle OpenGL 3.3 core functionality (some basic state, samplers, buffers, vertex attributes, program objects, textures, renderbuffers, and frame buffers), and does not handle material and light state, which was deprecated. These enum values are listed in 'state_deprecated_before_gl33'.

There is some state which is only queriable and cannot be set, which are collected into the 'state_that_cannot_replay' list.

State that is either enabled or disabled is listed in 'state_enable_disable'.

Some state must be set based on the result of multiple state queries or have state-specific setters, these special cases are listed in 'state_setters'. The first element is a comma-separated list of enums to query, and the second element is the function which can set that state.

* Additional support for debugging extensions: Additional support for GL_GREMEDY_string_marker, GL_KHR_debug, GL_ARB_debug_output, and GL_AMD_debug_output has been added. Apitrace will always add these extensions to the extension string list so that they can be recorded into the trace file and can be seen in qapitrace. Existing functionality is in place such that the entrypoints will only be retraced if the host driver exposes the entrypoints, and will be ignored otherwise.

* Add or correct setters for some GL enums (in glparams.py).

* Also added a bunch of headers and py scripts to CMakeLists so that they will appear in Visual Studio and be searchable.
trace: Adding to the usage output for on-demand tracing
* A range of frames can also be specified from the command line using --frame=50-200 or -f50-200
* Quote files with backticks instead of single quotes to be consistent with other usage text
trace: Track shader existence and recreate shaders separately from the program objects.
* Previously only the shaders linked to a program object were being tracked and recreated. This was causing a problem when range tracing (although it could have happened with a single frame trace) where shaders would be linked mid-trace, but they had not been compiled during state recreation. This change tracks the existence of shader objects separately from the program objects, so that all shaders will be compiled, and then all programs will have shaders attached to them, be linked, and then uniforms will be set.
** This may (or may not) have issues if shaders are created, compiled, attached, then deleted prior to the trace being started. According to the GL spec, calls to glDeleteShader will only mark the shader for deletion if it is currently attached to a program. My implementation will remove it from the shaderObjects list, and it may not be recreated in the retrace.
* Add some glDebugMessageInsert(..) messages around shader & program recreation to help find those calls in qapitrace.
Adding trace_fast_callset.* which should have been part of the earlier commit. There are needed as part of the cworth branch to improve trim performance.
trace: Fix debug_functions list
* missing a comma
* glDebugMessageControlAMD should have been glDebugMessageEnableAMD
Merge branch 'master' of https://github.com/PeterLValve/apitrace into start-stop-trace

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