libretro/RetroArch — pull request #256 by Themaister (2013-07-12 23:56:14+00:00)
Title: OpenGL improvements.

Here is my branch with OpenGL improvements. **Don't merge yet**, but I want it to be looked over.
Work needs to be done on OSX. It should work on Linux and Windows at least.

libretro GL API significantly improved:
- Moved from EXPERIMENTAL to mainline. Structs have changed and maintain same name. However, the ABI change is explicitly accounted for in RetroArch, so no breakage is possible. I expect this API to be final.
- Can create stencil buffers (24/8 packed with depth).
- Can use bottom-left ordering.
- Can request cached contexts (context resets shouldn't happen outside init).
- Can request OpenGL core context.
- Can get notification about context destroy (if not using cached context and you handle it correctly, this is the safest approach).

libretro-test-gl is updated to optionally use core context. It also demonstrates how multisampling can be used in a core (glRenderbufferStorageMultisample + glBlitFramebuffer to resolve multisample).

OpenGL symbol loading is completely revamped. Before, tons of PFNGL crap was littered all over gl.c and friends. I've centralized all of this in gfx/glsym. It's reusable, and doesn't require messy pgl* override macros. Problem is that OSX is very "non-standard", so it will probably take some work to make it work there. Better than #ifdeffing for __APPLE__ all over the place in gl.c at least.

I've also added (untested) support for PASSPREV/PassPrev support in Cg/GLSL. At request of Hyllian, it makes it easier to chain fancy multipass shaders together. I also added some "cleaner" aliases to TEXCOORD0, TEXCOORD1 and modelViewProj to better match the rest of the spec and GLSL. All of this requires a spec update, so it's not public yet.