Convert OVR SensorFusion to dynamic allocation

This fixes the segmentatin fault during static initializiation. The
SensorFusion constructor presumes that OVR::System::Init has been
called, so the construction of the Fusion object must be delayed until
that's true.
This stifles a warning. strlen and memset are used here.
Merge pull request #48 from rlk/master

Convert OVR SensorFusion to dynamic allocation

Closes #21
Add a "particle" material type

This has the effect of enabling point sprite mode and rendering mesh
geometry with DrawArrays(POINTS) instead of DrawElements(TRIANGLES).
This facility will enable the efficient reimplementation of the goal
and jump visuals.

Enabling this flag on basic-ball is a real surprise!
Tweaks to material effects

Fix additive material to support texture alpha.
Fix particle material to attenuate with distance according to perspective.
Add third light source to be used for sparkle effects
Replace goal and jump

The new goal and jump effects combine the new particle material effect with
the new sparkle light source to produce sparkly particles. This reduces
overdraw dramatically and improves performance significantly under fill
limited circumstances. The jump is now rendered in a single batch and the
goal is rendered in two.
Add a logging facility
Restructure entity drawing

This change was initially intended to resolve part of Issue #51, specifically
the desktop-isms that had crept into the ES code, glPushAttrib, etc.

On examination, it was recognized that entity rendering was structured
inefficiently. Each goal and jump entity consists of both a light beam
effect and a particle effect. The renderer looped over these entities and
drew the beam and particles of each in turn. With many such entities in the
scene, the light beam rendering state was set up and torn down many times
per frame.

This new implementation sets up the beam state only once and renders all
goal, jump, and switch beams togather. It then tears down the beam state and
renders the goal and jump particles, which are (as of recently) handled by the
main material handler (and are thus self-optimizing).

The resulting code is cleaner and better organized.
Work around SDL+WGL returning GL contexts below minimum specifications
Add glPointParameterf to glext

We need this function to take control of point sprite minimum and
maximum sizes.
Add point min and max size specification

Point sprite scaling is somewhat unpredictable, and varies from one
driver to the next. The most significant differences are the default
values giving the range of sizes at which a sprite can appear. So
we need to specify limits explicitly if we want consistency across all
platforms. Unfortunately, the order and time at which these values are
set appears to determine whether they take hold or not. This too varies
from one platform to the next.

This change takes control of the situation on Linux NVIDIA. Hopefully
it'll port. The maximum sprite size is set to one quarter of the height
of the screen (this is a value in pixels) and the default sizes of the
entity particles are given at around a tenth the height of the screen
(this is a value in pixels as viewed from a distance of 1 unit).

The distance attenuation factors give the change in the AREA of a point,
not the diameter (as do ALL the other values), so perspective-correct
point attenuation must use the quadratic coefficient, not the linear
one. This corrected interpretation is put to use for both coin particles
and material particles.
Merge pull request #54 from parasti/wgl-minimum-spec

Work around SDL+WGL returning GL contexts below minimum specifications
HMD fail gracefully on incapable hardware

This small change checks the framebuffer, vertex buffer, and shader object
state when asked to confirm HMD mode. This causes the game to fall back
correctly on non-HMD rendering if any of the above extensions to OpenGL
are missing.

We might want to add a menu element that highlights the circumstance where
CONFIG_HMD is true but hmd_stat() is false, as this would indicate that the
user tried to turn HMD support on, but the system failed. (Currently it runs
normally but the HMD option says "on", which may be confusing.)
Make GLSL truly optional

If compiling with OpenGL ES, stub all GLSL handlers. If compiling for the
desktop, have all handlers confirm the presence of the extension.
Make FBO truly optional

If compiling with OpenGL ES, stub all FBO handlers. If compiling for the
desktop, have all handlers confirm the presence of the extension.
Throw errors on missing GL extensions

Multitexture, VBO, and point sprites are required extensions. If any of
these is missing, show a message box explaining this and exit.
Tiny changes to Makefile

Remove the inclusion of hmd_common when the HMD backend is hmd_null.
hmd_null does not call hmd_common, and we eliminate all calls to the
HMD module's required OpenGL extensions by omitting it.

This is a part of the effort to make all "optional" GL actually optional.
Tune particles sizes

Coin burst particle size had gotten out of sync with goal particles size.
Also, particle size now takes into account HMD mode.

As point sprites, particle sizes are specified in real on-screen pixels
instead of in world units (meters). Size is determined as a fraction of
screen height so that they remain consistent through resolution changes.
However, HMD mode uses a high-resolution off-screen buffer, and that
buffer has an 8:9 ratio instead of 16:9, so the particle size calculation
has to be special-cased.
Fix HMD GUI positioning

The HMD orthogonal projection was based upon the screen size reported
by the device rather than the screen size actually being displayed.
Thus the wrong values were being used when the HMD was overdriven in
resolution. As a result, the GUI was off center and too large.