More common video code

* Provide new function to get current common framebuffer
    * Migrates non-X11 video_setpage routine
This commit is contained in:
Aaron Culliney 2014-03-30 11:01:05 -07:00
parent 52b087f805
commit 209eb86051
3 changed files with 19 additions and 10 deletions

View File

@ -97,8 +97,8 @@ void video_loadfont_int(int first, int qty, const unsigned char *data);
*/
void video_plotchar(int row, int col, int color, unsigned char code);
/* Called at about 30Hz (this may change in future), and when waiting in
* the interface screens.
/*
* Draws video and possibly handles keyboard input.
*
* Should flush any video data to the real screen (if any kind of caching
* is in use), check for keyboard input (presently reported via
@ -108,6 +108,11 @@ void video_sync(int block);
void video_set_mode(a2_video_mode_t mode);
/*
* Get a reference to current internal framebuffer
*/
const uint8_t * const video_current_framebuffer();
#endif /* !__ASSEMBLER__ */
/**** Private stuff follows *****/

View File

@ -67,14 +67,6 @@ typedef struct {
unsigned long status;
} FullScreenHints;
/* -------------------------------------------------------------------------
video_setpage(p): Switch to screen page p
------------------------------------------------------------------------- */
void video_setpage(int p)
{
video__current_page = p;
}
#ifdef HAVE_X11_SHM
/*
* XShm code influenced from the DOOM source code.

View File

@ -724,3 +724,15 @@ void video_shutdown(void)
#endif
}
/* -------------------------------------------------------------------------
video_setpage(p): Switch to screen page p
------------------------------------------------------------------------- */
void video_setpage(int p)
{
video__current_page = p;
}
const uint8_t * const video_current_framebuffer() {
return !video__current_page ? video__fb1 : video__fb2;
}