wrote custom surface drawing code to reduce dependancy on sdl