http://wiki.videolan.org/LibVLC_SampleCode_SDL
I'm currently generating my OpenGL texture using:
Code: Select all
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 1.0 );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 0x812F );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 0x812F );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
glTexImage2D( GL_TEXTURE_2D, 0, 3, ctx.surf->w, ctx.surf->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ctx.surf->pixels );
though that appears to be obviously wrong.. any insight?
Thanks!
[FIX]
changed chroma to "RV32", and set the pitch to width*4, its working now as expected, all aside from the red/blue colors being reversed.. not sure how to fix that, because my SDL_Surface mask is correct.. =| I temperarly fixed this using GL_BGRA_EXT, but I'd like to know the less ~crappy~ way of resolving this..