home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!agate!overload.lbl.gov!s1.gov!wayne
- From: wayne@s1.gov (Brett M. Wayne)
- Newsgroups: comp.sys.sgi
- Subject: Pixmode (PM_ADD24... problem
- Message-ID: <1992Dec24.010018.22178@s1.gov>
- Date: 24 Dec 92 01:00:18 GMT
- Sender: usenet@s1.gov
- Organization: LLNL
- Lines: 79
- Nntp-Posting-Host: s1.gov
-
- ///////////////////////////////////////////////////////////////////////////
- //
- // I have some large scale image data which I am trying to display
- // as efficiently as possible. The data is packed as 8-bit values
- // and represent offsets into an active color table.
- //
- // My strategy for display is to set pixmode( PM_SIZE, 8) and
- // pixmode( PM_ADD24, index ) where index represents a preset block of
- // colors on the GL color map.
- //
- // I am experiencing a possible incompatability between the Reality Engine
- // and the VGX when trying to use that pixmode setting. On a 380 VGX, the
- // following code produces the expected result. Results on a Crimson Reality
- // Engine, however, are completely different.
- //
- // Does anyone have an explanation.
- //
- // Brett Wayne
- // Lawrence Livermore National Laboratory (LLNL)
- //
- // wayne@s1.gov
- //
- ///////////////////////////////////////////////////////////////////////////
-
-
- #include <unistd.h>
- #include <gl.h>
-
- void main ( void )
- {
- long win_id;
-
- foreground();
-
- prefposition ( 410, 1210, 600, 1000 );
-
- win_id = winopen ( "PM_ADD24 Test" );
-
- winset ( win_id );
- drawmode ( NORMALDRAW );
- singlebuffer ( );
- cmode ( );
- gconfig ( );
-
- clear ();
-
- ortho2 ( -0.5, 800.5, -0.5, 400.5 );
-
- int tile_size = 25*25;
-
- unsigned long *tile = new unsigned long [tile_size];
-
- pixmode ( PM_SIZE, 32 );
-
- #if 0
- pixmode ( PM_ADD24, 8 );
- #else
- pixmode ( PM_ADD24, 0 );
- #endif
-
- int i,j,k,l;
-
- for ( i=0, k=0; i < 9; i++ )
- {
- for ( j=0; j < 32; j++, k++ )
- {
- if ( k > 255 )
- break;
-
- for ( l=0; l < tile_size; l++ )
- tile[l] = k;
-
- lrectwrite ( j*25, i*25, (j+1)*25-1, (i+1)*25-1, tile );
- }
-
- }
-
- pause();
- }
-