home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / raytrace / radiance / simplerd.lha / simplerad / FinalFTP / Light / vcr.c.example < prev    next >
Encoding:
Text File  |  1992-07-20  |  2.6 KB  |  107 lines

  1. /**********************************************************************/
  2. /*                                                                    */
  3. /* vcr.c : Some simple routines to record images from screen to VCR   */
  4. /*         using IRIS. The vcr function library is not included. If   */
  5. /*         you wish to record to vcr, please modify the following code*/
  6. /*                                                                    */
  7. /*         It's a bit messy, but it's all I have time to do right     */
  8. /*         now. (b.k.)                                                */
  9. /*                                                                    */
  10. /* Copyright (C) 1992, Bernard Kwok                                   */
  11. /* All rights reserved.                                               */
  12. /* Revision 1.0                                                       */
  13. /* May, 1992                                                          */
  14. /**********************************************************************/
  15. #include <stdio.h>
  16. #include <gl/gl.h>
  17. #include <gl/device.h>
  18. #include <gl/addrs.h>
  19. #include <gl/cg2vme.h>
  20. #include "/cs/u/vgrlab/src/lib/VCRlib/VCRlib.h"
  21. #include "vcr.h"
  22.  
  23. Vcr_params vcr_params = { 
  24.   NTSC,                           /* Default NTCS size */
  25.   XMAX170, YMAX170 
  26.   };
  27.  
  28. /* 
  29.  * Setup parameters for recording 
  30.  */
  31. void vcr_set_mode(mode)
  32.      int mode;
  33. { vcr_params.mode = mode; }
  34.  
  35. /* 
  36.  * Start recording
  37.  */
  38. void vcr_start_record()
  39. {
  40.   if (vcr_params.mode == REC) {
  41.     VCR_open();
  42.     VCR_init(ONE_SHOT_MODE);
  43.     VCR_RECORD();
  44.     VCR_RECORD();
  45.   }
  46. }
  47.  
  48. /* 
  49.  * Window setup (call before calling winopen). Fixed size at lower left.
  50.  */
  51. void vcr_setup_window(bord)
  52.      int bord;
  53.   if (!bord) 
  54.     noborder(); 
  55.   prefposition(0,vcr_params.width-1,0,vcr_params.height-1);
  56.   prefsize(vcr_params.width,vcr_params.height);
  57.   maxsize(vcr_params.width,vcr_params.height);
  58.   minsize(vcr_params.width,vcr_params.height);
  59. }
  60.  
  61. /*
  62.  * Once window is up, set video parameters 
  63.  */
  64. void vcr_start_video()
  65. {
  66.   if (vcr_params.mode == REC) {
  67.     setvideo (DE_R1, (long) 0);    /* reset the de3 */
  68.     setvideo (DE_R1, DER1_G_170 | DER1_UNBLANK); /* genlocked RS170 */
  69.     setvideo (CG_MODE, 0x2);    /* set cg2 to mode 2 */
  70.   }
  71. }
  72.  
  73. /*
  74.  * Grab whats on the window. Do after evey draw, and swapbuffer.
  75.  */
  76. void vcr_grab()
  77.   if (vcr_params.mode == REC) VCR_RECORD(); 
  78. }
  79.  
  80. /* 
  81.  * Stop recording 
  82.  */
  83. void vcr_stop_record()
  84. {
  85.   if (vcr_params.mode == REC) {
  86.     VCR_STOP();
  87.     VCR_close();
  88.   }
  89. }
  90.  
  91. /*
  92.  * Reset video parameters 
  93.  */
  94. void vcr_end_video()
  95. {
  96.   if (vcr_params.mode == REC) 
  97.     setvideo (DE_R1, DER1_60HZ | DER1_SYNCG | DER1_UNBLANK);
  98. }
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.