ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/test.C
(Generate patch)

Comparing libgender/test.C (file contents):
Revision 1.4 by root, Sun Oct 3 02:19:07 2004 UTC vs.
Revision 1.5 by root, Sun Oct 3 02:38:33 2004 UTC

27{ 27{
28 SDL_Surface *screen; 28 SDL_Surface *screen;
29 29
30 screen = SDL_GetVideoSurface (); 30 screen = SDL_GetVideoSurface ();
31 if (SDL_WM_ToggleFullScreen (screen)) 31 if (SDL_WM_ToggleFullScreen (screen))
32 {
33 printf ("Toggled fullscreen mode - now %s\n", 32 printf ("Toggled fullscreen mode - now %s\n",
34 (screen->flags & SDL_FULLSCREEN) ? "fullscreen" : "windowed"); 33 (screen->flags & SDL_FULLSCREEN) ? "fullscreen" : "windowed");
35 }
36 else 34 else
37 {
38 printf ("Unable to toggle fullscreen mode\n"); 35 printf ("Unable to toggle fullscreen mode\n");
39 }
40} 36}
41 37
42void 38void
43HotKey_ToggleGrab (void) 39HotKey_ToggleGrab (void)
44{ 40{
45 SDL_GrabMode mode; 41 SDL_GrabMode mode;
46 42
47 printf ("Ctrl-G: toggling input grab!\n"); 43 printf ("Ctrl-G: toggling input grab!\n");
48 mode = SDL_WM_GrabInput (SDL_GRAB_QUERY); 44 mode = SDL_WM_GrabInput (SDL_GRAB_QUERY);
49 if (mode == SDL_GRAB_ON) 45 if (mode == SDL_GRAB_ON)
50 {
51 printf ("Grab was on\n"); 46 printf ("Grab was on\n");
52 }
53 else 47 else
54 {
55 printf ("Grab was off\n"); 48 printf ("Grab was off\n");
56 }
57 49
58 mode = SDL_WM_GrabInput (mode ? SDL_GRAB_OFF : SDL_GRAB_ON); 50 mode = SDL_WM_GrabInput (mode ? SDL_GRAB_OFF : SDL_GRAB_ON);
59 if (mode == SDL_GRAB_ON) 51 if (mode == SDL_GRAB_ON)
60 {
61 printf ("Grab is now on\n"); 52 printf ("Grab is now on\n");
62 }
63 else 53 else
64 {
65 printf ("Grab is now off\n"); 54 printf ("Grab is now off\n");
66 }
67} 55}
68 56
69void 57void
70HotKey_Iconify (void) 58HotKey_Iconify (void)
71{ 59{
401 389
402 /* Do our drawing, too. */ 390 /* Do our drawing, too. */
403 glClearColor (0.0, 0.0, 0.0, 1.0); 391 glClearColor (0.0, 0.0, 0.0, 1.0);
404 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 392 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
405 393
394#if 0
406 static GLfloat ry; 395 static GLfloat ry;
407 ry += 0.1; 396 ry += 0.03;
408 v.d.x = cos (ry); 397 v.d.x = cos (ry);
409 v.d.z = sin (ry); 398 v.d.z = sin (ry);
399#endif
410 400
411 draw_context c; 401 draw_context c;
412 v.draw (c); 402 v.draw (c);
413 403
414 SDL_GL_SwapBuffers (); 404 SDL_GL_SwapBuffers ();
473 int noframe = 0; 463 int noframe = 0;
474 int fsaa = 0; 464 int fsaa = 0;
475 465
476 // load a entity 466 // load a entity
477 txtprt_parser p; 467 txtprt_parser p;
468 entity_base *e;
478 try { 469 try {
479 entity *e = p.read ("test.blasc"); 470 e = p.read ("test.blasc");
480 } catch (txtprt_i_exception & e) { 471 } catch (txtprt_i_exception & e) {
481 cout << "ERR: " << e.msg << endl; 472 cout << "ERR: " << e.msg << endl;
482 } 473 }
483 // now please draw my entity ;) 474 world.add (e);
484 475
485 logo = 0; 476 logo = 0;
486 slowly = 0; 477 slowly = 0;
487 numtests = 1; 478 numtests = 1;
488 for (i = 1; argv[i]; ++i) 479 for (i = 1; argv[i]; ++i)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines