piglit-dispatch: Remaining infrastructure.

Previous patches introduced code generation for the auto-generated
portions of the piglit-dispatch mechanism.  This patch supplies the
remaining hand-written code, which includes:

- Code to initialize piglit-dispatch.

- The actions to be taken when looking up a function, when function
  lookup fails, or when a function is unsupported.

- Code to determine whether piglit-dispatch has been initialized,
  which GL version is supported, and whether a given extension is
  supported.

- Code to look up a function using a name supplied at run-time.

- Definitions of basic GL types.

v2: Make "inline" work in MSVC.  Fix type of intermediate function
pointers.  Only try to include "glxew.h" on Linux.  Fix MSVC
definition of int8_t.  Add #include "piglit-dispatch.h" to
piglit-dispatch.c for clarity.  Get rid of "__" in function names.
Only call reset_dispatch_pointers() if necessary.  Use "\param" in
comments.  Define APIENTRY/GLAPIENTRY properly on Windows.
piglit-dispatch: Switch to using piglit-dispatch instead of GLEW.

Previous patches set up the piglit-dispatch infrastructure but did not
use it.  This patch enables piglit-dispatch and uses it instead of
GLEW.

No piglit regressions on Intel SandyBridge (Linux) or Mac OSX.

v2: Remove redundant includes of GL headers.
Windows experiment: disable default_get_proc_address.
piglit-dispatch: Remove GLEW.

This patch removes the files glew.c and glew.h, which are no longer
used.  The "piglit-dispatch" mechanism is used instead.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Remove GLEW workarounds.

This patch removes workarounds that were in place to compensate for
bugs in GLEW.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Windows experiment: only do the bool workaround if not c++
glean: use piglit_get_proc_address().

Previously glean got the address of GL functions by directly calling
an OS-specific function (e.g. glXGetProcAddressARB(), dlsym(), or
wglGetProcAddress()).  This patch changes it to use
piglit_get_proc_address(), which uses piglit-dispatch.  This will help
pave the way for adapting glean to test using GLES and
forward-compatible contexts.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Changed the return type of glean's getProcAddress to "void
(APIENTRY *)()" so that no type casting is necessary on Windows.
Windows experiments
Windows debug
Windows debug
Windows debug
Windows experiment: always go through wglGetProcAddress
Windows experiment: cast return value from wglGetProcAddress
Windows experiment just 1.0 and 1.1 are directly bound
Windows experiment: cast return value of GetProcAddress()
Windows glean fix: make tex[] larger
Jose points out an APPLE type difference
cmake: Move utility functions into piglit_util.cmake

Currently there is only one utility function, piglit_include_target_api.
However, subsequent commits will add several more.

I'm choosing to define all the utility functions in their own file,
piglit_util.cmake, in order to keep things organized and the top
CMakeLists uncluttered.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Define wrapper functions piglit_add_{executable,library}

For now, `piglit_add_executable` is a trivial wrapper around
`add_executable`.  Ditto for `piglit_add_library`.

A subsequent commit will leverage the wrappers to add to each object file
an explicit dependency on the header files generated by piglit_dispatch.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Replace calls to add_{executable,library} with wrappers

Replace
    add_executable -> piglit_add_executable
    add_library -> piglit_add_library

For now, each wrapper function trivially wraps the function it replaces,
and so this patch changes no behavior.

This commit was created using the command:

   sed -i -e "s/add_executable/piglit_add_executable/" -e "s/add_library/piglit_add_library/" $(find src/ tests/ -name "*CMakeLists*")

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>