+/* called by swap_buffers just before the actual swap */
+void demo_post_draw(void *pixels)
+{
+ char buf[32];
+ if(opt.dbginfo) {
+ drawFps(pixels);
+ if(dbg_curscr_name) {
+ cs_dputs(pixels, dbg_curscr_name_pos, 240 - 16, dbg_curscr_name);
+ }
+ }
+
+ if(con_active) {
+ con_draw(pixels);
+ }
+
+ if(opt.mouse && time_msec - last_mouse_move < MOUSE_TIMEOUT) {
+ cs_mouseptr(pixels, mouse_x, mouse_y);
+ }
+}
+
+void cs_puts_font(cs_font_func csfont, int sz, void *fb, int x, int y, const char *str)
+{
+ while(*str) {
+ int c = *str++;
+
+ if(c > ' ' && c < 128) {
+ csfont(fb, x, y, c - ' ');
+ }
+ x += sz;
+ }
+}
+
+void change_screen(int idx)