wgl: Override glFinish and glFlush.

This commit is contained in:
Chris Robinson 2007-09-22 20:45:27 -07:00 committed by Alexandre Julliard
parent 4258465868
commit 665a8add92
4 changed files with 45 additions and 21 deletions

View File

@ -220,6 +220,8 @@ sub GenerateThunk($$$$$)
return "" if $func_ref->[0] eq "glDisable";
return "" if $func_ref->[0] eq "glScissor";
return "" if $func_ref->[0] eq "glViewport";
return "" if $func_ref->[0] eq "glFinish";
return "" if $func_ref->[0] eq "glFlush";
# If for opengl_norm.c, generate a nice heading otherwise Patrik won't be happy :-)
# Patrik says: Well I would be even happier if a (OPENGL32.@) was added as well. Done. :-)

View File

@ -1059,26 +1059,6 @@ void WINAPI wine_glFeedbackBuffer( GLsizei size, GLenum type, GLfloat* buffer )
LEAVE_GL();
}
/***********************************************************************
* glFinish (OPENGL32.@)
*/
void WINAPI wine_glFinish( void ) {
TRACE("()\n");
ENTER_GL();
glFinish( );
LEAVE_GL();
}
/***********************************************************************
* glFlush (OPENGL32.@)
*/
void WINAPI wine_glFlush( void ) {
TRACE("()\n");
ENTER_GL();
glFlush( );
LEAVE_GL();
}
/***********************************************************************
* glFogf (OPENGL32.@)
*/

View File

@ -54,6 +54,8 @@ typedef struct wine_wgl_s {
GLboolean WINAPI (*p_wglIsEnabled)(GLenum cap);
void WINAPI (*p_wglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
void WINAPI (*p_wglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
void WINAPI (*p_wglFinish)(void);
void WINAPI (*p_wglFlush)(void);
} wine_wgl_t;
/** global wgl object */
@ -613,6 +615,24 @@ void WINAPI wine_glViewport( GLint x, GLint y, GLsizei width, GLsizei height )
wine_wgl.p_wglViewport(x, y, width, height);
}
/***********************************************************************
* glFinish (OPENGL32.@)
*/
void WINAPI wine_glFinish( void )
{
TRACE("()\n");
wine_wgl.p_wglFinish();
}
/***********************************************************************
* glFlush (OPENGL32.@)
*/
void WINAPI wine_glFlush( void )
{
TRACE("()\n");
wine_wgl.p_wglFlush();
}
/***********************************************************************
* glGetString (OPENGL32.@)
*/
@ -705,6 +725,8 @@ static BOOL process_attach(void)
wine_wgl.p_wglIsEnabled = (void *)wine_wgl.p_wglGetProcAddress("wglIsEnabled");
wine_wgl.p_wglScissor = (void *)wine_wgl.p_wglGetProcAddress("wglScissor");
wine_wgl.p_wglViewport = (void *)wine_wgl.p_wglGetProcAddress("wglViewport");
wine_wgl.p_wglFinish = (void *)wine_wgl.p_wglGetProcAddress("wglFinish");
wine_wgl.p_wglFlush = (void *)wine_wgl.p_wglGetProcAddress("wglFlush");
internal_gl_disabled_extensions[0] = 0;
if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\OpenGL", &hkey)) {

View File

@ -72,7 +72,7 @@ typedef struct wine_glextension {
struct {
const char *funcName;
void *funcAddress;
} extEntryPoints[8];
} extEntryPoints[9];
} WineGLExtension;
struct WineGLInfo {
@ -277,6 +277,8 @@ MAKE_FUNCPTR(glReadPixels)
MAKE_FUNCPTR(glScissor)
MAKE_FUNCPTR(glTexImage2D)
MAKE_FUNCPTR(glViewport)
MAKE_FUNCPTR(glFinish)
MAKE_FUNCPTR(glFlush)
#undef MAKE_FUNCPTR
static BOOL X11DRV_WineGL_InitOpenglInfo(void)
@ -428,6 +430,8 @@ LOAD_FUNCPTR(glReadPixels)
LOAD_FUNCPTR(glScissor)
LOAD_FUNCPTR(glTexImage2D)
LOAD_FUNCPTR(glViewport)
LOAD_FUNCPTR(glFinish)
LOAD_FUNCPTR(glFlush)
#undef LOAD_FUNCPTR
/* It doesn't matter if these fail. They'll only be used if the driver reports
@ -2054,6 +2058,20 @@ static void WINAPI X11DRV_wglViewport(GLint x, GLint y, GLsizei width, GLsizei h
}
}
static void WINAPI X11DRV_wglFinish(void)
{
wine_tsx11_lock();
pglFinish();
wine_tsx11_unlock();
}
static void WINAPI X11DRV_wglFlush(void)
{
wine_tsx11_lock();
pglFlush();
wine_tsx11_unlock();
}
/**
* X11DRV_wglGetExtensionsStringARB
*
@ -3093,6 +3111,8 @@ static const WineGLExtension WGL_internal_functions =
{ "wglIsEnabled", X11DRV_wglIsEnabled },
{ "wglScissor", X11DRV_wglScissor },
{ "wglViewport", X11DRV_wglViewport },
{ "wglFinish", X11DRV_wglFinish },
{ "wglFlush", X11DRV_wglFlush },
}
};