vispy/vispy — pull request #283 by almarklein (2014-06-25 11:46:40+00:00)
Title: Refactor use func

This PR basically does three things:

1) `Application.use()` no longer exists. When you create an Application object, you specify the backend. No more backend-less state.
2) There is no more `app.default_app` because it is initially None, which makes things complicated. Instead, use `Application.get_default_app()` to get the default app instance.
3) There is now a `vispy.use()` function that acts as a proxy for `app.use` and `gloo.gl.use`.

Some explanation on 3: One can now do e.g. `vispy.use('glfw pyopengl')`. A more interesting example is `use('pyqt4 es2')` in which case the app backend must know that it should use EGL (instead of a desktop context). And later on ... `use('ipython_notebook')` or `use('browser'). This PR thus paves the way (a wee bit) towards use of ES2, Angle and browser-based rendering.