2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
8 * $Source: r:/t2repos/thief2/src/render/scrnman.h,v $
11 * $Date: 2000/01/31 09:53:18 $
23 // The big purpose of this module is to hide whether you
24 // are page flipping or offscreen buffered, and to hide
25 // much 8 vs 16 bit stuff like blackening screens
29 SCR_320x200x8
= GRM_320x200x8
,
30 SCR_320x400x8
= GRM_320x400x8
,
31 SCR_512x384x8
= GRM_512x384x8
,
32 SCR_640x400x8
= GRM_640x400x8
,
33 SCR_640x400x16
= GRM_640x400x16
,
34 SCR_640x480x8
= GRM_640x480x8
,
35 SCR_800x600x8
= GRM_800x600x8
,
36 SCR_1024x768x8
= GRM_1024x768x8
,
37 SCR_1280x1024x8
= GRM_1280x1024x8
,
40 SCR_320x200
= SCR_320x200x8
,
41 SCR_320x400
= SCR_320x400x8
,
42 SCR_512x384
= SCR_512x384x8
,
43 SCR_640x400
= SCR_640x400x8
,
44 SCR_640x480
= SCR_640x480x8
,
45 SCR_800x600
= SCR_800x600x8
,
46 SCR_1024x768
= SCR_1024x768x8
,
47 SCR_1280x1024
= SCR_1280x1024x8
,
52 #define ScrnModeToGrMode(x) (x)
54 // find a screen mode given parameters, returns SCR_NOMODE if none found
55 EXTERN ScrnMode
ScrnFindModeFlags(short w
, short h
, ubyte bitdepth
, ulong flags
);
56 #define ScrnFindMode(w,h,d) ScrnFindModeFlags(w,h,d,0)
60 kScrnPreservePal
= (1 << 9), // preserve the palette
63 // set a new display mode.
64 EXTERN
int ScrnSetDisplay(int kind
, int flags
, GUID
*pDDrawGuid
);
66 // set a new screen mode. Flags are gr_set_mode flags plus eScrnFlags
68 // returns TRUE for success
69 EXTERN BOOL
ScrnSetRes(ScrnMode mode
,ulong flags
);
71 EXTERN
void ScrnUnsetRes(void);
73 // returns SCR_NOMODE if not yet set
74 EXTERN ScrnMode
ScrnGetRes(void);
76 // Startup/Term 3d accel, happens within a mode change
77 EXTERN BOOL
ScrnInit3d(void); // return TRUE for success.
78 EXTERN
void ScrnTerm3d(void);
82 // background drawer callback function, takes data,
83 // takes effect next start frame. Should call it outside
84 // of a frame. Only one can be installed at a time
85 // no chaining. Maybe later if you ever need it
87 typedef void (*ScrnCallBack
)(int data
);
89 EXTERN
void ScrnInstallBackground(ScrnCallBack cb
,int data
);
91 // clear the screen to black and blacken the palette
92 // note that this works great, 8 or 16 bit as a prelude
93 // to loading a new screen
94 EXTERN
void ScrnBlacken(void);
96 // don't change the palette, just clear
97 EXTERN
void ScrnClear(void);
99 // call the background callback if present
100 EXTERN
void ScrnStartFrame(void);
102 // blit or page flip, transparently, woo woo.
103 EXTERN
void ScrnEndFrame(void);
105 // force a blit or page flip right now dammit
106 EXTERN
void ScrnForceUpdate(void);
107 EXTERN
void ScrnForceUpdateRect(Rect
*r
);
109 // set the current canvas to be the visible screen
110 // the idea is you're not page flipping or blitting
111 // in fact, if you do an end_frame in this mode, you get
113 EXTERN
void ScrnSetVisible(void);
115 // set the current canvas to be the offscreen canvas(default)
116 EXTERN
void ScrnSetOffscreen(void);
118 // get a pointer to the draw (i.e., "offscreen") canvas
119 EXTERN grs_canvas
*ScrnGetDrawCanvas(void);
121 // load and use this palette
122 EXTERN
void ScrnNewPalette(uchar
*,int start
,int size
);
124 // make the current palette black and use it
125 EXTERN
void ScrnNewBlackPalette(void);
127 // load but do not set this palette
128 EXTERN
void ScrnLoadPalette(uchar
*pal
,int start
,int size
);
130 // set the currently loaded palette
131 EXTERN
void ScrnUsePalette(void);
133 // return pointer to loaded palette. Beware, don't mess with it.
134 EXTERN
const uchar
*ScrnGetPalette(void);
136 // return a pointer to the loaded inverse palette.
137 EXTERN
const uchar
*ScrnGetInvPalette(void);
140 EXTERN
int ScrnInvPaletteSize(void);
142 // Lock the draw canvas
143 EXTERN
void ScrnLockDrawCanvas(void);
145 // Unlock the draw canvas
146 EXTERN
void ScrnUnlockDrawCanvas(void);
148 #endif // __SCRNMAN_H