2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
15 #pragma off (unreferenced)
16 static char rcsid[] = "$Id: gfx.c,v 1.1.1.1 2001-01-19 03:30:15 bradleyb Exp $";
17 #pragma on (unreferenced)
24 #define WIN32_LEAN_AND_MEAN
46 // ----------------------------------------------------------------------------
48 static BOOL gfx_initialized=0;// GFX flag
49 static BOOL d3d_enhanced=0; // 3D enhanced?
50 static FILE *LogFile=NULL; // Log File!
53 // Function prototypes
54 // ----------------------------------------------------------------------------
61 #define WRITELOG(t) if (LogFile) { fprintf t; fflush(LogFile); }
62 #define LOGINIT(n) LogFile = fopen(n, "wt");
63 #define LOGCLOSE if (LogFile) fclose(LogFile);
70 The GFX system is a higher level abstraction that is independent of the
71 DD-DDGR interface. gfx uses the DD-DDGR interface, but not the other way
72 around. You may use GFX calls and DD-DDGR calls interchangably with older
73 functions. Any newer graphic functionality for Descent 2 will use
79 // ----------------------------------------------------------------------------
83 When called at game initialization, this will initialize the DirectDraw
84 system. Then we initialize other graphic components if called for.
88 BOOL gfxInit(int hw_acc)
90 // Initialize Direct Draw and DDGR system.
92 if (gfx_initialized) return TRUE;
94 if (!DDInit(DDGR_FULLSCREEN))
97 grd_curscreen = (grs_screen *)malloc(sizeof(grs_screen));
98 W95DisplayMode = SM95_640x480x8;
104 // Initialize 3D system if available.
108 Error("Unable to initialize 3D Hardware.");
111 else d3d_enhanced = 0;
121 if (!gfx_initialized) return;