Thread View: comp.sys.sgi.graphics
2 messages
2 total messages
Started by Matthew E. Moses
Sat, 23 Jan 1993 23:22
using Overlay planes with the GlxMDraw Widget
Author: Matthew E. Moses
Date: Sat, 23 Jan 1993 23:22
Date: Sat, 23 Jan 1993 23:22
57 lines
2856 bytes
2856 bytes
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 *
*------------------*-----------------------*-----------------------------*
Re: using Overlay planes with the GlxMDraw Widget
Author: Joel Tesler
Date: Mon, 25 Jan 1993 17:40
Date: Mon, 25 Jan 1993 17:40
26 lines
1522 bytes
1522 bytes
In article <C1By8u.JFv@news2.cis.umn.edu>, moses@i5.arc.umn.edu writes: > I am using the GL Widget in combination with motif. I want to use the > overlay plane for rubber-banding. A couple of things: First, are you installing the colormaps? You need to use XSetWMColormapWindows to install the colormaps of both the normal and overlay GL colormaps. If they aren't installed, you won't get the correct colors. Second, and this is probably the problem, you are trying to use RGB for the overlay planes. Some of our very high end hardware may support this (I don't know for sure), but most of the hardware doesn't; and none of it does with overlays with a depth of 2. With a depth of 2 you have exactly 3 colors + transparent; and the best way to allocate those three colors is to use X color allocation mechanisms (It is often a good idea to get a new X colormap for the overlay planes so you don't need to share the 3 colors between multiple applications). Then use color (not c3i) to allocate the colors. Joel Tesler joel@sgi.com 415-390-3048
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads