Added functionality for creating 2D textures programmatically.