Textures in the 3D preview

I haven't pushed the code yet, it needs to be cleaned up a bit first, but textures are partially working in the 3D preview now.

Upside-down textures are because of the differences between Direct3D and OpenGL texture coordinates, I think I know how to fix those in a way that will preserve tiled textures.

Upside-down textures are because of the differences between Direct3D and OpenGL texture coordinates, I think I know how to fix those in a way that will preserve tiled textures.