1 /* VERY QUICK AND ULTRA-DIRTY DEMO USING XLIB */
\r
3 /* Simple Demo of MODE X Split screen and panning */
\r
4 /* Compile using Turbo C and Tasm */
\r
12 #include "xlib_all.h"
\r
14 #define MAX_OBJECTS 10
\r
16 static char *texttest[6] =
\r
17 {"This is a demonstration of the fonts ",
\r
18 "available in XLIB. Notice fixed and ",
\r
19 "variabe spaced fonts are supported but",
\r
20 "are limited to a maximum of 8 pixels in",
\r
21 "width. Height of the characters is ",
\r
22 "ofcourse unlimited..."};
\r
25 int X,Y,Width,Height,XDir,YDir,XOtherPage,YOtherPage;
\r
28 char far * bgOtherPage;
\r
31 AnimatedObject objects[MAX_OBJECTS];
\r
34 static char bm[] = {4,12,
\r
36 2,2,2,2,2,1,1,1,2,1,1,1,2,3,3,1,
\r
37 2,0,0,3,2,0,0,3,2,0,0,3,2,0,0,3,
\r
38 2,3,3,1,2,1,1,1,2,1,1,1,2,2,2,2,
\r
40 2,2,2,2,1,1,1,1,1,1,1,1,1,3,3,1,
\r
41 1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,
\r
42 1,3,3,1,1,1,1,1,1,1,1,1,2,2,2,2,
\r
44 2,2,2,2,1,1,1,1,1,1,1,1,1,3,3,1,
\r
45 1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,
\r
46 1,3,3,1,1,1,1,1,1,1,1,1,2,2,2,2,
\r
48 2,2,2,2,1,1,1,2,1,1,1,2,1,3,3,2,
\r
49 3,0,0,2,3,0,0,2,3,0,0,2,3,0,0,2,
\r
50 1,3,3,2,1,1,1,2,1,1,1,2,2,2,2,2};
\r
52 static char bm2[] = {4,12,
\r
54 2,2,2,2,2,4,4,4,2,4,4,4,2,2,2,4,
\r
55 2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,
\r
56 2,2,2,4,2,4,4,4,2,4,4,4,2,2,2,2,
\r
58 2,2,2,2,4,4,4,4,4,4,4,4,4,2,2,4,
\r
59 4,0,0,4,4,0,0,4,4,0,0,4,4,0,0,4,
\r
60 4,2,2,4,4,4,4,4,4,4,4,4,2,2,2,2,
\r
62 2,2,2,2,4,4,4,4,4,4,4,4,4,2,2,4,
\r
63 4,0,0,4,4,0,0,4,4,0,0,4,4,0,0,4,
\r
64 4,2,2,4,4,4,4,4,4,4,4,4,2,2,2,2,
\r
66 2,2,2,2,4,4,4,2,4,4,4,2,4,2,2,2,
\r
67 2,0,0,2,2,0,0,2,2,0,0,2,2,0,0,2,
\r
68 4,2,2,2,4,4,4,2,4,4,4,2,2,2,2,2};
\r
70 int textwindow_x=0,textwindow_y=0;
\r
71 char far * pal,far * pal2;
\r
72 char palscrolldir=1;
\r
73 char far * userfnt1;
\r
77 void drawtext(int height){
\r
80 x_printf(textwindow_x+5,50+i*(height+2),VisiblePageOffs,9,texttest[i]);
\r
83 /* initialize a new object */
\r
84 void init_object(int x,int y,int width, int height, int xdir, int ydir,
\r
87 objects[object_count].X = objects[object_count].XOtherPage = x;
\r
88 objects[object_count].Y = objects[object_count].YOtherPage = y;
\r
89 objects[object_count].Width = width;
\r
90 objects[object_count].Height = height;
\r
91 objects[object_count].XDir = xdir;
\r
92 objects[object_count].YDir = ydir;
\r
93 objects[object_count].Image = image;
\r
94 objects[object_count].bg = (char far *) farmalloc(4*width*height+20);
\r
95 objects[object_count].bgOtherPage = (char far *) farmalloc(4*width*height+20);
\r
96 x_get_pbm(x,y,(unsigned)width,height,VisiblePageOffs,
\r
97 objects[object_count].bg);
\r
98 x_get_pbm(x,y,(unsigned)width,height,HiddenPageOffs,
\r
99 objects[object_count].bgOtherPage);
\r
103 /* Move the specified object, bouncing at the edges of the screen and
\r
104 remembering where the object was before the move for erasing next time */
\r
105 void MoveObject(AnimatedObject * ObjectToMove) {
\r
108 X = ObjectToMove->X + ObjectToMove->XDir;
\r
109 Y = ObjectToMove->Y + ObjectToMove->YDir;
\r
110 if ((X < 0) || (X > (ScrnLogicalPixelWidth-((ObjectToMove->Width)<<2)))) {
\r
111 ObjectToMove->XDir = -ObjectToMove->XDir;
\r
112 X = ObjectToMove->X + ObjectToMove->XDir;
\r
114 if ((Y < 0) || (Y > (ScrnLogicalHeight-ObjectToMove->Height))) {
\r
115 ObjectToMove->YDir = -ObjectToMove->YDir;
\r
116 Y = ObjectToMove->Y + ObjectToMove->YDir;
\r
118 /* Remember previous location for erasing purposes */
\r
119 ObjectToMove->XOtherPage = ObjectToMove->X;
\r
120 ObjectToMove->YOtherPage = ObjectToMove->Y;
\r
121 ObjectToMove->X = X; /* set new location */
\r
122 ObjectToMove->Y = Y;
\r
123 cptr = ObjectToMove->bg;
\r
124 ObjectToMove->bg = ObjectToMove->bgOtherPage;
\r
125 ObjectToMove->bgOtherPage = cptr;
\r
128 void animate(void){
\r
130 for(i=object_count-1;i>=0;i--){
\r
131 x_put_pbm(objects[i].XOtherPage,objects[i].YOtherPage,
\r
132 HiddenPageOffs,objects[i].bgOtherPage);
\r
134 for(i=0;i<object_count;i++){
\r
135 MoveObject(&objects[i]);
\r
137 x_get_pbm(objects[i].X,objects[i].Y,
\r
138 (unsigned)objects[i].Width,objects[i].Height,HiddenPageOffs,
\r
140 x_put_masked_pbm(objects[i].X,objects[i].Y,HiddenPageOffs,
\r
145 void clear_objects(void){
\r
147 for(i=object_count-1;i>=0;i--){
\r
148 x_put_pbm(objects[i].XOtherPage,objects[i].YOtherPage,
\r
149 HiddenPageOffs,objects[i].bgOtherPage);
\r
154 void textwindow(int Margin){
\r
157 int x1=ScrnPhysicalPixelWidth-Margin;
\r
158 int y1=ScrnPhysicalHeight-Margin;
\r
159 x_rect_fill(x0, y0, x1,y1,VisiblePageOffs,1);
\r
160 x_line(x0,y0,x1,y0,2,VisiblePageOffs);
\r
161 x_line(x0,y1,x1,y1,2,VisiblePageOffs);
\r
162 x_line(x0,y0,x0,y1,2,VisiblePageOffs);
\r
163 x_line(x1,y0,x1,y1,2,VisiblePageOffs);
\r
164 x_line(x0+2,y0+2,x1-2,y0+2,2,VisiblePageOffs);
\r
165 x_line(x0+2,y1-2,x1-2,y1-2,2,VisiblePageOffs);
\r
166 x_line(x0+2,y0+2,x0+2,y1-2,2,VisiblePageOffs);
\r
167 x_line(x1-2,y0+2,x1-2,y1-2,2,VisiblePageOffs);
\r
174 void wait_for_keypress(void){
\r
176 while(kbhit()) getch();
\r
180 x_rot_pal_struc(pal,palscrolldir);
\r
182 x_put_pal_struc(pal);
\r
184 } while (!kbhit() && !(MouseButtonStatus==LEFT_PRESSED));
\r
185 while(MouseButtonStatus==LEFT_PRESSED);
\r
186 while(kbhit()) getch();
\r
191 void exitfunc(void){
\r
193 x_remove_vsync_handler();
\r
195 printf("Thanks to everyone who assisted in the development of XLIB.\n");
\r
196 printf("\nSpecial thanks to Matthew Mackenzie for contributing \n");
\r
197 printf("lots of code, documentation and ideas.\n\n");
\r
198 printf("If you make any money using this code and you're the generous\n");
\r
199 printf("type please send us some, or at least a copy of your program!\n");
\r
202 int terminate(void){
\r
206 void intro_1(void){
\r
207 x_set_rgb(1,40,40,40); /* BG Gray */
\r
208 x_set_rgb(2,63,63,0); /* Bright Yellow */
\r
209 x_set_rgb(3,63,0,0); /* Bright Red */
\r
210 x_set_rgb(4,0,63,0); /* Bright Green */
\r
211 x_set_rgb(5,0,0,63); /* Bright Blue */
\r
212 x_set_rgb(6,0,0,28); /* Dark Blue */
\r
213 x_set_rgb(7,0,28,0); /* Dark Green */
\r
214 x_set_rgb(8,28,0,0); /* Dark red */
\r
215 x_set_rgb(9,0,0,38); /* Med Blue */
\r
219 x_printf(textwindow_x+54,textwindow_y+4,VisiblePageOffs,6," XLIB Version 6.0");
\r
220 x_printf(textwindow_x+53,textwindow_y+3,VisiblePageOffs,2," XLIB Version 6.0");
\r
222 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," Not the Unix version");
\r
223 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,2," Not the Unix version");
\r
225 x_printf(textwindow_x+24,168,VisiblePageOffs,6," Press any key to continue");
\r
226 x_printf(textwindow_x+23,167,VisiblePageOffs,2," Press any key to continue");
\r
229 void subsequent_page(void){
\r
233 x_printf(textwindow_x+54,textwindow_y+4,VisiblePageOffs,6," XLIB Version 6.0");
\r
234 x_printf(textwindow_x+53,textwindow_y+3,VisiblePageOffs,2," XLIB Version 6.0");
\r
236 x_printf(textwindow_x+24,168,VisiblePageOffs,6," Press any key to continue");
\r
237 x_printf(textwindow_x+23,167,VisiblePageOffs,2," Press any key to continue");
\r
240 void load_user_fonts(void){
\r
242 f=fopen("var6x8.fnt","rb");
\r
243 /* read char by char as fread wont read to far pointers in small model */
\r
245 for (i=0;i<256*8+4;i++){
\r
253 x_register_userfont(userfnt1);
\r
260 int i, j, xinc, yinc, Margin;
\r
262 WORD curr_x=0, curr_y=0;
\r
264 pal = (char far *) farmalloc(256*3);
\r
265 pal2 = (char far *) farmalloc(256*3);
\r
266 userfnt1 = (char far *) farmalloc(256*16+4);
\r
269 /* INITIALIZE XLIB */
\r
271 /* we set up Mode X 360x200x256 with a logical width of ~ 500 */
\r
272 /* pixels; we actually get 496 due to the fact that the width */
\r
273 /* must be divisible by 8 */
\r
275 x_text_mode(); /* make sure VGA is in color mode, if possible */
\r
276 x_set_mode(X_MODE_360x200,500); /* actually is set to 496 */
\r
277 x_install_vsync_handler(2);
\r
278 x_set_splitscreen(ScrnPhysicalHeight-60); /* split screen 60 pixels high */
\r
279 x_set_doublebuffer(220);
\r
281 x_hide_splitscreen();
\r
286 /* DRAW BACKGROUND LINES */
\r
288 for(j=0;j<ScrnPhysicalHeight;j++){
\r
289 x_line(0,j,ScrnLogicalPixelWidth,j,16+(j%239),VisiblePageOffs);
\r
292 ctrlbrk(terminate);
\r
293 x_get_pal_struc(pal, 240,16);
\r
299 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " Hi, folks. This is yet another FREEWARE Mode X");
\r
300 x_printf(textwindow_x+5,50+8 ,VisiblePageOffs,9, " graphics library. It is by no means complete,");
\r
301 x_printf(textwindow_x+5,50+16,VisiblePageOffs,9, " but I believe it contains a rich enough set of");
\r
302 x_printf(textwindow_x+5,50+24,VisiblePageOffs,9, " functions to achieve its design goal - to be");
\r
303 x_printf(textwindow_x+5,50+32,VisiblePageOffs,9, " a game development oriented library for");
\r
304 x_printf(textwindow_x+5,50+40,VisiblePageOffs,9, " Borland TC/BC/BC++ and TASM programmers.");
\r
306 x_printf(textwindow_x+5,50+48,VisiblePageOffs,9, " This library comes with TASM and C sources.");
\r
307 x_printf(textwindow_x+5,50+56,VisiblePageOffs,9, " It was inspired by the DDJ Graphics column and");
\r
308 x_printf(textwindow_x+5,50+64,VisiblePageOffs,9, " many INTERNET and USENET authors who, unlike the");
\r
309 x_printf(textwindow_x+5,50+72,VisiblePageOffs,9, " majority of programmers (you know who you are!),");
\r
310 x_printf(textwindow_x+5,50+80,VisiblePageOffs,9, " willingly share their code and ideas with others.");
\r
312 x_printf(textwindow_x+5,50+88,VisiblePageOffs,9, " I can't afford, nor do I want, to copyright");
\r
313 x_printf(textwindow_x+5,50+96,VisiblePageOffs,9, " this code - but if you use it, some credit would ");
\r
314 x_printf(textwindow_x+5,50+104,VisiblePageOffs,9," be appreciated. ");
\r
316 wait_for_keypress();
\r
320 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6,"Supported 256 colour resolutions.");
\r
321 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3,"Supported 256 colour resolutions.");
\r
323 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " 320x200 Standard for games ~ 4 pages");
\r
324 x_printf(textwindow_x+5,50+8 ,VisiblePageOffs,9, " 320x240 DDJ Mode X square pixels ~ 3.5 pages");
\r
325 x_printf(textwindow_x+5,50+16,VisiblePageOffs,9, " 360x200 My favourite for games ~ 3 pages ");
\r
326 x_printf(textwindow_x+5,50+24,VisiblePageOffs,9, " 360x240 ~ 2.8 pages");
\r
327 x_printf(textwindow_x+5,50+32,VisiblePageOffs,9, " 320x400 ~ 2 pages ");
\r
328 x_printf(textwindow_x+5,50+40,VisiblePageOffs,9, " 320x480 All subsequent modes support");
\r
329 x_printf(textwindow_x+5,50+48,VisiblePageOffs,9, " 360x400 less than two pages.");
\r
330 x_printf(textwindow_x+5,50+56,VisiblePageOffs,9, " 360x480");
\r
331 x_printf(textwindow_x+5,50+64,VisiblePageOffs,9, " 376x282,360x360,376x308,376x564,256x200,256x240");
\r
332 x_printf(textwindow_x+5,50+72,VisiblePageOffs,9, " Phew! and they'll run on all VGA cards and ");
\r
333 x_printf(textwindow_x+5,50+80,VisiblePageOffs,9, " monitors (some of the weird ones are best suited");
\r
334 x_printf(textwindow_x+5,50+88,VisiblePageOffs,9, " to monitors with both vert & horiz adjustments)");
\r
335 x_printf(textwindow_x+5,50+98,VisiblePageOffs,2, " ");
\r
336 x_printf(textwindow_x+5,50+106,VisiblePageOffs,2," Overkill? Maybe!! ");
\r
339 wait_for_keypress();
\r
342 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," Text display functions.");
\r
343 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," Text display functions.");
\r
345 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " Several text printing functions are provided.");
\r
346 x_printf(textwindow_x+5,50+8 ,VisiblePageOffs,9, " They support the VGA ROM 8x14 and 8x8 fonts as");
\r
347 x_printf(textwindow_x+5,50+16,VisiblePageOffs,9, " well as user-defined fonts (like this 6x8 font).");
\r
348 x_printf(textwindow_x+5,50+24,VisiblePageOffs,9, " Furthermore, a function similar to printf is");
\r
349 x_printf(textwindow_x+5,50+32,VisiblePageOffs,9, " included which provides formatted text output.");
\r
350 x_printf(textwindow_x+5,50+40,VisiblePageOffs,9, " User defined fonts may be proportionally spaced");
\r
351 x_printf(textwindow_x+5,50+58,VisiblePageOffs,9, " but have a maximum width of 8 pixels.");
\r
354 wait_for_keypress();
\r
357 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," Advanced screen functions.");
\r
358 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," Advanced screen functions.");
\r
360 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " The library supports virtual screens larger");
\r
361 x_printf(textwindow_x+5,50+8 ,VisiblePageOffs,9, " than the physical screen, panning of such");
\r
362 x_printf(textwindow_x+5,50+16,VisiblePageOffs,9, " screens, and a split screen option.");
\r
363 x_printf(textwindow_x+5,50+24,VisiblePageOffs,9, " These functions can be used together or");
\r
364 x_printf(textwindow_x+5,50+32,VisiblePageOffs,9, " in isolation, and in the lower resolutions");
\r
365 x_printf(textwindow_x+5,50+40,VisiblePageOffs,9, " double buffering can also be accomplished.");
\r
367 x_rect_fill(0, 0, ScrnPhysicalPixelWidth,60,SplitScrnOffs,5);
\r
368 x_line(0,0,ScrnPhysicalPixelWidth,0,2,SplitScrnOffs);
\r
370 x_printf(10,10,SplitScrnOffs,2, " This is a split screen, tops for scores.");
\r
372 for (i=ScrnPhysicalHeight;i>ScrnPhysicalHeight-60;i--){
\r
373 x_adjust_splitscreen(i);
\r
375 x_printf(10,25,SplitScrnOffs,2, " Even better for scrolling games etc.");
\r
377 x_cp_vid_rect(0,0,ScrnLogicalPixelWidth,ScrnLogicalHeight,0,0,
\r
378 VisiblePageOffs,HiddenPageOffs,
\r
379 ScrnLogicalPixelWidth,ScrnLogicalPixelWidth);
\r
383 wait_for_keypress();
\r
388 init_object(60,90,4, 12, -1, 1, MK_FP(FP_SEG(bm2),FP_OFF(bm2)));
\r
389 init_object(30,30,4, 12, 1, 1, MK_FP(FP_SEG(bm),FP_OFF(bm)));
\r
390 init_object(80,120,4, 12, 2, 1, MK_FP(FP_SEG(bm),FP_OFF(bm)));
\r
391 init_object(300,200,4, 12, 1, -2, MK_FP(FP_SEG(bm),FP_OFF(bm)));
\r
392 init_object(360,30,4, 12, -1, -1, MK_FP(FP_SEG(bm),FP_OFF(bm)));
\r
393 init_object(360,10,4, 12, -2, 2, MK_FP(FP_SEG(bm),FP_OFF(bm)));
\r
397 while (!kbhit()&& !(MouseButtonStatus==LEFT_PRESSED)){
\r
399 if (objects[0].X>=curr_x+ScrnPhysicalPixelWidth-32 &&
\r
400 curr_x < MaxScrollX) curr_x++;
\r
401 else if (objects[0].X < curr_x+16 && curr_x > 0) curr_x--;
\r
402 if (objects[0].Y>=curr_y+ScrnPhysicalHeight-92 &&
\r
403 curr_y < MaxScrollY) curr_y++;
\r
404 else if (objects[0].Y < curr_y+16 && curr_y > 0) curr_y--;
\r
405 x_page_flip(curr_x,curr_y);
\r
406 while(StartAddressFlag);
\r
408 while(MouseButtonStatus==LEFT_PRESSED);
\r
409 while(kbhit()) getch();
\r
412 x_page_flip(curr_x,curr_y);
\r
413 while(StartAddressFlag);
\r
416 x_set_start_addr(0,0);
\r
420 x_hide_splitscreen();
\r
422 x_show_splitscreen();
\r
427 for (i=ScrnPhysicalHeight-60;i<=ScrnPhysicalHeight;i++){
\r
428 x_adjust_splitscreen(i);
\r
433 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," Palette functions.");
\r
434 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," Palette functions.");
\r
436 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " A number of palette manipulation functions");
\r
437 x_printf(textwindow_x+5,50+8 ,VisiblePageOffs,9, " are provided. You have already seen some of");
\r
438 x_printf(textwindow_x+5,50+16,VisiblePageOffs,9, " them in action. Another common operation is");
\r
439 x_printf(textwindow_x+5,50+24,VisiblePageOffs,9, " palette fading. ");
\r
443 while (x_cpcontrast_pal_struc(pal, pal2,ch-=2)){
\r
444 x_put_pal_struc(pal2);
\r
445 x_rot_pal_struc(pal,palscrolldir);
\r
449 x_cpcontrast_pal_struc(pal, pal2,ch+=2);
\r
450 x_put_pal_struc(pal2);
\r
451 x_rot_pal_struc(pal,palscrolldir);
\r
453 wait_for_keypress();
\r
456 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," NEW Version 3.0 Functions!");
\r
457 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," NEW Version 3.0 Functions!");
\r
459 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " NEW functions not demonstrated here include:");
\r
460 x_printf(textwindow_x+5,50+10,VisiblePageOffs,9, " - RLE data compression");
\r
461 x_printf(textwindow_x+5,50+20,VisiblePageOffs,9, " - FAST compiled masked bitmaps");
\r
462 x_printf(textwindow_x+5,50+30,VisiblePageOffs,9, " - Hardware detection");
\r
465 wait_for_keypress();
\r
468 for (i = 0; i < 150; i++) {
\r
469 x_circle(0, 0, i, 181 - i, VisiblePageOffs);
\r
470 x_circle(360 - i, 0, i, i + 30, VisiblePageOffs);
\r
471 x_circle(0, 200 - i, i, i + 30, VisiblePageOffs);
\r
472 x_circle(360 - i, 200 - i, i, 181 - i, VisiblePageOffs);
\r
474 for (i = 0; i < 100; i++)
\r
475 x_filled_circle(80 + i, i, 201 - (i << 1), 30+i, VisiblePageOffs);
\r
477 wait_for_keypress();
\r
480 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," NEW Version 4.0 Functions!");
\r
481 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," NEW Version 4.0 Functions!");
\r
483 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " NEW functions not demonstrated here include:");
\r
484 x_printf(textwindow_x+5,50+10,VisiblePageOffs,9, " - FAST VRAM-based masked bitmaps, including");
\r
485 x_printf(textwindow_x+5,50+18,VisiblePageOffs,9, " support for clipping regions");
\r
486 x_printf(textwindow_x+5,50+28,VisiblePageOffs,9, " - Faster, smaller compiled bitmaps");
\r
487 x_printf(textwindow_x+5,50+38,VisiblePageOffs,9, " - Improved planar bitmap performance and");
\r
488 x_printf(textwindow_x+5,50+46,VisiblePageOffs,9, " additional support for clipping");
\r
489 x_printf(textwindow_x+5,50+56,VisiblePageOffs,9, " - mouse module");
\r
490 x_printf(textwindow_x+5,50+66,VisiblePageOffs,9, " - Detection of math co-processor and mouse");
\r
491 x_printf(textwindow_x+5,50+76,VisiblePageOffs,9, " - Bezier curve module");
\r
492 x_printf(textwindow_x+5,50+86,VisiblePageOffs,9, " - Four new resolutions, including one with");
\r
493 x_printf(textwindow_x+5,50+94,VisiblePageOffs,9, " square pixels (376x282)");
\r
494 x_printf(textwindow_x+5,50+104,VisiblePageOffs,9, " - More bug fixes");
\r
496 wait_for_keypress();
\r
499 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," NEW Version 5.0 Functions!");
\r
500 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," NEW Version 5.0 Functions!");
\r
502 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " - *FAST* filled and clipped triangles ideal for");
\r
503 x_printf(textwindow_x+5,50+10,VisiblePageOffs,9, " 3D work. Thanks to S. Dollins for the code.");
\r
504 x_printf(textwindow_x+5,50+20,VisiblePageOffs,9, " - Filled and clipped polygons, C++ Compatible");
\r
505 x_printf(textwindow_x+5,50+30,VisiblePageOffs,9, " - header files, and of course bug fixes!");
\r
508 wait_for_keypress();
\r
511 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," NEW Version 6.0 Functions!");
\r
512 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," NEW Version 6.0 Functions!");
\r
514 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " - Fast flood filling functions ");
\r
515 x_printf(textwindow_x+5,50+10,VisiblePageOffs,9, " - New pbm flipping put functions.");
\r
516 x_printf(textwindow_x+5,50+20,VisiblePageOffs,9, " - Timer synchronized vertical retrace");
\r
517 x_printf(textwindow_x+5,50+30,VisiblePageOffs,9, " - Tripple buffering extensions");
\r
518 x_printf(textwindow_x+5,50+40,VisiblePageOffs,9, " Checkout demo 9 and 10 for previews");
\r
523 wait_for_keypress();
\r
528 while(kbhit()) getch();
\r
531 int x0,x1,x2,y0,y1,y2,i;
\r
533 x0=random(ScrnLogicalPixelWidth);
\r
534 x1=random(ScrnLogicalPixelWidth);
\r
535 x2=random(ScrnLogicalPixelWidth);
\r
536 y0=random(ScrnPhysicalHeight);
\r
537 y1=random(ScrnPhysicalHeight);
\r
538 y2=random(ScrnPhysicalHeight);
\r
539 x_triangle(x0,y0,x1,y1,x2,y2,i,VisiblePageOffs);
\r
540 } while (!kbhit() && !(MouseButtonStatus==LEFT_PRESSED));
\r
541 while(MouseButtonStatus==LEFT_PRESSED);
\r
542 while(kbhit()) getch();
\r
546 x_printf(textwindow_x+24,textwindow_y+18,VisiblePageOffs,6," PLEASE...");
\r
547 x_printf(textwindow_x+23,textwindow_y+17,VisiblePageOffs,3," PLEASE...");
\r
549 x_printf(textwindow_x+5,50 ,VisiblePageOffs,9, " Please mention my name in programs that use XLIB");
\r
550 x_printf(textwindow_x+5,50+8 ,VisiblePageOffs,9, " just to make me feel it was worth the effort.");
\r
551 x_printf(textwindow_x+5,50+16,VisiblePageOffs,9, " If you have any bug to report please feel free to");
\r
552 x_printf(textwindow_x+5,50+24,VisiblePageOffs,9, " mail me a message. Any hints, suggestions and");
\r
553 x_printf(textwindow_x+5,50+32,VisiblePageOffs,9, " contributions are welcome and encouraged.");
\r
554 x_printf(textwindow_x+5,50+52,VisiblePageOffs,9, " I have contributed this code to the public domain.");
\r
555 x_printf(textwindow_x+5,50+60,VisiblePageOffs,9, " Please respect my wishes and leave it there.");
\r
557 x_printf(textwindow_x+5,50+80,VisiblePageOffs,9, " Finally, I hope you all find this stuff useful,");
\r
558 x_printf(textwindow_x+5,50+96,VisiblePageOffs,9, " Themie Gouthas - EGG@DSTOS3.DSTO.GOV.AU");
\r
560 wait_for_keypress();
\r
564 x_shift_rect (27, 27, 360-27, 177, 27, 23, VisiblePageOffs);
\r
565 x_rect_fill(25, 173, 335, 176, VisiblePageOffs, 1);
\r
566 for (i = 0; i < 50; i++) {
\r
567 x_shift_rect (27, 26, 360-27, 177 - (i * 3), 27, 23, VisiblePageOffs);
\r