Tuning up PR670 support code.
Merge pull request #48 from kleinerm/master

Fixes to monitor calibration.
moglcore: Parser and wrapper/C-Code generator -- Handle more functions.

Updated to be more robust against unparseable functions. Skip them
instead of aborting.
Handle new data types properly: GLint64, GLuint64 and GLsync
Exclude some functions from auto-generation:
glDebugMessageCallback[ARB], glCreateSyncFromCLeventARB (for OpenCL
interop)
Tested against latest glext.h from Khronos / OpenGL ARB.
Add updated glext_edit.h with latest OpenGL 2.1 extensions as of Aug-2012

Now up to date until 13. August 2012 (Version 84).

This includes all new OpenGL extensions of the last couple of years,
from GL_ARB_draw_instanced up to and including
GL_ARB_texture_storage_multisample.

It excludes legacy extensions ie., SGI, NV, ... that were excluded
before because they only have historical meaning.

As usual glext_edit.h is a stripped version of the official glext.h,
with all legacy and redundant lines removed. Copyright was and is the
MIT/X11/BSD-3 style Khronos license, as before.
Update gl_auto.c with latest OpenGL extension support code.

Autogenerated from new glext_edit.h with updated code generator. This
doesn't compile yet as we also need updated GLEW etc.
Update GLEW as used by moglcore to current version 1.9.0

Also remove our now redundant define of glPointParameteri[v] -- GLEW
defines it now.
moglcore: Add some functions to omit to autono.txt

Apparently due to some small bugs or omissions, the most recent version
of GLEW v1.9.0 does not include some gl extension functions although it
does support those extensions. While most of the functions of those
extensions are supported, a few are missing, likely due to some bug in
GLEW. For now, we omit these functions from moglcore, until the
problems are fixed in upstream GLEW. None of these functions seems
crucial for typical MOGL use and the relevant extension specs have only
been released this month, so the extensions are so new that almost none
of the current shipping mainstream os'es supports them anyway.

Affected: glPopDebugGroup in the new GL_KHR_debug debug feedback
extension. This prevents use of debug groups, but debug groups are such
an advanced debugging concept i can hardly see how their use could ever
become relevant to a typical PTB app.

Most of the remainder of the debug extension is supported, except for
glDebugMessageCallback, and its counterpart glDebugMessageCallbackARB
from the GL_ARB_debug_output extension. Implementing support for these
debug callbacks would be possible, mapping them to Matlab/Octave
callbacks, but it is likely not worth it for MOGL's typical scope of
use. The same information available via the callbacks can be logged
into the debug log and easily retrieved from there without extra effort.

Affected: Some EXT functions in the brand-new
GL_ARB_vertex_attrib_binding extension, which are only available if
EXT_direct_state_access is present.
moglcore: Rebuild against GLEW 1.9.0

Regen gl_auto.c with problematic functions excluded as per previous
commit.
Rebuilt moglcore.mexmaci64 for 64-Bit Matlab on OSX and tested.
Longer timeout, because the PR-670 can take a while in extended mode.
MOGL: Add new M-File wrappers and fix existing ones for new OpenGL extensions.

Add many new auto-generated M-File wrappers for the new OpenGL
extensions. Fixup many of the _glGenXXX or _glGetXXX wrappers, both new
and old ones, which require manual intervention due to memory
allocation.

We still have a couple of disabled _glXXX wrappers left, which are
somewhat cumbersome to handle. The ones committed here are the "simple
ones" which just needed mechanical grunt work transformations. Of
course all of these new/converted wrappers are entirely untested and
there's a good chance of the occassional error which will puzzle the
unsuspecting user, or simply crash the runtime if somebody tries to use
a broken function.
MOGL: Delete support for ARB_imaging extension.

We won't ever support these, as no shipping os, driver or gpu supports
these in any meaningful fashion:
Most gpu's don't support ARB_imaging at all, and the few os/driver/gpu
combos that do, do so in a rather buggy fashion, with a very low
performance due to pure software fallback implementations. Users are
much better off either using Matlab/Octave's image processing for
convenience, or PTB's gpu/shader based image processing pipeline for
performance.
MOGL: Fixup more of the glGetXXX functions.

These needed lots of case-by-case hacks.
MOGL: Update OpenGL constants in oglconst.mat.

Improve oglconst.m parser to handle some quirks of the current glext.h
and gl.h header files, e.g., 64-Bit integer size #defines and #define
GL_THIS GL_THAT pseudo-recursive definitions.

Include the full unedited glext.h file from Khronos with all the
#defines. This is the file from which glext_edit.h is derived by simply
stripping out lots of content. This brings our constant definitions up
to date as of August 2012.

oglconst.mat rebuilt by parser.
moglcore: Rebuilt for 64-Bit Octave on Linux.

Compiler warnings indicate, that the following new OpenGL functions
may be broken in our current moglcore, because they need double-
indirection of pointers (**) instead of single-indirection (*) and
our code generator can't handle this properly:

glGetUniformIndices() - Not a problem, as the M-File wrapper is
also broken. This would need lots of manual work on C/M-Side to
make it work.

glMultiDrawElementsBaseVertex() - Likely broken.
glCreateShaderProgramv() - Likely broken.

Same applies for OSX compile, just the compiler there was too
dumb to provide any diagnostic warning messages to point it out.
glMultiDrawElementsBaseVertex(): Reimplement as M-Wrapper.

It is hard to implement it in the C level API due to double pointer
indirection, but we can reimplement it as a iterative M-File loop
around glDrawElementsBaseVertex(), just as defined in the official
function spec.
MOGL: glCreateShaderProgramv - Reimplement as M-File wrapper.

Reimplement the function by means of existing functions, according to
the official OpenGL-4 spec. This is more simple than doing it in
C-Code, which would need complex and redundant parser code.

However, this is just for completeness, as the high-level
LoadGLSLProgramFromFile() function and other PTB helpers do the same
job in a much more convenient way.
glMultiDrawElements - Reimplement as M-File wrapper.

Similar to glMultiDrawElementsBaseVertex().
MOGL: Exclude manually reimplemented functions from C-Code generation.

glMultiDrawElementsBaseVertex, glMultiDrawElements,
glCreateShaderProgramv, glGetUniformIndices are now excluded from
auto-wrapping/building.
Add compatibility hacks for legacy Quicktime movie playback/recording to demos.

Add hacks to LoadMovieIntoTexturesDemo, PlayMoviesDemo and
VideoRecordingDemo to keep them functional with the legacy Quicktime
engine on 32-Bit OSX.

PlayMoviesDemo also gets a new 'c'ool internet streaming movie as
default playback with some more info about Linux. Reenable Apple
PR-Bullshit videos for the legacy 32-Bit OSX PTB, as these are the only
streaming videos that QT can actually play in 'c'ool mode.
osxmakeit: Add check so it only runs on 64-Bit Matlab on OSX.