Mixed Mode problem.

New Message Reply Date view Thread view Subject view Author view

Micheal J. Williams (mwilliam++at++ldsa.com)
Fri, 21 Jul 1995 14:14:02 -0400


I am trying a mixed model program with Performer 1.2, and
IRIX 5.2. The program is running much slower than we
expected, and we are seeing a great deal cpu time going
to the system, and interrupts.

Gldebug gives us many warnings, and errors. All swapbuffers
get an error because it doesn't register that the program is
in double buffer mode. All calls to RGBcolor, c3f etc give
warnings that the program is not in RGB mode. Somebody here
has suggested that the problem may be a result of mismatch
between motif, and GLX windows.

It appears that these warnings are causing the system time to
shoot up dramatically. Should you stick to purely pfutility
calls in implementing GLX mixed mode? Are there good examples?

Currently we call (This part is done in ada)

   -- open X display
   XDPY := XLIB.OPENDISPLAY(":0.0");

   -- create parent window
   XWIN := XLIB.CREATEWINDOW(XDPY,
                             XLIB.ROOTWINDOW(XDPY, XLIB.DEFAULTSCREEN(XDPY)),
                             1, -- stick up in corner
                             1,
                             INTEGER(XSIZE),
                             INTEGER(YSIZE),
                             0,
                             XLIB.COPYFROMPARENT,
                             XLIB.INPUTOUTPUT,
                             XLIB.COPYFROMPARENT,
                             XLIB.CWBACKPIXEL,
                             SWA);

    -- create GLX window for GL rendering
    PERFORMER_UTILITIES.CREATE_GLX_WINDOW (XDPY,
                                           INTEGER(XWIN) ,
                                           GLWIN'address,
                                           OVERWIN'address,
                                           INTEGER(XSIZE),
                                           INTEGER(YSIZE));
     
    XLIB.SELECTINPUT(XDPY, GLWIN, XLIB.EXPOSUREMASK);
    XLIB.MAPWINDOW(XDPY, GLWIN);
    XLIB.MAPWINDOW(XDPY, XWIN);
    XLIB.FLUSH(XDPY);

-------
   the PERFORMER_UTILITIES.CREATE_GLX_WINDOW is
   a C shell around pfuGLXCreateWindow as follows
-------
#include <gl/glws.h>
#include "pfutil.h"

/* prototype */
unsigned long GLXgetvalue(GLXconfig* conf, int buffer, int mode);

void Create_GLX_Window (pfuXDisplay *XDpy,
                          pfuXWindow parent,
                           unsigned long *glwin,
                          unsigned long *overwin,
                          int xSize,
                          int ySize)
   {
   GLXconfig *config;

    /* create window from 0,0 to xsize, ysize with no border. */
    config = pfuGLXCreateWindow(XDpy, parent, 0, 0, xSize, ySize, 0,
                                 GLX_NORMAL, GLX_DOUBLE, TRUE,
                                 GLX_NORMAL, GLX_RGB, TRUE,
                                 GLX_NORMAL, GLX_ZSIZE, GLX_NOCONFIG,
                                 0, 0, 0);
     
    *glwin = GLXgetvalue(config, GLX_NORMAL, GLX_WINDOW);
    *overwin = GLXgetvalue(config, GLX_OVERLAY, GLX_WINDOW);
    
   return;
   }

/*
 ** Used to get a value out of the configuration structure returned by
 ** GLXgetconfig. Scan through the GLX config structure, and, when we
 ** find the proper buffer-mode combination, return the argument relevant
 ** for that buffer type.
 */
unsigned long GLXgetvalue(GLXconfig* conf, int buffer, int mode)
{
    int i;
    for (i = 0; conf[i].buffer; i++)
        if (conf[i].buffer == buffer && conf[i].mode == mode)
            return conf[i].arg;
    return 0;
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:42 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.