1 /* 2 * Schism Tracker - a cross-platform Impulse Tracker clone 3 * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com> 4 * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org> 5 * copyright (c) 2009 Storlek & Mrs. Brisby 6 * copyright (c) 2010-2012 Storlek 7 * URL: http://schismtracker.org/ 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 2 of the License, or 12 * (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 */ 23 #ifndef __video_h 24 #define __video_h 25 26 /* the vgamem implementation lives in draw-char.c 27 it needs access to the fonts, and it shrank recently :) 28 */ 29 void vgamem_clear(void); 30 31 struct vgamem_overlay { 32 unsigned int x1, y1, x2, y2; /* in character cells... */ 33 34 unsigned char *q; /* points inside ovl */ 35 unsigned int skip; 36 37 int width, height; /* in pixels; signed to avoid bugs elsewhere */ 38 }; 39 40 void vgamem_lock(void); 41 void vgamem_unlock(void); 42 void vgamem_flip(void); 43 44 void vgamem_ovl_alloc(struct vgamem_overlay *n); 45 void vgamem_ovl_apply(struct vgamem_overlay *n); 46 47 void vgamem_ovl_clear(struct vgamem_overlay *n, int color); 48 void vgamem_ovl_drawpixel(struct vgamem_overlay *n, int x, int y, int color); 49 void vgamem_ovl_drawline(struct vgamem_overlay *n, int xs, int ys, int xe, int ye, int color); 50 51 52 void vgamem_scan32(unsigned int y,unsigned int *out,unsigned int tc[16], unsigned int mouse_line[80]); 53 void vgamem_scan16(unsigned int y,unsigned short *out,unsigned int tc[16], unsigned int mouse_line[80]); 54 void vgamem_scan8(unsigned int y,unsigned char *out,unsigned int tc[16], unsigned int mouse_line[80]); 55 56 /* video output routines */ 57 const char *video_driver_name(void); 58 59 void video_setup(const char *driver); 60 void video_startup(void); 61 void video_shutdown(void); 62 void video_report(void); 63 void video_refresh(void); 64 void video_colors(unsigned char palette[16][3]); 65 void video_resize(unsigned int width, unsigned int height); 66 void video_fullscreen(int tri); 67 void video_translate(unsigned int vx, unsigned int vy, 68 unsigned int *x, unsigned int *y); 69 void video_blit(void); 70 void video_mousecursor(int z); 71 int video_mousecursor_visible(void); 72 int video_gl_bilinear(void); 73 74 int video_is_fullscreen(void); 75 int video_width(void); 76 int video_height(void); 77 78 SDL_Surface *xpmdata(const char *xpmdata[]); 79 80 #if USE_X11 81 unsigned int xv_yuvlayout(void); 82 #endif 83 84 #define VIDEO_YUV_UYVY 0x59565955 85 #define VIDEO_YUV_YUY2 0x32595559 86 #define VIDEO_YUV_YV12 0x32315659 87 #define VIDEO_YUV_IYUV 0x56555949 88 #define VIDEO_YUV_YVYU 0x55595659 89 #define VIDEO_YUV_YV12_TV (VIDEO_YUV_YV12 ^ 0xFFFFFFFF) 90 #define VIDEO_YUV_IYUV_TV (VIDEO_YUV_IYUV ^ 0xFFFFFFFF) 91 #define VIDEO_YUV_RGBA 0x41424752 92 #define VIDEO_YUV_RGBT 0x54424752 93 #define VIDEO_YUV_RGB565 0x32424752 94 #define VIDEO_YUV_RGB24 0x0 95 #define VIDEO_YUV_RGB32 0x3 96 #define VIDEO_YUV_NONE 0xFFFFFFFF 97 98 #endif 99