Bink SDK 1.5v

# BINKBUFFER_OPEN_FLAGS

The basic type BINKBUFFER_OPEN_FLAGS describes the type and capabilities of the BinkBuffer that you wish to open.

#### Fundamental Values

Value | Description
--- | ---
BINKBUFFERAUTO | Chooses the best BinkBuffer blitting style available. On Win32, Bink will try to open each of the blitting styles from BINKBUFFERPRIMARY to BINKBUFFERRGBOFFSCREENSYSTEM, looking for the best blitting style that matches your resolution and scaling requirements. On MacOS, Bink will try the BINKBUFFERDIRECT and the BINKBUFFERGWORLD, looking for the best style that matches your specifications.
BINKBUFFERPRIMARY | Win32: Opens a BinkBuffer to the primary surface. This blitting style uses the built-in Bink YUV to RGB conversions, so it is guaranteed to look perfect - it just might be a little slower than hardware conversion styles. The primary surface blitting style is unable to perform any scaling or clipping (but you can use the 2x stretching flags as a parameter to BinkCopyToBuffer to get simple 2x stretching). BinkBufferBlit doesn't have to do any work with this blitting style, because the pixels are put directly on-screen inside the BinkBufferLock/BinkBufferUnlock block).
BINKBUFFERDIBSECTION | Win32: Opens a BinkBuffer that is just a thin layer on top of a Windows DIBSection. This is the only blitting style that doesn't require DirectDraw. The BinkBuffer DIB will be created in the same format as the desktop for the fastest possible blitting. You can still use the BINKBUFFERRESOLUTION flag with this blit type - it will use ChangeDisplaySettings instead of DirectDraw to switch modes.
BINKBUFFERYV12OVERLAY | Win32: Opens a BinkBuffer to a YV12 overlay surface. This is the fastest possible blitting style, but it is also the rarest for a video card to support (some ATI and nVidia cards support it). This blitting style may or may not be able to perform scaling and clipping. BinkBufferBlit doesn't copy the pixels to the screen with this blitting style, rather, it blits color-keyed pixels onto the screen (which causes the overlay pixels to show through). If the color-keyed pixels are already on the screen, then the converted pixels will appear as soon as they are written to inside the BinkBufferLock/BinkBufferUnlock block - just like the primary surface blitting style.
BINKBUFFERUYVYOVERLAY | See next...
BINKBUFFERYUY2OVERLAY | Win32: These two flags open a BinkBuffer to a YUY2 or UYVY overlay surface. These are the most common overlay surfaces and are supported by almost all video cards. This blitting style may or may not be able to perform scaling and clipping. BinkBufferBlit doesn't copy the pixels to the screen with this blitting style, rather, it blits color-keyed pixels onto the screen (which causes the overlay pixels to show through). If the color-keyed pixels are already on the screen, then the converted pixels will appear as soon as they are written to inside the BinkBufferLock/BinkBufferUnlock block - just like the primary surface blitting style.
BINKBUFFERYV12OFFSCREEN | Win32: Opens a BinkBuffer to a YV12 off-screen buffer. With this blitting style, the video driver converts the YUV data to RGB during the blitting stage. This blitting style may or may not perform scaling or clipping. BinkBufferBlit copies the pixels onto the screen - the BinkBufferLock/BinkBufferUnlock block just loads the Bink pixels into the off-screen buffer. The Bink software blitters are usually faster than this blitting style.
BINKBUFFERUYVYOFFSCREEN | See next...
BINKBUFFERYUY2OFFSCREEN | Win32: These two flags open a BinkBuffer to a YUY2 or UYVY off-screen buffer. With this blitting style, the video driver converts the YUV data to RGB during the blitting stage. This blitting style may or may not perform scaling or clipping. BinkBufferBlit copies the pixels onto the screen - the BinkBufferLock/BinkBufferUnlock block just loads the Bink pixels into the off-screen buffer. Pretty much all video cards support at least this level of hardware YUV to RGB conversion. The Bink software blitters are usually faster than this blitting style.
BINKBUFFERRGBOFFSCREENVIDEO | Win32: Opens a BinkBuffer to an off-screen RGB buffer that resides in the video card RAM. With this blitting style, Bink converts the YUV data to an off-screen RGB format. This blitting style is almost always able to perform scaling and clipping. BinkBufferBlit copies the pixels onto the screen - the BinkBufferLock/BinkBufferUnlock block just gets the RGB Bink pixels into the off-screen buffer.
BINKBUFFERRGBOFFSCREENSYSTEM | Win32: Opens a BinkBuffer to an off-screen RGB buffer that resides in the system card RAM. With this blitting style, Bink converts the YUV data to an off-screen RGB format in system memory. This blitting style supports scaling and clipping, but it is the slowest of all of the blitting styles. BinkBufferBlit copies the pixels onto the screen - the BinkBufferLock/BinkBufferUnlock block just gets the RGB Bink pixels into the off-screen buffer. You should almost always use the BINKBUFFERDIBSECTION style instead of this option - it will have the same or better capabilities and is more more widely compatible.
BINKBUFFERDIRECT | MacOS: Opens a BinkBuffer in direct-to-screen mode. This blitting style uses the built-in Bink YUV to RGB conversions, so it is guaranteed to look perfect and will run very fast. The direct-to-screen blitting style is unable to perform any scaling or clipping (but you can use the 2x stretching flags as a parameter to BinkCopyToBuffer to get simple 2x stretching). BinkBufferBlit doesn't have to do any work with this blitting style, because the pixels are put directly on-screen inside the BinkBufferLock/BinkBufferUnlock block).
BINKBUFFERGWORLD | MacOS: Opens a BinkBuffer to a standard MacOS GWorld graphics buffer. This blitting style is the most compatible on MacOS machines, but it will be slower than BINKBUFFERDIRECT. This blitting style is capable of both clipping and scaling. With this blitting style, BinkCopyToBuffer copies into the GWorld and you use BinkBufferBlit to blit the pixels onto the screen.
BINKBUFFERRESOLUTION | Add this flag to one of the above blitting styles to force Bink to switch video mode resolutions when the BinkBuffer is opened. You must call the BinkBufferSetResolution function before using this flag to tell Bink what resolution to switch into. Note that the BinkBuffer will still be opened even if Bink was unable to switch to your requested mode. You should examine the ScreenWidth, ScreenHeight and ScreenDepth fields of the BinkBuffer structure to see if your requested mode was successfully set.
BINKBUFFERSTRETCHXINT | See next...
BINKBUFFERSTRETCHX | See next...
BINKBUFFERSHRINKXINT | See next...
BINKBUFFERSHRINKX | Add one or more of these flags to request the type of X (width) stretching and/or shrinking that you require. The flags with "INT" on the end mean integral stretching or shrinking (a 2x zoom, or a half-size shrink, for example). Many cards can only do integral scaling, so be sure to use the integral flag if that's all you need, or the BinkBuffer could otherwise fail to open.
BINKBUFFERSTRETCHYINT | See next...
BINKBUFFERSTRETCHY | See next...
BINKBUFFERSHRINKYINT | See next...
BINKBUFFERSHRINKY | Add one or more of these flags to request the type of Y (height) stretching and/or shrinking that you require. The flags with "INT" on the end mean integral stretching or shrinking (a 2x zoom, or a half-size shrink, for example). Many cards can only do integral scaling, so be sure to use the integral flag if that's all you need, or the BinkBuffer could otherwise fail to open.

#### Discussion

Use these flags as the open_flags parameter in the BinkBufferOpen function. They specify the type and capabilities of the YUV blitting buffer that you require. Note that if you don't specify any of the various scaling flags, then you might still get a blitting style that allows scaling with BinkBufferSetScale function - but probably not! So, if you know that you're going to be scaling, then you should always use one of the scaling flags when calling BinkBufferOpen.

Group: BinkBuffer API
Related Sections: Locking and Unlocking, Scaling
Related Functions: BinkBufferBlit, BinkBufferGetDescription, BinkBufferLock, BinkBufferOpen, BinkBufferSetResolution, BinkBufferSetScale, BinkBufferUnlock, BinkCopyToBuffer
Related Basic Types: BINKBUFFER_OPEN_FLAGS

For technical support, e-mail Bink1@radgametools.com
© Copyright 1994-2003 RAD Game Tools, Inc. All Rights Reserved.