From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/make_opengl | 31 ++++++++++++----------- include/wine/opengl_driver.h | 48 ++++++------------------------------ include/wine/wgl.h | 36 ++++++++++++++------------- 3 files changed, 43 insertions(+), 72 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index edb0c317292..1754ea4e971 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -416,13 +416,13 @@ sub get_func_trace($$$) sub get_func_args($$) { - my ($func, $convert_args) = @_; + my ($func, $unix) = @_; my $ret = ""; foreach my $arg (@{$func->[1]}) { my $ptype = get_arg_type( $arg ); my $pname = get_arg_name( $arg ); - $ret .= " " . ($convert_args ? ConvertType( $arg ) : $arg->textContent()) . ","; + $ret .= " " . ($unix ? ConvertType( $arg ) : $arg->textContent()) . ","; } $ret =~ s/,$/ /; $ret ||= "void"; @@ -431,8 +431,8 @@ sub get_func_args($$) sub get_func_ret($$) { - my ($func, $convert_args) = @_; - my $ret = $convert_args ? ConvertType( $func->[0] ) : $func->[0]->textContent(); + my ($func, $unix) = @_; + my $ret = $unix ? ConvertType( $func->[0] ) : $func->[0]->textContent(); $ret =~ s/ $//; return $ret; } @@ -1161,6 +1161,9 @@ print HEADER "#ifndef EGL_CAST\n"; print HEADER "#define EGL_CAST(t,x) ((t)(x))\n"; print HEADER "#endif\n\n"; +print HEADER "struct wgl_context;\n"; +print HEADER "struct wgl_pbuffer;\n"; + foreach (@gl_types) { my $type = $gl_types{$_}; @@ -1180,37 +1183,37 @@ print HEADER "\n"; print HEADER "#ifndef GL_NO_PROTOTYPES\n"; foreach (sort keys %norm_functions) { - my $decl_args = get_func_args( $norm_functions{$_}, 0 ); - my $func_ret = get_func_ret( $norm_functions{$_}, 0 ); + my $decl_args = get_func_args( $norm_functions{$_}, 1 ); + my $func_ret = get_func_ret( $norm_functions{$_}, 1 ); printf HEADER "%-10s GLAPIENTRY $_($decl_args);\n", $func_ret; } print HEADER "#endif\n\n"; foreach (sort keys %wgl_functions) { - my $decl_args = get_func_args( $wgl_functions{$_}, 0 ); - my $func_ret = get_func_ret( $wgl_functions{$_}, 0 ); + my $decl_args = get_func_args( $wgl_functions{$_}, 1 ); + my $func_ret = get_func_ret( $wgl_functions{$_}, 1 ); printf HEADER "typedef %-10s (GLAPIENTRY *PFN_$_)($decl_args);\n", $func_ret; } foreach (sort keys %egl_functions) { - my $decl_args = get_func_args( $egl_functions{$_}, 0 ); - my $func_ret = get_func_ret( $egl_functions{$_}, 0 ); + my $decl_args = get_func_args( $egl_functions{$_}, 1 ); + my $func_ret = get_func_ret( $egl_functions{$_}, 1 ); printf HEADER "typedef %-10s (GLAPIENTRY *PFN_$_)($decl_args);\n", $func_ret; } foreach (sort keys %norm_functions) { - my $decl_args = get_func_args( $norm_functions{$_}, 0 ); - my $func_ret = get_func_ret( $norm_functions{$_}, 0 ); + my $decl_args = get_func_args( $norm_functions{$_}, 1 ); + my $func_ret = get_func_ret( $norm_functions{$_}, 1 ); printf HEADER "typedef %-10s (GLAPIENTRY *PFN_$_)($decl_args);\n", $func_ret; } foreach (sort keys %ext_functions) { - my $decl_args = get_func_args( $ext_functions{$_}, 0 ); - my $func_ret = get_func_ret( $ext_functions{$_}, 0 ); + my $decl_args = get_func_args( $ext_functions{$_}, 1 ); + my $func_ret = get_func_ret( $ext_functions{$_}, 1 ); printf HEADER "typedef %-10s (GLAPIENTRY *PFN_$_)($decl_args);\n", $func_ret; } print HEADER "\n"; diff --git a/include/wine/opengl_driver.h b/include/wine/opengl_driver.h index 7ec2110fd35..d9f4da04953 100644 --- a/include/wine/opengl_driver.h +++ b/include/wine/opengl_driver.h @@ -67,8 +67,6 @@ struct wgl_pixel_format #define WINE_OPENGL_DRIVER_VERSION 37 struct opengl_drawable; -struct wgl_context; -struct wgl_pbuffer; struct wgl_context { @@ -83,52 +81,20 @@ struct wgl_context /* interface between opengl32 and win32u */ struct opengl_funcs { - BOOL (*p_query_renderer)( UINT attribute, void *value ); - BOOL (*p_wgl_context_reset)( struct wgl_context *context, HDC hdc, struct wgl_context *share, const int *attribs ); - BOOL (*p_wgl_context_flush)( struct wgl_context *context, void (*flush)(void), UINT flags ); - BOOL (*p_wglCopyContext)( struct wgl_context * hglrcSrc, struct wgl_context * hglrcDst, UINT mask ); - struct wgl_context * (*p_wglCreateContext)( HDC hDc ); - BOOL (*p_wglDeleteContext)( struct wgl_context * oldContext ); - int (*p_wglGetPixelFormat)( HDC hdc ); - PROC (*p_wglGetProcAddress)( LPCSTR lpszProc ); - BOOL (*p_wglMakeCurrent)( HDC hDc, struct wgl_context * newContext ); - BOOL (*p_wglSetPixelFormat)( HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR *ppfd ); - BOOL (*p_wglShareLists)( struct wgl_context * hrcSrvShare, struct wgl_context * hrcSrvSource ); - BOOL (*p_wglSwapBuffers)( HDC hdc ); - void (*p_get_pixel_formats)( struct wgl_pixel_format *formats, UINT max_formats, UINT *num_formats, UINT *num_onscreen_formats ); - void * (*p_wglAllocateMemoryNV)( GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority ); - BOOL (*p_wglBindTexImageARB)( struct wgl_pbuffer * hPbuffer, int iBuffer ); - BOOL (*p_wglChoosePixelFormatARB)( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); - struct wgl_context * (*p_wglCreateContextAttribsARB)( HDC hDC, struct wgl_context * hShareContext, const int *attribList ); - struct wgl_pbuffer * (*p_wglCreatePbufferARB)( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ); - BOOL (*p_wglDestroyPbufferARB)( struct wgl_pbuffer * hPbuffer ); - void (*p_wglFreeMemoryNV)( void *pointer ); - HDC (*p_wglGetCurrentReadDCARB)(void); - const char * (*p_wglGetExtensionsStringARB)( HDC hdc ); - const char * (*p_wglGetExtensionsStringEXT)(void); - HDC (*p_wglGetPbufferDCARB)( struct wgl_pbuffer * hPbuffer ); - BOOL (*p_wglGetPixelFormatAttribfvARB)( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues ); - BOOL (*p_wglGetPixelFormatAttribivARB)( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues ); - int (*p_wglGetSwapIntervalEXT)(void); - BOOL (*p_wglMakeContextCurrentARB)( HDC hDrawDC, HDC hReadDC, struct wgl_context * hglrc ); - BOOL (*p_wglQueryCurrentRendererIntegerWINE)( GLenum attribute, GLuint *value ); - const GLchar * (*p_wglQueryCurrentRendererStringWINE)( GLenum attribute ); - BOOL (*p_wglQueryPbufferARB)( struct wgl_pbuffer * hPbuffer, int iAttribute, int *piValue ); - BOOL (*p_wglQueryRendererIntegerWINE)( HDC dc, GLint renderer, GLenum attribute, GLuint *value ); - const GLchar * (*p_wglQueryRendererStringWINE)( HDC dc, GLint renderer, GLenum attribute ); - int (*p_wglReleasePbufferDCARB)( struct wgl_pbuffer * hPbuffer, HDC hDC ); - BOOL (*p_wglReleaseTexImageARB)( struct wgl_pbuffer * hPbuffer, int iBuffer ); - BOOL (*p_wglSetPbufferAttribARB)( struct wgl_pbuffer * hPbuffer, const int *piAttribList ); - BOOL (*p_wglSetPixelFormatWINE)( HDC hdc, int format ); - BOOL (*p_wglSwapIntervalEXT)( int interval ); #define USE_GL_FUNC(x) PFN_##x p_##x; + ALL_WGL_FUNCS + ALL_WGL_EXT_FUNCS ALL_EGL_FUNCS ALL_EGL_EXT_FUNCS ALL_GL_FUNCS ALL_GL_EXT_FUNCS #undef USE_GL_FUNC + void (*p_get_pixel_formats)( struct wgl_pixel_format *formats, UINT max_formats, UINT *num_formats, UINT *num_onscreen_formats ); + BOOL (*p_query_renderer)( UINT attribute, void *value ); + BOOL (*p_wgl_context_flush)( struct wgl_context *context, void (*flush)(void), UINT flags ); + BOOL (*p_wgl_context_reset)( struct wgl_context *context, HDC hdc, struct wgl_context *share, const int *attribs ); - void *egl_handle; + void *egl_handle; }; struct egl_platform diff --git a/include/wine/wgl.h b/include/wine/wgl.h index c9fbfdef254..a611ed25cff 100644 --- a/include/wine/wgl.h +++ b/include/wine/wgl.h @@ -24,6 +24,8 @@ #define EGL_CAST(t,x) ((t)(x)) #endif +struct wgl_context; +struct wgl_pbuffer; typedef void *EGLNativeDisplayType; typedef void *EGLNativePixmapType; typedef void *EGLNativeWindowType; @@ -6283,23 +6285,23 @@ void GLAPIENTRY glViewport( GLint x, GLint y, GLsizei width, GLsizei heigh #endif typedef int (GLAPIENTRY *PFN_wglChoosePixelFormat)( HDC hDc, const PIXELFORMATDESCRIPTOR *pPfd ); -typedef BOOL (GLAPIENTRY *PFN_wglCopyContext)( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ); -typedef HGLRC (GLAPIENTRY *PFN_wglCreateContext)( HDC hDc ); -typedef HGLRC (GLAPIENTRY *PFN_wglCreateLayerContext)( HDC hDc, int level ); -typedef BOOL (GLAPIENTRY *PFN_wglDeleteContext)( HGLRC oldContext ); +typedef BOOL (GLAPIENTRY *PFN_wglCopyContext)( struct wgl_context * hglrcSrc, struct wgl_context * hglrcDst, UINT mask ); +typedef struct wgl_context * (GLAPIENTRY *PFN_wglCreateContext)( HDC hDc ); +typedef struct wgl_context * (GLAPIENTRY *PFN_wglCreateLayerContext)( HDC hDc, int level ); +typedef BOOL (GLAPIENTRY *PFN_wglDeleteContext)( struct wgl_context * oldContext ); typedef BOOL (GLAPIENTRY *PFN_wglDescribeLayerPlane)( HDC hDc, int pixelFormat, int layerPlane, UINT nBytes, LAYERPLANEDESCRIPTOR *plpd ); typedef int (GLAPIENTRY *PFN_wglDescribePixelFormat)( HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDESCRIPTOR *ppfd ); -typedef HGLRC (GLAPIENTRY *PFN_wglGetCurrentContext)(void); +typedef struct wgl_context * (GLAPIENTRY *PFN_wglGetCurrentContext)(void); typedef HDC (GLAPIENTRY *PFN_wglGetCurrentDC)(void); typedef PROC (GLAPIENTRY *PFN_wglGetDefaultProcAddress)( LPCSTR lpszProc ); typedef int (GLAPIENTRY *PFN_wglGetLayerPaletteEntries)( HDC hdc, int iLayerPlane, int iStart, int cEntries, COLORREF *pcr ); typedef int (GLAPIENTRY *PFN_wglGetPixelFormat)( HDC hdc ); typedef PROC (GLAPIENTRY *PFN_wglGetProcAddress)( LPCSTR lpszProc ); -typedef BOOL (GLAPIENTRY *PFN_wglMakeCurrent)( HDC hDc, HGLRC newContext ); +typedef BOOL (GLAPIENTRY *PFN_wglMakeCurrent)( HDC hDc, struct wgl_context * newContext ); typedef BOOL (GLAPIENTRY *PFN_wglRealizeLayerPalette)( HDC hdc, int iLayerPlane, BOOL bRealize ); typedef int (GLAPIENTRY *PFN_wglSetLayerPaletteEntries)( HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF *pcr ); typedef BOOL (GLAPIENTRY *PFN_wglSetPixelFormat)( HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR *ppfd ); -typedef BOOL (GLAPIENTRY *PFN_wglShareLists)( HGLRC hrcSrvShare, HGLRC hrcSrvSource ); +typedef BOOL (GLAPIENTRY *PFN_wglShareLists)( struct wgl_context * hrcSrvShare, struct wgl_context * hrcSrvSource ); typedef BOOL (GLAPIENTRY *PFN_wglSwapBuffers)( HDC hdc ); typedef BOOL (GLAPIENTRY *PFN_wglSwapLayerBuffers)( HDC hdc, UINT fuFlags ); typedef BOOL (GLAPIENTRY *PFN_wglUseFontBitmapsA)( HDC hDC, DWORD first, DWORD count, DWORD listBase ); @@ -9516,28 +9518,28 @@ typedef void (GLAPIENTRY *PFN_glWindowPos4svMESA)( const GLshort *v ); typedef void (GLAPIENTRY *PFN_glWindowRectanglesEXT)( GLenum mode, GLsizei count, const GLint *box ); typedef void (GLAPIENTRY *PFN_glWriteMaskEXT)( GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW ); typedef void * (GLAPIENTRY *PFN_wglAllocateMemoryNV)( GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority ); -typedef BOOL (GLAPIENTRY *PFN_wglBindTexImageARB)( HPBUFFERARB hPbuffer, int iBuffer ); +typedef BOOL (GLAPIENTRY *PFN_wglBindTexImageARB)( struct wgl_pbuffer * hPbuffer, int iBuffer ); typedef BOOL (GLAPIENTRY *PFN_wglChoosePixelFormatARB)( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); -typedef HGLRC (GLAPIENTRY *PFN_wglCreateContextAttribsARB)( HDC hDC, HGLRC hShareContext, const int *attribList ); -typedef HPBUFFERARB (GLAPIENTRY *PFN_wglCreatePbufferARB)( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ); -typedef BOOL (GLAPIENTRY *PFN_wglDestroyPbufferARB)( HPBUFFERARB hPbuffer ); +typedef struct wgl_context * (GLAPIENTRY *PFN_wglCreateContextAttribsARB)( HDC hDC, struct wgl_context * hShareContext, const int *attribList ); +typedef struct wgl_pbuffer * (GLAPIENTRY *PFN_wglCreatePbufferARB)( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ); +typedef BOOL (GLAPIENTRY *PFN_wglDestroyPbufferARB)( struct wgl_pbuffer * hPbuffer ); typedef void (GLAPIENTRY *PFN_wglFreeMemoryNV)( void *pointer ); typedef HDC (GLAPIENTRY *PFN_wglGetCurrentReadDCARB)(void); typedef const char * (GLAPIENTRY *PFN_wglGetExtensionsStringARB)( HDC hdc ); typedef const char * (GLAPIENTRY *PFN_wglGetExtensionsStringEXT)(void); -typedef HDC (GLAPIENTRY *PFN_wglGetPbufferDCARB)( HPBUFFERARB hPbuffer ); +typedef HDC (GLAPIENTRY *PFN_wglGetPbufferDCARB)( struct wgl_pbuffer * hPbuffer ); typedef BOOL (GLAPIENTRY *PFN_wglGetPixelFormatAttribfvARB)( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues ); typedef BOOL (GLAPIENTRY *PFN_wglGetPixelFormatAttribivARB)( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues ); typedef int (GLAPIENTRY *PFN_wglGetSwapIntervalEXT)(void); -typedef BOOL (GLAPIENTRY *PFN_wglMakeContextCurrentARB)( HDC hDrawDC, HDC hReadDC, HGLRC hglrc ); +typedef BOOL (GLAPIENTRY *PFN_wglMakeContextCurrentARB)( HDC hDrawDC, HDC hReadDC, struct wgl_context * hglrc ); typedef BOOL (GLAPIENTRY *PFN_wglQueryCurrentRendererIntegerWINE)( GLenum attribute, GLuint *value ); typedef const GLchar * (GLAPIENTRY *PFN_wglQueryCurrentRendererStringWINE)( GLenum attribute ); -typedef BOOL (GLAPIENTRY *PFN_wglQueryPbufferARB)( HPBUFFERARB hPbuffer, int iAttribute, int *piValue ); +typedef BOOL (GLAPIENTRY *PFN_wglQueryPbufferARB)( struct wgl_pbuffer * hPbuffer, int iAttribute, int *piValue ); typedef BOOL (GLAPIENTRY *PFN_wglQueryRendererIntegerWINE)( HDC dc, GLint renderer, GLenum attribute, GLuint *value ); typedef const GLchar * (GLAPIENTRY *PFN_wglQueryRendererStringWINE)( HDC dc, GLint renderer, GLenum attribute ); -typedef int (GLAPIENTRY *PFN_wglReleasePbufferDCARB)( HPBUFFERARB hPbuffer, HDC hDC ); -typedef BOOL (GLAPIENTRY *PFN_wglReleaseTexImageARB)( HPBUFFERARB hPbuffer, int iBuffer ); -typedef BOOL (GLAPIENTRY *PFN_wglSetPbufferAttribARB)( HPBUFFERARB hPbuffer, const int *piAttribList ); +typedef int (GLAPIENTRY *PFN_wglReleasePbufferDCARB)( struct wgl_pbuffer * hPbuffer, HDC hDC ); +typedef BOOL (GLAPIENTRY *PFN_wglReleaseTexImageARB)( struct wgl_pbuffer * hPbuffer, int iBuffer ); +typedef BOOL (GLAPIENTRY *PFN_wglSetPbufferAttribARB)( struct wgl_pbuffer * hPbuffer, const int *piAttribList ); typedef BOOL (GLAPIENTRY *PFN_wglSetPixelFormatWINE)( HDC hdc, int format ); typedef BOOL (GLAPIENTRY *PFN_wglSwapIntervalEXT)( int interval ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9953