SDL graphics drawing primitives and other support functions