home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / sgi / graphics / 191 < prev    next >
Encoding:
Text File  |  1993-01-24  |  2.7 KB  |  70 lines

  1. Newsgroups: comp.sys.sgi.graphics
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!umn.edu!i5.arc.umn.edu!moses
  3. From: moses@i5.arc.umn.edu (Matthew E. Moses)
  4. Subject: using Overlay planes with the GlxMDraw Widget
  5. Message-ID: <C1By8u.JFv@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: i5.arc.umn.edu
  8. Organization: Army High Performance Computer Research Center
  9. Date: Sat, 23 Jan 1993 23:22:06 GMT
  10. Lines: 58
  11.  
  12. I am using the GL Widget in combination with motif.  I want to use the 
  13. overlay plane for rubber-banding.  I've looked at the sample overlay.c from 
  14. the 4Dgifts examples but it doesn't provide any insight.  I draw an image in 
  15. the normal plane and then based on mouse input use the following code to do the rubber banding from an input callback:
  16.  
  17.       XtVaGetValues(w, GlxNoverlayWindow, &over, NULL);
  18.  
  19.       err = GLXwinset(XtDisplay(w), over);
  20.       fprintf(stdout, "\n overlay window: %d, err: %d", over, err); 
  21.       fflush(stdout);
  22.  
  23.       c3i(Black); /* erase old band */
  24.       rect(oldX, oldY, oldX1, oldY1);
  25.  
  26.       c3i(Blue); /* draw new band */
  27.       rect(mouseDownX, mouseDownY, newX, newY);
  28.       
  29.       gflush();
  30.  
  31. The GLXwinset call is returning 0 (no error) but the drawing rect call doesn't show up in the overlay plane.
  32.  
  33. Does anyone know if there is a special way you have to initialize the overlay planes of the widget?  The following is how I am initializing the widget:
  34.  
  35. static GLXconfig glxConfig [] = 
  36. {
  37.     { GLX_NORMAL, GLX_RGB, TRUE },
  38.     { GLX_OVERLAY,  GLX_BUFSIZE, 2},
  39.     { GLX_OVERLAY, GLX_RGB, TRUE },
  40.     { 0, 0, 0 }
  41. };
  42.  
  43. ...
  44.  
  45.      XtSetArg(args[i], GlxNglxConfig, glxConfig); i++;
  46.      XtSetArg(args[i], GlxNuseOverlay, True); i++;
  47.      gGLWidget = XtCreateManagedWidget("glwidget", glxMDrawWidgetClass,
  48.                        frame, args, i);
  49.      XtAddCallback(gGLWidget, GlxNoverlayExposeCallback, OverlayDrawSceneCB, 
  50.            (XtPointer) NULL);
  51.      XtAddCallback(gGLWidget, GlxNinputCallback, HandleInputCB, 
  52.            (XtPointer) NULL);
  53.      XtAddCallback(gGLWidget, GlxNexposeCallback, DrawSceneCB, 
  54.            (XtPointer) NULL);
  55.      XtAddCallback(gGLWidget, GlxNresizeCallback, ResizeScreenCB, 
  56.            (XtPointer) NULL);
  57.      XtAddCallback(gGLWidget, GlxNginitCallback, InitializeGLCB, 
  58.            (XtPointer) NULL);
  59.  
  60. Any help or pointers to information would be appreciated.
  61.  
  62.  
  63. *------------------*-----------------------*-----------------------------*
  64. * Matthew E. Moses * AHPCRC Systems Staff  * moses@ahpcrc.umn.edu        *
  65. *                  * CIS Consultant        * moses@mermaid.micro.umn.edu *
  66. *  U of Minnesota  *-----------------------*-----------------------------*   
  67. *                  * Office: (612)626-8136 * Home: (612)624-0126         *
  68. *------------------*-----------------------*-----------------------------*  
  69.  
  70.