I am trying to update some legacy OpenGL code that I wrote back in 2003.  I 
have pixel data of a CT scan that I am trying to view.  In the 2003 code I was 
able to use glDrawPixel to draw the pixel data.  It appears that glDrawPixel 
does not exist anymore.  What process should I be using to be able to draw the 
pixel data.

Here is the related code that I previously used:
@implementation RawDataView

//  This function displays the selected CT data slice into
//       a pane in the upper-left hand corner of the viewing
//       window.
- (void)drawRect: (NSRect) theRect
{
   unsigned char *rawData_p;
   int sliceNumber;
   
    BOOL debug = true;
    if(debug) printf("RawDataView: drawRect: \n");
    
   // get the desired slice and the address of the CT data array
   sliceNumber = [CTData getDesiredSlice];
   rawData_p = [CTData getRawSliceData];

   //  initialize OpenGL window
   //glMatrixMode(GL_PROJECTION);
   //glLoadIdentity();
   //gluOrtho2D(0.0, 2.0, 0.0, 1.0);
   GLKMatrix4 ortho2D = GLKMatrix4MakeOrtho(0.0, 2.0, 0.0, 1.0, 0.0, 100.0);
   
   glClearColor(1.0, 1.0, 1.0, 1.0);
   glClear(GL_COLOR_BUFFER_BIT);
   
   //  display raw CT data slice
   glRasterPos2i(0,0);
    
   //  for testing only - copy input vectors to log file
   if(debug) printf("RawDataView: sliceNumber: %d \n", sliceNumber);
    
   glDrawPixels(ROWS, COLS, GL_RGB, GL_UNSIGNED_BYTE, 
rawData_p+(49152*sliceNumber));
   glFlush();
}

@end

I realize that I am going to have to change: gluOrtho2D(0.0, 2.0, 0.0, 1.0); as 
well.

Celebrate each day with family and friends,

Ian

132 Wintergreene Lane
Regina, SK S4S 0A7
Canada

E-mail: islom...@sasktel.net

Phone: 306-545-8568

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (Mac-opengl@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/mac-opengl/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to