home *** CD-ROM | disk | FTP | other *** search
- /*
- viddecl.h
-
- % Video Functions
-
- Everything that needs to be included on top of "disp.h" to use vid_ calls.
- For compatibility with C-Scape 2.x
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 12/22/88 jmd 12:22 swapped args to vid_SetMap macro
- */
-
- # include "cmwinobj.h"
-
- /* Global window used by vid_ functions */
- OEXTERN win_type vid_win;
-
- #define vid_GetWin(win) (vid_win)
-
- #define vid_SetWin(win) \
- (win_GetID(win) == ID_CMWIN) ? (win_MakeCurrent(win), vid_win = win) : \
- NULL)
-
- /* -------------------------------------------------------------------------- */
- #define vid_SetDriver(driver) disp_SetCurrent(driver)
- #define vid_GetDriver() disp_GetCurrent()
- #define vid_Close() disp_Close()
-
- #define vid_GetMode() disp_GetMode()
-
- #define vid_Cache() disp_Cache()
- #define vid_Flush() disp_Flush()
-
- #define vid_SetMap(attr, colors) \
- disp_SetAttrColors(attr, (opixval)(colors >> 4), (opixval)(colors & 0x0F))
- /*
- The functions vid_GetWidth() and vid_GetHeight are inconsistent with the
- other vid_ functions here in that they do not refer to vid_win. This is
- so that old code which does not use a vid_win can still find out the
- display size. If your code needs to know the dimensions of the vid_win,
- change it to use vid_GetWinWidth() and vid_GetWinHeight.
- Likewise, the function cls() clears the whole display whether or not any
- background window or vid_win is present. To clear the vid_win, call
- win_Clear(vid_win, win_bgcolor(vid_win)).
- */
-
- #define vid_GetWidth() disp_GetWidth()
- #define vid_GetHeight() disp_GetHeight()
-
- #define vid_GetWinWidth() win_GetWidth(vid_win)
- #define vid_GetWinHeight() win_GetHeight(vid_win)
-
- /* -------------------------------------------------------------------------- */
- #define vid_GetCursorType() win_GetCursorType(vid_win)
- #define vid_SetCursorType(type) win_SetCursorType(vid_win, type)
- #define vid_GetCursorPos(rowp, colp) win_GetCursorPos(vid_win, rowp, colp)
- #define vid_SetCursorPos(row, col) win_SetCursorPos(vid_win, row, col)
-
- /* -------------------------------------------------------------------------- */
- #define vidwin_Class cmwin_Class
-
- #define vid_PutStringAttr(row, col, string, attrbuf, slen) \
- cmwin_DrawStringAttr(vid_win, row, col, string, attrbuf, slen)
-
- #define vid_PutString(row, col, string, attr, slen) \
- cmwin_DrawString(vid_win, row, col, string, attr, slen)
-
- #define vid_PutChar(row, col, c, attr) \
- cmwin_DrawChar(vid_win, row, col, c, attr)
-
- #define vid_Clear(attr) cmwin_Clear(vid_win, attr)
-
- /* These macros do nothing */
- #define vid_Push()
- #define vid_Pop()
- #define vid_PushWindow(y1, x1, y2, x2)
- #define vid_PopWindow(y1, x1, y2, x2)
- /* -------------------------------------------------------------------------- */
-
- extern byte vid_GetMap(_arg1(byte attr));
- extern char vid_GetChar(_arg2(int row, int col));
- extern void vid_ScrollWindow(_arg6(int row1, int col1, int row2, int col2, int lines, byte attr));
- extern void vid_ClearWindow(_arg5(int row1, int col1, int row2, int col2, byte attr));
- extern void vid_DrawLine(_arg6(char *linecp, int row1, int col1, int row2, int col2, byte attr));
- extern int vid_PutAttr(_arg4(int row, int col, byte *attrbuf, int slen));
- extern char *vid_GetAttr(_arg3(int row, int col, int slen));
- extern void vid_DrawBox(_arg6(char *boxcp, int row1, int col1, int row2, int col2, byte attr));
- /* -------------------------------------------------------------------------- */
-
-