Commit 52cd14db authored by Laurent Aimar's avatar Laurent Aimar

Used the right function pointer prototype in opengl.

It should fix at least the win32 segfaults.
parent 110e953c
...@@ -120,16 +120,16 @@ struct vout_display_opengl_t { ...@@ -120,16 +120,16 @@ struct vout_display_opengl_t {
GLfloat local_value[16][4]; GLfloat local_value[16][4];
/* fragment_program */ /* fragment_program */
void (*GenProgramsARB)(GLsizei, GLuint *); PFNGLGENPROGRAMSARBPROC GenProgramsARB;
void (*BindProgramARB)(GLenum, GLuint); PFNGLBINDPROGRAMARBPROC BindProgramARB;
void (*ProgramStringARB)(GLenum, GLenum, GLsizei, const GLvoid *); PFNGLPROGRAMSTRINGARBPROC ProgramStringARB;
void (*DeleteProgramsARB)(GLsizei, const GLuint *); PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB;
void (*ProgramLocalParameter4fvARB)(GLenum, GLuint, const GLfloat *); PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB;
/* multitexture */ /* multitexture */
bool use_multitexture; bool use_multitexture;
void (*ActiveTextureARB)(GLenum); PFNGLACTIVETEXTUREARBPROC ActiveTextureARB;
void (*MultiTexCoord2fARB)(GLenum, GLfloat, GLfloat); PFNGLMULTITEXCOORD2FARBPROC MultiTexCoord2fARB;
}; };
static inline int GetAlignedSize(unsigned size) static inline int GetAlignedSize(unsigned size)
...@@ -160,11 +160,11 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, ...@@ -160,11 +160,11 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
/* Load extensions */ /* Load extensions */
bool supports_fp = false; bool supports_fp = false;
if (strstr(extensions, "GL_ARB_fragment_program")) { if (strstr(extensions, "GL_ARB_fragment_program")) {
vgl->GenProgramsARB = (void (*)(GLsizei, GLuint *))vlc_gl_GetProcAddress(vgl->gl, "glGenProgramsARB"); vgl->GenProgramsARB = (PFNGLGENPROGRAMSARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glGenProgramsARB");
vgl->BindProgramARB = (void (*)(GLenum, GLuint))vlc_gl_GetProcAddress(vgl->gl, "glBindProgramARB"); vgl->BindProgramARB = (PFNGLBINDPROGRAMARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glBindProgramARB");
vgl->ProgramStringARB = (void (*)(GLenum, GLenum, GLsizei, const GLvoid *))vlc_gl_GetProcAddress(vgl->gl, "glProgramStringARB"); vgl->ProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glProgramStringARB");
vgl->DeleteProgramsARB = (void (*)(GLsizei, const GLuint *))vlc_gl_GetProcAddress(vgl->gl, "glDeleteProgramsARB"); vgl->DeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glDeleteProgramsARB");
vgl->ProgramLocalParameter4fvARB = (void (*)(GLenum, GLuint, const GLfloat *))vlc_gl_GetProcAddress(vgl->gl, "glProgramLocalParameter4fvARB"); vgl->ProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glProgramLocalParameter4fvARB");
supports_fp = vgl->GenProgramsARB && supports_fp = vgl->GenProgramsARB &&
vgl->BindProgramARB && vgl->BindProgramARB &&
...@@ -176,8 +176,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, ...@@ -176,8 +176,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
bool supports_multitexture = false; bool supports_multitexture = false;
GLint max_texture_units = 0; GLint max_texture_units = 0;
if (strstr(extensions, "GL_ARB_multitexture")) { if (strstr(extensions, "GL_ARB_multitexture")) {
vgl->ActiveTextureARB = (void (*)(GLenum))vlc_gl_GetProcAddress(vgl->gl, "glActiveTextureARB"); vgl->ActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glActiveTextureARB");
vgl->MultiTexCoord2fARB = (void (*)(GLenum, GLfloat, GLfloat))vlc_gl_GetProcAddress(vgl->gl, "glMultiTexCoord2fARB"); vgl->MultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)vlc_gl_GetProcAddress(vgl->gl, "glMultiTexCoord2fARB");
supports_multitexture = vgl->ActiveTextureARB && supports_multitexture = vgl->ActiveTextureARB &&
vgl->MultiTexCoord2fARB; vgl->MultiTexCoord2fARB;
......
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