FrameBufferHandler
FrameBufferInterface
typedef struct st_LWFrameBufferHandler {
LWInstanceFuncs *inst;
LWError (*open) (LWInstance, int w, int h);
void (*close) (LWInstance);
LWError (*begin) (LWInstance);
LWError (*write) (LWInstance,
const LWBufferValue *R,
const LWBufferValue *G,
const LWBufferValue *B,
const LWBufferValue *alpha);
void (*pause) (LWInstance);
} LWFrameBufferHandler;
This handler is used
to display the output of rendering as each frame is completed. This is
for the user to view, so the frame buffer should also be able to
pause waiting for user input.
A frame buffer is an instance, but it may be very limited. The built-
in frame buffers have no UI and no stored state.
- open
- Open display at the given size.
- close
- Close display and end display transations.
- begin
- Start a new frame.
- write
- Write a new line of RGB and alpha data to the
framebuffer. Lines always come from top to bottom and
there are always enough to fill the width and height of
the requested display.
- pause
- Display the buffer to the user and wait for their signal
to continue before returning.
The sequence of calls for rendering to the frame buffer can be
visualized as a regular expression:
open, (begin, (write)H, pause?)*, close
Any number of frames may be displayed in a session (even zero). Write
will always be called for all the lines in the image and pause is optional.
|