Adding generate window texture
Combining window generation into a single function