Automatically generate mipmaps if possible.

Signed-off-by: John McCutchan <john@johnmccutchan.com>
Add texture 2D example.

Signed-off-by: John McCutchan <john@johnmccutchan.com>