Changing graphics mode

You must set color depth before any window is created. Check error codes for unsupported modes.