[MPlayer-dev-eng] Fix for vo_gl.c on SGI Octane ?

Gernot Ziegler gz at lysator.liu.se
Wed Sep 4 18:28:30 CEST 2002


Yes, I know how to make a patch :-), but:
is GL_BGR a typo or intended like that ?

> Could you make a patch out of this, please?  DOCS/tech/patches.txt
> explains how.  Thanks
>
> Diego
>
> On Wed, Sep 04, 2002 at 02:50:59PM +0200, Gernot Ziegler wrote:
> > Now I found out why vo_gl.c only produces a white canvas, and vo_gl2
> > works:
> >
> > #if 1
> > //  glBindTexture(GL_TEXTURE_2D, texture_id);
> >   glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR);
> >   glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR);
> > #ifdef TEXTUREFORMAT_32BPP
> >   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, texture_width, texture_height,
> > 0,
> > #else
> >   glTexImage2D(GL_TEXTURE_2D, 0, BYTES_PP, texture_width, texture_height,
> > 0,
> > #endif
> >        (image_bytes==4)?GL_RGBA:GL_BGR, GL_UNSIGNED_BYTE, ImageData);
> > #endif
> >
> > GL_BGR up there has to be replaced by GL_RGB (the Octane OpenGL driver
> > causes an error otherwise).... I don't know if BGR
> > is a bug or a feature, but it looks suspicious since:
> >     for(i=0;i<h;i++){
> >       glTexSubImage2D( GL_TEXTURE_2D,  // target
> > 		       0,              // level
> > 		       x,              // x offset
> > 		       y+i,            // y offset
> > 		       w,              // width
> > 		       1,              // height
> > 		       (BYTES_PP==4)?GL_RGBA:GL_RGB,        // format
> > 		       GL_UNSIGNED_BYTE, // type
> > 		       ImageData+i*dstride );        // *pixels
> >
> > downloads the pictures in GL_RGB mode.
> >
> > (BYTES_PP and image_bytes are both 3 here, and TEXTUREFORMAT_32BPP is
> > defined, maybe an unexpected combination ?)
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>

Servus,
  Gernot

/-----------------------------W-E-L-C-O-M-E------------------------------\
T                 The Austria <=> Sweden connection.....                 T
|                      E-Mail: gz at lysator.liu.se                         H
O                Homepage: http://www.lysator.liu.se/~gz                 E
\------------------------------F-U-T-U-R-E-------------------------------/




More information about the MPlayer-dev-eng mailing list