If you instantiate a movie without specifying a visual context, the movie’s graphics destination is set to your program’s current graphics port (the port for the active window or thread). This is always the case when using versions of QuickTime prior to QuickTime 7 or when using NewMovieFrom... functions that do not accept a visual context.
You are not responsible for displaying individual frames when rendering to the default graphics port; this is handled automatically.
Important: If you use a graphics port instead of a visual context, your program’s graphics port must be valid when the movie is created, even if the movie is sound-only. The graphics port must remain valid for the life of the movie (or until you set a different graphics destination for the movie using SetMovieGWorld or SetMovieVisualContext).
You can use GetGWorld to check for a valid port, and use NewGWorld to create a port if needed, before instantiating a movie.
A graphics port is automatically created when you create a window in the Mac OS. Your movie output typically goes to a view within a window, and therefore to the window’s associated port; but if your application has not created a window, you may need to create a graphics port separately.
In the Windows OS, you create a valid graphics port using NewGWorld and associate it with your window by calling CreatePortAssociation. (You also need to call DestroyPortAssociation before disposing of your window.) Alternatively, you can create a GWorld that corresponds to your window’s current graphics device by calling GetNativeWindowPort.
Last updated: 2005-08-11