1 /* $Id: setup.c,v 1.5 2003-03-19 19:21:34 btb Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
16 * Setup for 3d library
20 * Revision 1.4 1995/10/11 00:27:04 allender
21 * bash free_num_points to 0
23 * Revision 1.3 1995/09/13 11:31:58 allender
24 * calc for fCanv_w2 and fCanv_h2
26 * Revision 1.2 1995/06/25 21:57:57 allender
27 * *** empty log message ***
29 * Revision 1.1 1995/05/05 08:52:54 allender
32 * Revision 1.1 1995/04/17 03:59:01 matt
43 static char rcsid[] = "$Id: setup.c,v 1.5 2003-03-19 19:21:34 btb Exp $";
58 #include "texmap.h" // for init_interface_vars_to_assembler()
61 //initialize the 3d system
64 // div0_init(DM_ERROR);
68 //close down the 3d system
69 void g3_close(void) {}
72 void g3_start_frame(void)
76 //set int w,h & fixed-point w,h/2
77 Canv_w2 = (Canvas_width = grd_curcanv->cv_bitmap.bm_w)<<15;
78 Canv_h2 = (Canvas_height = grd_curcanv->cv_bitmap.bm_h)<<15;
80 fCanv_w2 = f2fl((Canvas_width = grd_curcanv->cv_bitmap.bm_w)<<15);
81 fCanv_h2 = f2fl((Canvas_height = grd_curcanv->cv_bitmap.bm_h)<<15);
84 //compute aspect ratio for this canvas
86 s = fixmuldiv(grd_curscreen->sc_aspect,Canvas_height,Canvas_width);
88 if (s <= f1_0) { //scale x
90 Window_scale.y = f1_0;
93 Window_scale.y = fixdiv(f1_0,s);
94 Window_scale.x = f1_0;
97 Window_scale.z = f1_0; //always 1
102 Win32_start_frame ();
107 init_interface_vars_to_assembler(); //for the texture-mapper
113 //this doesn't do anything, but is here for completeness
114 void g3_end_frame(void)
123 // Assert(free_point_num==0);