A seething Oscar Pistorius fired his pistol out of a car's open sun-roof after an argument with a police officer, his ex-girlfriend Samantha Taylor told a court.

Giving evidence in the Pretoria High Court on Friday, she described how the athlete shouted at a policeman after their car was pulled over for speeding south of Johannesburg in September 2012.

After seeing Pistorius' pistol lying on the car seat, the officer picked it up and emptied its magazine onto the floor of the car, prompting an outburst from Pistorius, Taylor said.

When they were allowed to go on their way, Pistorius and the driver, a friend called Darren Fresco, started to joke about shooting out a traffic light, known in South Africa as a robot, Taylor said.

"Oscar was very angry," said Taylor, who was sitting in the back seat at the time of the incident.

"Thereafter they were joking around and saying they wanted to shoot a robot."

"Two minutes after, I saw Oscar take his gun and shoot out of the car roof. A very loud sound. They both laughed," she said.

Pistorius is being tried for the murder of Reeva Steenkamp, his girfriend, at his home on February 14 last year. He denies murder, saying he mistook her for an intruder when he fired four shots through a locked toilet door.

He is also charged with three separate firearms offences.

Other gun incidents

Taylor also described two other incidents in which Pistorius drew his gun.

The first was when he jumped out of his car at the gateway of his Pretoria housing complex and put his gun to the window of a black BMW that appeared to have been following him.

The other was when he woke up in the middle of the night after hearing a bang in the bathroom adjoining his bedroom.

"Something hit the bathroom window and Oscar woke me up and asked me if I had heard it," Taylor said, noting that the noise had probably been from a passing storm.

"He got up with his gun and walked out of the room."

Taylor, who broke into sobs twice during her evidence, also said there had been "one or two" other occasions when Pistorius woke her after hearing noises during the night.

Pistorius presented an affidavit at his bail hearing in which he said he did not check whether Steenkamp was still in the bed before going into the bathroom to confront the supposed intruder on the night he shot her.

Several witnesses have given evidence to hearing female shouts and screams coming from the house before the shots.

Source: Reuters