Home | History | Annotate | Download | only in WinQuake
      1 /*
      2 Copyright (C) 1996-1997 Id Software, Inc.
      3 
      4 This program is free software; you can redistribute it and/or
      5 modify it under the terms of the GNU General Public License
      6 as published by the Free Software Foundation; either version 2
      7 of the License, or (at your option) any later version.
      8 
      9 This program is distributed in the hope that it will be useful,
     10 but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     12 
     13 See the GNU General Public License for more details.
     14 
     15 You should have received a copy of the GNU General Public License
     16 along with this program; if not, write to the Free Software
     17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     18 
     19 */
     20 // vid_dos.h: header file for DOS-specific video stuff
     21 
     22 typedef struct vmode_s {
     23 	struct vmode_s	*pnext;
     24 	char		*name;
     25 	char		*header;
     26 	unsigned	width;
     27 	unsigned	height;
     28 	float		aspect;
     29 	unsigned	rowbytes;
     30 	int			planar;
     31 	int			numpages;
     32 	void		*pextradata;
     33 	int			(*setmode)(viddef_t *vid, struct vmode_s *pcurrentmode);
     34 	void		(*swapbuffers)(viddef_t *vid, struct vmode_s *pcurrentmode,
     35 							   vrect_t *rects);
     36 	void		(*setpalette)(viddef_t *vid, struct vmode_s *pcurrentmode,
     37 							  unsigned char *palette);
     38 	void		(*begindirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode,
     39 								   int x, int y, byte *pbitmap, int width,
     40 								   int height);
     41 	void		(*enddirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode,
     42 								 int x, int y, int width, int height);
     43 } vmode_t;
     44 
     45 // vid_wait settings
     46 #define VID_WAIT_NONE			0
     47 #define VID_WAIT_VSYNC			1
     48 #define VID_WAIT_DISPLAY_ENABLE	2
     49 
     50 extern int		numvidmodes;
     51 extern vmode_t	*pvidmodes;
     52 
     53 extern int		VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes;
     54 extern byte		*VGA_pagebase;
     55 extern vmode_t	*VGA_pcurmode;
     56 
     57 extern cvar_t	vid_wait;
     58 extern cvar_t	vid_nopageflip;
     59 extern cvar_t	_vid_wait_override;
     60 
     61 extern unsigned char colormap256[32][256];
     62 
     63 extern void	*vid_surfcache;
     64 extern int	vid_surfcachesize;
     65 
     66 void VGA_Init (void);
     67 void VID_InitVESA (void);
     68 void VID_InitExtra (void);
     69 void VGA_WaitVsync (void);
     70 void VGA_ClearVideoMem (int planar);
     71 void VGA_SetPalette(viddef_t *vid, vmode_t *pcurrentmode, unsigned char *pal);
     72 void VGA_SwapBuffersCopy (viddef_t *vid, vmode_t *pcurrentmode,
     73 	vrect_t *rects);
     74 qboolean VGA_FreeAndAllocVidbuffer (viddef_t *vid, int allocnewbuffer);
     75 qboolean VGA_CheckAdequateMem (int width, int height, int rowbytes,
     76 	int allocnewbuffer);
     77 void VGA_BeginDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x,
     78 	int y, byte *pbitmap, int width, int height);
     79 void VGA_EndDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x,
     80 	int y, int width, int height);
     81 void VGA_UpdateLinearScreen (void *srcptr, void *destptr, int width,
     82 	int height, int srcrowbytes, int destrowbytes);
     83 
     84