home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi.graphics
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!umn.edu!i5.arc.umn.edu!moses
- From: moses@i5.arc.umn.edu (Matthew E. Moses)
- Subject: using Overlay planes with the GlxMDraw Widget
- Message-ID: <C1By8u.JFv@news2.cis.umn.edu>
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: i5.arc.umn.edu
- Organization: Army High Performance Computer Research Center
- Date: Sat, 23 Jan 1993 23:22:06 GMT
- Lines: 58
-
- I am using the GL Widget in combination with motif. I want to use the
- overlay plane for rubber-banding. I've looked at the sample overlay.c from
- the 4Dgifts examples but it doesn't provide any insight. I draw an image in
- the normal plane and then based on mouse input use the following code to do the rubber banding from an input callback:
-
- XtVaGetValues(w, GlxNoverlayWindow, &over, NULL);
-
- err = GLXwinset(XtDisplay(w), over);
- fprintf(stdout, "\n overlay window: %d, err: %d", over, err);
- fflush(stdout);
-
- c3i(Black); /* erase old band */
- rect(oldX, oldY, oldX1, oldY1);
-
- c3i(Blue); /* draw new band */
- rect(mouseDownX, mouseDownY, newX, newY);
-
- gflush();
-
- The GLXwinset call is returning 0 (no error) but the drawing rect call doesn't show up in the overlay plane.
-
- 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:
-
- static GLXconfig glxConfig [] =
- {
- { GLX_NORMAL, GLX_RGB, TRUE },
- { GLX_OVERLAY, GLX_BUFSIZE, 2},
- { GLX_OVERLAY, GLX_RGB, TRUE },
- { 0, 0, 0 }
- };
-
- ...
-
- XtSetArg(args[i], GlxNglxConfig, glxConfig); i++;
- XtSetArg(args[i], GlxNuseOverlay, True); i++;
- gGLWidget = XtCreateManagedWidget("glwidget", glxMDrawWidgetClass,
- frame, args, i);
- XtAddCallback(gGLWidget, GlxNoverlayExposeCallback, OverlayDrawSceneCB,
- (XtPointer) NULL);
- XtAddCallback(gGLWidget, GlxNinputCallback, HandleInputCB,
- (XtPointer) NULL);
- XtAddCallback(gGLWidget, GlxNexposeCallback, DrawSceneCB,
- (XtPointer) NULL);
- XtAddCallback(gGLWidget, GlxNresizeCallback, ResizeScreenCB,
- (XtPointer) NULL);
- XtAddCallback(gGLWidget, GlxNginitCallback, InitializeGLCB,
- (XtPointer) NULL);
-
- Any help or pointers to information would be appreciated.
-
-
- *------------------*-----------------------*-----------------------------*
- * Matthew E. Moses * AHPCRC Systems Staff * moses@ahpcrc.umn.edu *
- * * CIS Consultant * moses@mermaid.micro.umn.edu *
- * U of Minnesota *-----------------------*-----------------------------*
- * * Office: (612)626-8136 * Home: (612)624-0126 *
- *------------------*-----------------------*-----------------------------*
-
-