[MPlayer-dev-eng] Fix for vo_gl.c on SGI Octane ?
Gernot Ziegler
gz at lysator.liu.se
Wed Sep 4 14:50:59 CEST 2002
Hej guys !
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 ?)
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