From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 3 +++ dlls/opengl32/unix_private.h | 3 +++ dlls/opengl32/unix_thunks.c | 9 +++------ dlls/opengl32/unix_wgl.c | 21 +++++++++++++++++++++ 4 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index bc8eb05aaa5..d43ee4abf3e 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -200,11 +200,14 @@ my %manual_unix_thunks = "glDebugMessageCallback" => 1, "glDebugMessageCallbackAMD" => 1, "glDebugMessageCallbackARB" => 1, + "glDrawPixels" => 1, "glFinish" => 1, "glFlush" => 1, "glGetIntegerv" => 1, "glGetString" => 1, "glGetStringi" => 1, + "glReadPixels" => 1, + "glViewport" => 1, "wglGetProcAddress" => 1, "wglSwapBuffers" => 1, ); diff --git a/dlls/opengl32/unix_private.h b/dlls/opengl32/unix_private.h index 30b90545105..c15bda2c99a 100644 --- a/dlls/opengl32/unix_private.h +++ b/dlls/opengl32/unix_private.h @@ -82,6 +82,9 @@ extern PROC wrap_wglGetProcAddress( TEB *teb, LPCSTR lpszProc ); extern BOOL wrap_wglMakeCurrent( TEB *teb, HDC hDc, HGLRC newContext ); extern void wrap_glFinish( TEB *teb ); extern void wrap_glFlush( TEB *teb ); +extern void wrap_glDrawPixels( TEB *teb, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels ); +extern void wrap_glReadPixels( TEB *teb, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels ); +extern void wrap_glViewport( TEB *teb, GLint x, GLint y, GLsizei width, GLsizei height ); extern BOOL wrap_wglSwapBuffers( TEB *teb, HDC hdc ); extern BOOL wrap_wglShareLists( TEB *teb, HGLRC hrcSrvShare, HGLRC hrcSrvSource ); extern void wrap_glGetIntegerv( TEB *teb, GLenum pname, GLint *data ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index ae97dfbec47..91aaadbe9c0 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -718,8 +718,7 @@ static NTSTATUS gl_glDrawElements( void *args ) static NTSTATUS gl_glDrawPixels( void *args ) { struct glDrawPixels_params *params = args; - const struct opengl_funcs *funcs = params->teb->glTable; - funcs->p_glDrawPixels( params->width, params->height, params->format, params->type, params->pixels ); + wrap_glDrawPixels( params->teb, params->width, params->height, params->format, params->type, params->pixels ); set_context_attribute( params->teb, -1 /* unsupported */, NULL, 0 ); return STATUS_SUCCESS; } @@ -2203,8 +2202,7 @@ static NTSTATUS gl_glReadBuffer( void *args ) static NTSTATUS gl_glReadPixels( void *args ) { struct glReadPixels_params *params = args; - const struct opengl_funcs *funcs = params->teb->glTable; - funcs->p_glReadPixels( params->x, params->y, params->width, params->height, params->format, params->type, params->pixels ); + wrap_glReadPixels( params->teb, params->x, params->y, params->width, params->height, params->format, params->type, params->pixels ); set_context_attribute( params->teb, -1 /* unsupported */, NULL, 0 ); return STATUS_SUCCESS; } @@ -3085,8 +3083,7 @@ static NTSTATUS gl_glVertexPointer( void *args ) static NTSTATUS gl_glViewport( void *args ) { struct glViewport_params *params = args; - const struct opengl_funcs *funcs = params->teb->glTable; - funcs->p_glViewport( params->x, params->y, params->width, params->height ); + wrap_glViewport( params->teb, params->x, params->y, params->width, params->height ); set_context_attribute( params->teb, GL_VIEWPORT, ¶ms->x, 2 * sizeof(GLint) + 2 * sizeof(GLsizei) ); return STATUS_SUCCESS; } diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index f009c74e209..d203f4781a7 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1010,6 +1010,27 @@ void wrap_glFlush( TEB *teb ) flush_context( teb, funcs->p_glFlush ); }
+void wrap_glDrawPixels( TEB *teb, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels ) +{ + const struct opengl_funcs *funcs = teb->glTable; + flush_context( teb, NULL ); + funcs->p_glDrawPixels( width, height, format, type, pixels ); +} + +void wrap_glReadPixels( TEB *teb, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels ) +{ + const struct opengl_funcs *funcs = teb->glTable; + flush_context( teb, NULL ); + funcs->p_glReadPixels( x, y, width, height, format, type, pixels ); +} + +void wrap_glViewport( TEB *teb, GLint x, GLint y, GLsizei width, GLsizei height ) +{ + const struct opengl_funcs *funcs = teb->glTable; + flush_context( teb, NULL ); + funcs->p_glViewport( x, y, width, height ); +} + BOOL wrap_wglSwapBuffers( TEB *teb, HDC hdc ) { const struct opengl_funcs *funcs = get_dc_funcs( hdc );