Esempio n. 1
0
static void
Initialize(
  SoXtGLAreaWidget req,
  SoXtGLAreaWidget neww,
  ArgList args,
  Cardinal * num_args)
{
  // fix size
  if (req->core.width == 0) neww->core.width = 100;
  if (req->core.height == 0) neww->core.width = 100;

  // create the attribute list if needed
  neww->soxtGLArea.myList = FALSE;
  if (neww->soxtGLArea.attribList == NULL) {
    neww->soxtGLArea.myList = TRUE;
    createAttribList(neww);
  }

  // Gotta have it
  assert(neww->soxtGLArea.attribList);

  // determine the visual info if needed
  neww->soxtGLArea.myVisual = FALSE;
  if (neww->soxtGLArea.visualInfo == NULL) {
    neww->soxtGLArea.myVisual = TRUE;
    createVisualInfo(neww);
  }

  // Gotta have that too
  assert(neww->soxtGLArea.visualInfo);

  neww->core.depth = neww->soxtGLArea.visualInfo->depth;

  // Reobtain the colormap and colors in it using XtGetApplicationResources
  XtGetApplicationResources((Widget) neww, neww, initializeResources,
    XtNumber(initializeResources), args, *num_args);

  // obtain the color resources if appropriate
  if (req->soxtGLArea.allocateBackground) {
    XtGetApplicationResources((Widget) neww, neww, backgroundResources,
      XtNumber(backgroundResources), args, *num_args);
  }

  if (req->soxtGLArea.allocateOtherColors) {
    XtGetApplicationResources((Widget) neww, neww, otherColorResources,
      XtNumber(otherColorResources), args, *num_args);
  }
} // Initialize()
Esempio n. 2
0
static void Initialize(GLwDrawingAreaWidget req,GLwDrawingAreaWidget neww,ArgList args,Cardinal *num_args) {

    /* fix size */
    if(req->core.width==0) neww->core.width=100;
    if(req->core.height==0) neww->core.width=100;

    /* create the attribute list if needed */
    neww->glwDrawingArea.myList=FALSE;
    if(neww->glwDrawingArea.attribList==NULL) {
        neww->glwDrawingArea.myList=TRUE;
        createAttribList(neww);
    }

    /* Gotta have it */
    assert(neww->glwDrawingArea.attribList);

    /* determine the visual info if needed */
    neww->glwDrawingArea.myVisual=FALSE;
    if(neww->glwDrawingArea.visualInfo==NULL) {
        neww->glwDrawingArea.myVisual=TRUE;
        createVisualInfo(neww);
    }

    /* Gotta have that too */
    assert(neww->glwDrawingArea.visualInfo);

    neww->core.depth=neww->glwDrawingArea.visualInfo->depth;

    /* Reobtain the colormap and colors in it using XtGetApplicationResources*/
    XtGetApplicationResources((Widget)neww,neww,initializeResources,XtNumber(initializeResources),args,*num_args);

    /* obtain the color resources if appropriate */
    if(req->glwDrawingArea.allocateBackground) {
        XtGetApplicationResources((Widget)neww,neww,backgroundResources,XtNumber(backgroundResources),args,*num_args);
    }

#ifdef __GLX_MOTIF
    if(req->glwDrawingArea.allocateOtherColors) {
        XtGetApplicationResources((Widget)neww,neww,otherColorResources,XtNumber(otherColorResources),args,*num_args);
    }
#endif
}