Update main.c

Refactoring (Extract method) setWindow()
Merge pull request #1 from raphaeljlps/master

Update main.c