Commit 1858bcb8 authored by Ilkka Ollakka's avatar Ilkka Ollakka

opengl: use ActiveTexture instead of ARB variant

parent 46d64803
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
# define PFNGLPROGRAMSTRINGARBPROC typeof(glProgramStringARB)* # define PFNGLPROGRAMSTRINGARBPROC typeof(glProgramStringARB)*
# define PFNGLDELETEPROGRAMSARBPROC typeof(glDeleteProgramsARB)* # define PFNGLDELETEPROGRAMSARBPROC typeof(glDeleteProgramsARB)*
# define PFNGLPROGRAMLOCALPARAMETER4FVARBPROC typeof(glProgramLocalParameter4fvARB)* # define PFNGLPROGRAMLOCALPARAMETER4FVARBPROC typeof(glProgramLocalParameter4fvARB)*
# define PFNGLACTIVETEXTUREARBPROC typeof(glActiveTextureARB)* # define PFNGLACTIVETEXTUREPROC typeof(glActiveTexture)*
# define PFNGLCLIENTACTIVETEXTUREARBPROC typeof(glClientActiveTextureARB)* # define PFNGLCLIENTACTIVETEXTUREPROC typeof(glClientActiveTexture)*
#endif #endif
/* RV16 */ /* RV16 */
...@@ -117,8 +117,8 @@ struct vout_display_opengl_t { ...@@ -117,8 +117,8 @@ struct vout_display_opengl_t {
/* multitexture */ /* multitexture */
bool use_multitexture; bool use_multitexture;
PFNGLACTIVETEXTUREARBPROC ActiveTextureARB; PFNGLACTIVETEXTUREPROC ActiveTexture;
PFNGLCLIENTACTIVETEXTUREARBPROC ClientActiveTextureARB; PFNGLCLIENTACTIVETEXTUREPROC ClientActiveTexture;
}; };
static inline int GetAlignedSize(unsigned size) static inline int GetAlignedSize(unsigned size)
...@@ -187,14 +187,14 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, ...@@ -187,14 +187,14 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
GLint max_texture_units = 0; GLint max_texture_units = 0;
if (HasExtension(extensions, "GL_ARB_multitexture")) { if (HasExtension(extensions, "GL_ARB_multitexture")) {
#if !defined(MACOS_OPENGL) #if !defined(MACOS_OPENGL)
vgl->ActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glActiveTextureARB"); vgl->ActiveTexture = (PFNGLACTIVETEXTUREPROC)vlc_gl_GetProcAddress(vgl->gl, "glActiveTexture");
vgl->ClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glClientActiveTextureARB"); vgl->ClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)vlc_gl_GetProcAddress(vgl->gl, "glClientActiveTexture");
#else #else
vgl->ActiveTextureARB = glActiveTextureARB; vgl->ActiveTexture = glActiveTexture;
vgl->ClientActiveTextureARB = glClientActiveTextureARB; vgl->ClientActiveTexture = glClientActiveTexture;
#endif #endif
supports_multitexture = vgl->ActiveTextureARB && supports_multitexture = vgl->ActiveTexture &&
vgl->ClientActiveTextureARB; vgl->ClientActiveTexture;
if (supports_multitexture) if (supports_multitexture)
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &max_texture_units); glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &max_texture_units);
} }
...@@ -458,7 +458,7 @@ picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned ...@@ -458,7 +458,7 @@ picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned
glGenTextures(vgl->chroma->plane_count, vgl->texture[i]); glGenTextures(vgl->chroma->plane_count, vgl->texture[i]);
for (unsigned j = 0; j < vgl->chroma->plane_count; j++) { for (unsigned j = 0; j < vgl->chroma->plane_count; j++) {
if (vgl->use_multitexture) if (vgl->use_multitexture)
vgl->ActiveTextureARB(GL_TEXTURE0_ARB + j); vgl->ActiveTexture(GL_TEXTURE0 + j);
glBindTexture(vgl->tex_target, vgl->texture[i][j]); glBindTexture(vgl->tex_target, vgl->texture[i][j]);
#if !USE_OPENGL_ES #if !USE_OPENGL_ES
...@@ -514,7 +514,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl, ...@@ -514,7 +514,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
/* Update the texture */ /* Update the texture */
for (unsigned j = 0; j < vgl->chroma->plane_count; j++) { for (unsigned j = 0; j < vgl->chroma->plane_count; j++) {
if (vgl->use_multitexture) if (vgl->use_multitexture)
vgl->ActiveTextureARB(GL_TEXTURE0_ARB + j); vgl->ActiveTexture(GL_TEXTURE0 + j);
glBindTexture(vgl->tex_target, vgl->texture[0][j]); glBindTexture(vgl->tex_target, vgl->texture[0][j]);
glPixelStorei(GL_UNPACK_ROW_LENGTH, picture->p[j].i_pitch / picture->p[j].i_pixel_pitch); glPixelStorei(GL_UNPACK_ROW_LENGTH, picture->p[j].i_pitch / picture->p[j].i_pixel_pitch);
glTexSubImage2D(vgl->tex_target, 0, glTexSubImage2D(vgl->tex_target, 0,
...@@ -540,7 +540,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl, ...@@ -540,7 +540,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
vgl->region = calloc(count, sizeof(*vgl->region)); vgl->region = calloc(count, sizeof(*vgl->region));
if (vgl->use_multitexture) if (vgl->use_multitexture)
vgl->ActiveTextureARB(GL_TEXTURE0_ARB + 0); vgl->ActiveTexture(GL_TEXTURE0 + 0);
int i = 0; int i = 0;
for (subpicture_region_t *r = subpicture->p_region; r; r = r->p_next, i++) { for (subpicture_region_t *r = subpicture->p_region; r; r = r->p_next, i++) {
gl_region_t *glr = &vgl->region[i]; gl_region_t *glr = &vgl->region[i];
...@@ -690,8 +690,8 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl, ...@@ -690,8 +690,8 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
right[j], top[j], right[j], top[j],
right[j], bottom[j], right[j], bottom[j],
}; };
vgl->ActiveTextureARB( GL_TEXTURE0_ARB+j); vgl->ActiveTexture( GL_TEXTURE0+j);
vgl->ClientActiveTextureARB( GL_TEXTURE0_ARB+j); vgl->ClientActiveTexture( GL_TEXTURE0+j);
glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glBindTexture(vgl->tex_target, vgl->texture[0][j]); glBindTexture(vgl->tex_target, vgl->texture[0][j]);
glTexCoordPointer(2, GL_FLOAT, 0, texCoord); glTexCoordPointer(2, GL_FLOAT, 0, texCoord);
...@@ -703,8 +703,8 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl, ...@@ -703,8 +703,8 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
for( int j = vgl->chroma->plane_count; j >= 0;j--) for( int j = vgl->chroma->plane_count; j >= 0;j--)
{ {
vgl->ActiveTextureARB( GL_TEXTURE0_ARB+j); vgl->ActiveTexture( GL_TEXTURE0+j);
vgl->ClientActiveTextureARB( GL_TEXTURE0_ARB+j); vgl->ClientActiveTexture( GL_TEXTURE0+j);
glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY);
} }
...@@ -716,7 +716,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl, ...@@ -716,7 +716,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
glDisable(vgl->tex_target); glDisable(vgl->tex_target);
if (vgl->use_multitexture) if (vgl->use_multitexture)
vgl->ActiveTextureARB(GL_TEXTURE0_ARB + 0); vgl->ActiveTexture(GL_TEXTURE0 + 0);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment