home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
VIDDECL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-28
|
4KB
|
99 lines
/*
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.2
Copyright (c) 1988, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
12/22/88 jmd 12:22 swapped args to vid_SetMap macro
3/28/90 jmd ansi-fied
*/
# 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)
/* -------------------------------------------------------------------------- */
/* VID.C */
extern byte vid_GetMap(byte attr);
extern char vid_GetChar(int row, int col);
extern int vid_PutAttr(int row, int col, byte *attrbuf, int slen);
extern char *vid_GetAttr(int row, int col, int slen);
extern void vid_ScrollWindow(int toprow, int leftcol, int botrow, int rightcol, int lines, byte attr);
extern void vid_ClearWindow(int toprow, int leftcol, int botrow, int rightcol, byte attr);
extern void vid_DrawLine(char *linecp, int row1, int col1, int row2, int col2, byte attr);
extern void vid_DrawBox(char *boxcp, int row1, int col1, int row2, int col2, byte attr);
/* -------------------------------------------------------------------------- */