Add optional transparent background. Improve window size handling. Clean up switch statements.