From: Rajesh R (rajeshr++at++cair.res.in)
Date: 07/07/2005 03:36:30
Dea
On Thu, 7 Jul 2005, Ulrich Hertlein wrote:
> Rajesh R wrote:
> > int imagebuffer[500][500];
> > int j,i;
> > int k;
> > pfVec3 far, dummy;
> >
> >
> > for(i=0;i<500;i++)
> > {
> > for(j=0;j<500;j++)
> > {
> > imagebuffer[i][j] = (i+j)%255;
> > }
> > }
> >
> > glClearStencil(0x0);
> > glClear(GL_STENCIL_BUFFER_BIT);
> >
> > pfGetChanFar(chan, far,dummy,dummy,dummy);
> > glRasterPos3f(farPlaneLL[0], farPlaneLL[1],
> > farPlaneLL[2]*0.99999);
> > glDrawPixels(winWidth, winHeight, GL_RGB,GL_UNSIGNED_INT,
> > imagebuffer);
>
> Two things: glRasterPos is transformed by the current modelview &
> projection matrix and is subjected to clipping. It's possible that the
> coordinate is clipped and therefore nothing shows up. Try using the
> glWindowPos ARB extension.
>
> I believe your usage of glDrawPixels is wrong. Using format=RGB and
> type=UNSIGNED_INT results (in my reading) that the command expects three
> UNSIGNED_INTs per pixel i.e. you're feeding it not enough data since you
> only have one UINT per pixel. I'd try type=GL_UNSIGNED_INT_8_8_8_8 i.e.
> one UINT with RGBA packed.
>
> Cheers,
> /ulrich
>
>
This archive was generated by hypermail 2b29 : Thu Jul 07 2005 - 04:01:21 PDT