These aren't bugs, but they're (small) enhancements:
in beginScene(), f32 inv probably ought to be const f32 inv
in draw3DLine(), the 2nd glColor4ub is not needed (previous glColor4ub state persists)
in drawVertexPrimitiveList(), glFlush is not needed. A flush will happen when you flip buffers in endScene(). Note: I haven't tested with single buffer mode, so *maybe* a glFlush is desirable in endScene().