Table of Contents Glide Programming Guide



Download 6.22 Mb.
Page84/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   80   81   82   83   84   85   86   87   ...   106
GLIDEPGM

6Writing to the LFB


To write directly to the linear frame buffer, obtain a write-only LFB pointer as described above. The call to grLfbLock() specifies a writeMode that defines the data format and a y origin location for the LFB writes. Both of these can be set to default to whatever conditions exist in the buffer. The pixelPipeline parameter enables or disables the pixel special effects pipeline.
Previous versions of Glide contained explicit routines to set the write mode and LFB origin and to enable or bypass the pixel pipeline: grLfbWriteMode(), grLfbOrigin(), and grLfbBypassMode(). These routines are obsolete in Glide 2.2 and later versions.
The incoming pixel data can be interpreted in many different ways depending on the current linear frame buffer write mode and color ordering configuration. The source of depth, alpha, and color information is determined by a combination of the current linear frame buffer write mode and whether the pixel special effects pipeline is being bypassed or not. If the selected writeMode lacks depth information, then the value is derived from grLfbConstantDepth. If the writeMode lacks alpha information, then the value is derived from grLfbConstantAlpha. Linear frame buffer writes through the pixel pipeline may not be enabled for auxiliary buffer locks. The pixelPipeline argument is ignored for read only locks.
The procedure for writing to the LFB is as follows:

  1. If the pixel pipeline and depth buffering or alpha buffering are enabled, and if the desired writeMode is lacking depth or alpha values, set constant values for depth and/or alpha with grLfbConstantDepth() and grLfbConstantAlpha().

  2. Call grLfbLock() to get a write pointer. Specify a write mode and y origin if desired. Bypass the pixel pipeline if desired.

  3. Write into the linear frame buffer using the write pointer.

  4. Disable LFB writing and free the buffer by calling grLfbUnlock().

Each of these steps and the associated Glide functions are addressed in the remainder of this chapter, accompanied by examples of their use.

Download 6.22 Mb.

Share with your friends:
1   ...   80   81   82   83   84   85   86   87   ...   106




The database is protected by copyright ©ininet.org 2024
send message

    Main page