README.txt

README - VRBackBuffer
 
The files "VRBackBuffer PPC.mcp" and "VRBackBuffer 68k.mcp" are Code Warrior 3.1 project files. These build, respectively, PowerPC and 68K applications that demonstrate how to use the back buffer access routines. The main thing they illustrate is how to work with back buffers that are oriented vertically (QuickTime VR 2.1 and earlier) and horizontally (QuickTime VR 2.2 and later).
 
The file "VRBackBuffer Win.mcp" builds a Windows version of the same application, also using CodeWarrior. The file "VRBackBuffer.mak" is a makefile for use in building the VRBackBuffer application using the Microsoft Visual C++ development environment.
 
With this application, you can open a QuickTime VR panorama movie and, using the BackBuffer menu, execute back buffer routines that assume the back buffer is vertical or horizontal. Each simply draws a picture resource into the back buffer at the current pan location. Note that two PICT resources are used in these examples: one that is pre-rotated 90 degrees counterclockwise and one that is not. The pre-rotated pict has a yellow dot in the center to distinguish it from the non-rotated pict.
 
There are six menu items in the BackBuffer menu. Five of these use the back buffer access routines.
 
Rotated Pict - Horiz Flag off <correct>
 
This menu item corresponds to the old way of accessing the back buffer. The user's
back buffer drawing routine assumes the back buffer is vertically oriented
(i.e. rotated 90¡ counterclockwise) and thus draws a pre-rotated pict into the back buffer.
QuickTime VR 2.2 recognizes this situation (by the fact that the new flag kQTVRBackBufferHorizontal has not been set in areaOfInterest.flags). QuickTime VR sets up an intermediate buffer that the user's back buffer drawing routine draws into and then rotates that buffer into the horizontal back buffer.
 
Rotated Pict - Horiz Flag on <wrong>
 
This example is provided to show what happens if you set the kQTVRBackBufferHorizontal
flag but still try to draw a pre-rotated pict into the back buffer. The result is
the picture rotated sideways in the panorama view.
 
Normal Pict - Horiz Flag on <correct>
 
This is the new proper way to access the back buffer. Since the buffer is now
oriented horizontally (i.e. it is not rotated), you do not need to pre-rotate whatever
you are drawing into the back buffer. However, you must set the kQTVRBackBufferHorizontal
flag in areaOfInterest.flags. Otherwise QuickTime VR 2.2 will assume that the user's
back buffer drawing routine thinks the back buffer is vertical.
 
Normal Pict - Horiz Flag off <wrong>
 
This example shows what happens if you try to draw an unrotated picture into the
back buffer but fail to set the kQTVRBackBufferHorizontal flag in areaOfInterest.flags.
The picture is rotated by QuickTime VR into the backbuffer and thus appears rotated sideways in the panorama view.
 
Uninstall BackBufferProc
 
This menu item uninstalls any back buffer proc and refreshes the back buffer.
 
Is My Back Buffer Horizontal?
 
This menu item calls the routine QTVRGetBackBufferSettings to find out if the
current back buffer is horizontal (as indicated in the geometry parameter). If
QuickTime VR 2.2 is installed, then the buffer will be horizontal. If an earlier version
is installed, then the buffer will be vertical.
 
Note that if a version of QuickTime VR earlier than 2.2 is installed, the menu items that
set the kQTVRBackBufferHorizontal flag will return an error. The first menu item will do
the right thing and the fourth menu item (normal pict - horiz flag off) will display the
pict rotated sideways in the panorama view. The second and third menu items will not cause any picture to be displayed.
 
Also note that it is important to properly set the flagsOut parameter within your back buffer
drawing routine. If you do any drawing, you must set the kQTVRBackBufferFlagDidDraw flag.
QuickTime VR examines this flag and uses it to determine if it is necessary to copy data
from any intermediate buffers into the back buffer.
 
© 1999 Apple Computer, Inc.  All rights reserved.
Enjoy,
QuickTime Team