home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / 18317 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.1 KB  |  91 lines

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!overload.lbl.gov!s1.gov!wayne
  2. From: wayne@s1.gov (Brett M. Wayne)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Pixmode (PM_ADD24... problem
  5. Message-ID: <1992Dec24.010018.22178@s1.gov>
  6. Date: 24 Dec 92 01:00:18 GMT
  7. Sender: usenet@s1.gov
  8. Organization: LLNL
  9. Lines: 79
  10. Nntp-Posting-Host: s1.gov
  11.  
  12. ///////////////////////////////////////////////////////////////////////////
  13. //
  14. // I have some large scale image data which I am trying to display 
  15. // as efficiently as possible. The data is packed as 8-bit values
  16. // and represent offsets into an active color table.
  17. //
  18. // My strategy for display is to set pixmode( PM_SIZE, 8) and 
  19. // pixmode( PM_ADD24, index ) where index represents a preset block of 
  20. // colors on the GL color map.
  21. //
  22. // I am experiencing a possible incompatability between the Reality Engine
  23. // and the VGX when trying to use that pixmode setting. On a 380 VGX, the
  24. // following code produces the expected result. Results on a Crimson Reality 
  25. // Engine, however, are completely different.
  26. // 
  27. // Does anyone have an explanation.
  28. //
  29. // Brett Wayne 
  30. // Lawrence Livermore National Laboratory (LLNL)
  31. //
  32. // wayne@s1.gov
  33. //
  34. ///////////////////////////////////////////////////////////////////////////
  35.  
  36.  
  37. #include <unistd.h>
  38. #include <gl.h>
  39.  
  40. void main ( void )
  41. {
  42.    long win_id;
  43.  
  44.    foreground();
  45.  
  46.    prefposition ( 410,   1210,  600, 1000 );
  47.  
  48.    win_id = winopen ( "PM_ADD24 Test" );
  49.  
  50.    winset       ( win_id );
  51.    drawmode     ( NORMALDRAW );
  52.    singlebuffer ( );
  53.    cmode        ( );
  54.    gconfig      ( );
  55.  
  56.    clear ();
  57.  
  58.    ortho2 ( -0.5, 800.5, -0.5, 400.5 );
  59.  
  60.    int tile_size = 25*25;
  61.  
  62.    unsigned long *tile = new unsigned long [tile_size];
  63.  
  64.    pixmode ( PM_SIZE,  32 );
  65.  
  66. #if 0
  67.    pixmode ( PM_ADD24,  8 ); 
  68. #else
  69.    pixmode ( PM_ADD24,  0 );
  70. #endif
  71.  
  72.    int i,j,k,l;
  73.  
  74.    for ( i=0, k=0; i < 9; i++ )
  75.    {
  76.       for ( j=0; j < 32; j++, k++ )
  77.       {
  78.          if ( k > 255 )
  79.             break;
  80.  
  81.          for ( l=0; l < tile_size; l++ )
  82.             tile[l] = k;
  83.  
  84.          lrectwrite ( j*25, i*25, (j+1)*25-1, (i+1)*25-1, tile );
  85.       }
  86.  
  87.    }
  88.    
  89.    pause();
  90. }
  91.