vid_dos.h 2.8 KB

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