SpinningMovieCube: Update for current environment.

Was a bit broken and outdated.
PsychColorCorrection: Support color transformation by 4x4 matrix multiply.

New 'SetMultMatrix4' function allows definition of 4-by-4 color
transformation matrix for projective color transformations with
possible included bias.

New shader ICMMatrixMult4Shader.frag.txt performs actual color correction
by matrix multiply.
Screen('TransformTexture') -- Fix specialflags setting 0x2

Optional specialFlags setting 2 should request high-precision
processing, default should be standard processing. It was the exact
opposite - Default was high precision processing.
Fix it.
Screen('BeginOpenGL') - Only do one-time viewport setup on onscreen windows.

Only perform the 1st time bind viewport/scissor/etc. setup on real
onscreen windows, not on offscreen windows. Offscreen windows share the
OpenGL context and its state with their parent onscreen windows.
Performing the one-time setup on first bind is unexpected behaviour.

Fixes FDFDemo.m / moglFDF().
Screen: Add render-to-texture support for GL_TEXTURE_2D textures.

We so far only allowed to create GL_TEXTURE_2D textures of power-of-two
size for drawing them / applying them to 3D surfaces. Other uses have
been unsupported.

Now we extend support for this texture type:

* Render-to-texture via OpenGL FBO's is now supported for drawing into
them or using them as backing storage for Offscreen windows.

* The GPU image processing pipeline can handle them now, ie.,
Screen('TransformTexture') can work with them now.

* We now accept non-power-of-two sizes if the GPU supports this,
allowing to use GL_REPEAT texture coordinate wrapping modes on them
even if they are not power-of-two sized, for enhanced scrolling support.

This allows to use them almost everywhere and to have better interop
with 3rd party OpenGL components, e.g., Horde3D.

Some restrictions remain:

They can't be used as framebuffers for onscreen windows, as the image
post-processing pipeline is tuned to use of GL_RECTANGLE textures.
Should not be a problem, as these buffers are opaque to the outside
world and never need to directly interact with external toolkits.

Our builtin GLSL shaders for special operations like HDR drawing,
YUV-I800 and YUV-I420 texturing, self-made filtering, planar texture
support etc. do not support sampling from GL_TEXTURE_2D textures. This
means that the format can't be used with such special modes - or more
specific: If one wants to use them, one needs to provide dedicated
shaders and attach them manually to the textures - PTB will not
automatically take care of it. This is a small inconvenience. It is
easy to code such shaders, but not worth doing as a default part of
PTB, as simultaneous use of GL_TEXTURE_2D and such special formats is a
tiny corner-case, rather unlikely to be used ever.

Screen.mexmaci64 for 64-Bit Matlab on OSX rebuilt & tested.
Screen: Improve mip-mapped texture filtering.

Screen('DrawTexture', ...) filterMode argument now accepts negative
values to define a specific downsampling level: -1 = original res., -2
= half res., -3 = quarter res., -4 = 1/8 res. etc. -- selects mip-level
to use for mip-mapped texture filtering.

'DrawTexture' now auto-generates the mip-map image resolution pyramid
on demand, if a mip-mapped filtermode is used. Each time a texture is
updated via one of the texture creation functions, by
'TransformTexture' or by drawing into it, a rebuild of mip-maps is
triggered in 'DrawTexture' on next draw. We use the GL_GENERATE_MIPMAP
auto-generation for non render-to-texture and manually
glGenerateMipmap() triggered regeneration for render-to-texture cases.
Seems we need to use both methods, intermixed for what looks like it
could be a graphics driver bug on OSX 10.7 -- at least nothing in the
official specs hints that we'd need to do it how we have to do it,
glGenerateMipMap should always "just work(tm)", but apparently doesn't
without screwing up big time.

Screen for 64-Bit Matlab on osx rebuilt and tested.
Screen: Allow opt-out of auto mipmap creation.

New 'specialFlags' setting (usually 8, sometimes 16) to texture
creation functions allows to disable auto-(re)generation of texture
mipmap pyramid if texture content changes.

This allows usercode to define custom (e.g., shader-based) mipmap
downsampling methods if the default "gpu builtin" algorithm is not good
enough. Typically the builtin procedure is a box filter.

By default, mip-maps get autogenerated if a 'filterMode' with
mipmapping is selected during Screen('DrawTexture').

Screen for 64-Bit Matlab on OSX rebuilt & tested.
BlurredVideoCaptureDemo: Clean it and move it.

Clean it up a bit, move it from PsychAlpha to PsychDemos were it
belongs.
New: BlurredMipmapDemo - Use mipmapping for blurred gaze-contingent display.

BlurredMipmapDemo.m can do a gaze-contingent display with increasing
blur level away from the current mouse cursor position (aka gaze
position) on both live video or played back movies. It uses the new
mip-mapping functionality + an adaptive shader.
Screen: Add two additional mipmap filterMode's

Modes 4 and 5 for nearest neighbour interpolation with either nearest
neighbour mipmapping or linear interpolated mipmapping. These to allow
custom shaders to perform nearest neighbour sampling in all dimensions
if they wish, e.g., for complex filtering ops.
New: CreateResolutionPyramid() for manual shader based mipmap generation.

Allows to create the mip-map chain of a texture "manually" by
successive downsampling, running a selectable glsl shader on each
level. This for cases where the standard box filter of GPU mipmap
generation doesn't cut it.
BlurredMipmapDemo: Add custom mipmap generation support.

Employs CreateResolutionPyramid() together with a dummy-shader
"MipMapDownsamplingShader.frag.txt" for custom mipmap generation.

This is not yet very meaningful, as the shader doesn't do meaningful
quality-enhancing filtering. Just a placeholder.
mogl: Implement raw pointer support for glTexImage2D()

glTexImage2D / moglcore now accepts scalar values with raw memory
pointer values (e.g., 0 for NULL), not only matrices with image content.

This is similar to behaviour of functions like glReadPixels().
Especially useful here to pass in a real NULL pointer to allocate
texture object storage without initializing it with content.

moglcore.mexmaci64 for 64-Bit Matlab on OSX rebuilt.
CreateResolutionPyramid(): Make mip-map chain init more efficient.

Now we allocate the mip-chain without initializing its content. Avoid
needless mip-computation.
BlurredMipmapDemo: Implement more useful mipmap downsampling shader.

MipMapDownsamplingShader.frag.txt now not only does (optional) color ->
grayscale conversion, but proper downsampling via a 3x3 gaussian blur
kernel.

Actual tangible benefit of shader-based method vs. GPU auto-mipmap
generation.

This is still a proof-of-concept shader, not necessarily the most
opimal implementation, just to show interested people how to roll their
own method.
Screen, moglcore for 64-Bit Octave on Linux rebuilt.
Merge branch 'master' into KukaPlayer