X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=input_state.h;fp=input_state.h;h=26015ef569b85d61f95af40e21c17a4a537d7423;hb=196392c483a9cbf7fd7b572d9242aa283031453f;hp=0000000000000000000000000000000000000000;hpb=6ebc7f7bd501d1115bf164ce3e1c22db326798c2;p=nageru diff --git a/input_state.h b/input_state.h new file mode 100644 index 0000000..26015ef --- /dev/null +++ b/input_state.h @@ -0,0 +1,24 @@ +#ifndef _INPUT_STATE_H +#define _INPUT_STATE_H 1 + +#include "defs.h" +#include "ref_counted_frame.h" + +struct BufferedFrame { + RefCountedFrame frame; + unsigned field_number; +}; + +// Encapsulates the state of all inputs at any given instant. +// In particular, this is captured by Theme::get_chain(), +// so that it can hold on to all the frames it needs for rendering. +struct InputState { + // For each card, the last three frames (or fields), with 0 being the + // most recent one. Note that we only need the actual history if we have + // interlaced output (for deinterlacing), so if we detect progressive input, + // we immediately clear out all history and all entries will point to the same + // frame. + BufferedFrame buffered_frames[MAX_CARDS][FRAME_HISTORY_LENGTH]; +}; + +#endif // !defined(_INPUT_STATE_H)