Module: wine Branch: master Commit: 665a8add929d45c5a7d5de4023ea197f04acff9c URL: http://source.winehq.org/git/wine.git/?a=commit;h=665a8add929d45c5a7d5de4023...
Author: Chris Robinson chris.kcat@gmail.com Date: Sat Sep 22 20:45:27 2007 -0700
wgl: Override glFinish and glFlush.
---
dlls/opengl32/make_opengl | 2 ++ dlls/opengl32/opengl_norm.c | 20 -------------------- dlls/opengl32/wgl.c | 22 ++++++++++++++++++++++ dlls/winex11.drv/opengl.c | 22 +++++++++++++++++++++- 4 files changed, 45 insertions(+), 21 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 381b1a9..b14b5cf 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -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. :-) diff --git a/dlls/opengl32/opengl_norm.c b/dlls/opengl32/opengl_norm.c index 6534301..69acc85 100644 --- a/dlls/opengl32/opengl_norm.c +++ b/dlls/opengl32/opengl_norm.c @@ -1060,26 +1060,6 @@ void WINAPI wine_glFeedbackBuffer( GLsizei size, GLenum type, GLfloat* buffer ) }
/*********************************************************************** - * 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.@) */ void WINAPI wine_glFogf( GLenum pname, GLfloat param ) { diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 029f361..deac8db 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -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 */ @@ -614,6 +616,24 @@ void WINAPI wine_glViewport( GLint x, GLint y, GLsizei width, GLsizei 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.@) */ const GLubyte * WINAPI wine_glGetString( GLenum name ) @@ -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)) { diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 091aee5..b867abd 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -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 }, } };