To change an existing movie’s graphics destination to a new visual context, call SetMovieVisualContext.
To change an existing movie’s graphics destination to a new GWorld, call SetMovieGWorld. If the movie is currently using a visual context, free the context by calling SetMovieVisualContext, passing in NULL instead of a VisualContextRef, before setting the GWorld.
To disable visual rendering, call SetMovieVisualContext, passing in NULL instead of a VisualContextRef.
To get a movie’s current graphics destination, call GetMovieVisualContext. If the movie’s destination is a GWorld instead of a visual context, this function returns an error (kQTVisualContextRequiredErr); you can then call GetMovieGworld to obtain the GWorld.
GetMovieGWorld does not return an error for movies that use a visual context instead of a GWorld. It gives a special GWorld value that represents the visual context. This provides backward compatibility with existing code that gets a movie GWorld and later restores it.
Note: It is common practice to get a movie’s current graphics destination, set the movie’s graphics destination temporarily, then restore the original graphics destination. Prior to QuickTime 7, this was done by calling GetMovieGWorld to get a pointer to the current destination, then calling SetMovieGWorld to restore it. Existing code that uses these functions also works with movies that use a visual context.
Last updated: 2005-08-11