joeylib2/include/joey/present.h

28 lines
1 KiB
C

// Stage present.
//
// stagePresent flips the library-owned stage (back-buffer) to the
// display. On chunky platforms (IIgs, DOS) this is a direct copy; on
// planar platforms (Amiga, Atari ST) this is a chunky-to-planar
// conversion. Drawing primitives mark per-row dirty ranges on the
// stage as a side effect, so stagePresent only touches rows that
// actually changed since the last present. See docs/DESIGN.md.
#ifndef JOEYLIB_PRESENT_H
#define JOEYLIB_PRESENT_H
#include "platform.h"
#include "surface.h"
#include "types.h"
// Flip the dirty regions of the stage to the display, then clear the
// dirty state. Cheap when nothing has changed since the last call
// (gStageAnyDirty short-circuit). Drawing primitives mark dirty as
// a side effect, so callers only need to call stagePresent at the
// end of a frame -- everything they drew shows up.
//
// To present a region you didn't draw with the standard primitives
// (e.g. direct framebuffer poking), call surfaceMarkDirtyRect on
// the same rect first, then stagePresent.
void stagePresent(void);
#endif