Strict

Import pantson.mpeg

Local m:Tmpeg
Local i:timage

' set to OpenGL if you want to.
' functions run faster in OpenGL.
' module still caters for DirectX
' SetGraphicsDriver(GLMax2DDriver())
Graphics 800,600,0

' load in movie
m = OpenMPEG("drwho.mpg")
m.autoloop = True

' create image
i = CreateImage(MPEGwidth(m),MPEGheight(m))

' start mpeg
StartMPEG(m)

' loop until EndOfMpeg
While Not EOM(m) And Not KeyDown(key_escape)
	' if new frame	
	If DrawMPEGimage(m,i) = True
		' set scale to full screen for mpeg
		MPEGfullscreen(m)
		' draw frame
		DrawImage i,0,0
		Flip
	EndIf
Wend

' close
CloseMPEG(m)
End
