pfMQuerySys question

New Message Reply Date view Thread view Subject view Author view

From: Soren Vorre Therkildsen (svorre++at++daimi.au.dk)
Date: 03/11/2000 09:40:28


Hi there!

I am having some trouble setting up a framebuffer.

I want to query the system for the max number of
bits for color, depth, stencil and so on.
I have added a code example of how I do this.
I am running the program on an ONYX2 IR, using
Performer2.2.7 Execution Environment.

My problem is that i still get a:
-------------------------------------------------------
PF Notice: pfChooseFBConfig: failed to make
configuration matching specified attributes
-------------------------------------------------------
when I set up the framebuffer.

The answers I get from pfMQuerySys are:

PFQSYS_MAX_DBL_ALPHA_BITS = 12
PFQSYS_MAX_MS_DEPTH_BITS = 23
PFQSYS_MAX_MS_STENCIL_BITS = 8
PFQSYS_MAX_MS_SAMPLES = 8

The only thing I can do to avoid the error message
above is to hardcode PFFB_SAMPLES to 4.

What am I doing wrong ?

Regards
Soeren Vorre

code example:
------------------------------------------------
void
SimpleDisplay::setFrameBufferAttributes ()
{
  int colorBits;
  int depthBits;
  int stencilBits;
  int multiSampleBits;
  int query[5] = {PFQSYS_MAX_DBL_ALPHA_BITS,
                  PFQSYS_MAX_MS_DEPTH_BITS,
                  PFQSYS_MAX_MS_STENCIL_BITS,
                  PFQSYS_MAX_MS_SAMPLES,
                  0};
  int result[4];

  pfMQuerySys (query, result);
  colorBits = result[0];
  depthBits = result[1];
  stencilBits = result[2];
  multiSampleBits = result[3];

  int FBAtrributes[17] = {
    PFFB_RGBA,
    PFFB_DOUBLEBUFFER,
    PFFB_RED_SIZE, colorBits,
    PFFB_GREEN_SIZE, colorBits,
    PFFB_BLUE_SIZE, colorBits,
    PFFB_ALPHA_SIZE, colorBits,
    PFFB_DEPTH_SIZE, depthBits,
    PFFB_STENCIL_SIZE, stencilBits,
    PFFB_SAMPLES, multiSampleBits,
    0
  };

  this->frameBufferAttributes = (int *) pfMalloc(17 * sizeof(int),
                                           pfGetSharedArena());
  memcpy(this->frameBufferAttributes,FBAtrributes,17 * sizeof(int));
}

void
SimpleDisplay::create ()
{
  pfPipeWindow *w;

  setFrameBufferAttributes ();
  this->pipe = pfGetPipe (0);
  w = new pfPipeWindow (this->pipe);
  w->setScreen (0);
  w->setName ("test");
  w->setWinType (PFWIN_TYPE_X);
  w->setFBConfigAttrs (this->frameBufferAttributes);
  w->setOriginSize ( 0, 0, this->windowWidth, this->windowHeigth);
  w->config ();
  w->addChan (leftChannel);
  leftChannel = new pfChannel (this->pipe);

  this->window = w;
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Mar 11 2000 - 09:40:36 PST

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