Commit 6a3aa4eb authored by Alexandre Julliard's avatar Alexandre Julliard

opengl32: Use proper handles for PBuffers instead of raw pointers.

parent 98bd066c
...@@ -205,8 +205,8 @@ sub ConvertType($) ...@@ -205,8 +205,8 @@ sub ConvertType($)
"HGLRC" => "struct wgl_context *", "HGLRC" => "struct wgl_context *",
"GLDEBUGPROCARB" => "void *", "GLDEBUGPROCARB" => "void *",
"GLDEBUGPROCAMD" => "void *", "GLDEBUGPROCAMD" => "void *",
"HPBUFFERARB" => "HANDLE", "HPBUFFERARB" => "struct wgl_pbuffer *",
"HPBUFFEREXT" => "HANDLE", "HPBUFFEREXT" => "struct wgl_pbuffer *",
); );
foreach my $org (reverse sort keys %hash) { foreach my $org (reverse sort keys %hash) {
...@@ -777,7 +777,8 @@ print HEADER "#endif\n\n"; ...@@ -777,7 +777,8 @@ print HEADER "#endif\n\n";
printf HEADER "#define WINE_WGL_DRIVER_VERSION %u\n\n", $wgl_version + 1; printf HEADER "#define WINE_WGL_DRIVER_VERSION %u\n\n", $wgl_version + 1;
print HEADER "struct wgl_context;\n\n"; print HEADER "struct wgl_context;\n";
print HEADER "struct wgl_pbuffer;\n\n";
print HEADER "struct opengl_funcs\n{\n"; print HEADER "struct opengl_funcs\n{\n";
print HEADER " struct\n {\n"; print HEADER " struct\n {\n";
......
...@@ -208,7 +208,7 @@ static void test_pbuffers(HDC hdc) ...@@ -208,7 +208,7 @@ static void test_pbuffers(HDC hdc)
trace("iPixelFormat returned by GetPixelFormat: %d\n", res); trace("iPixelFormat returned by GetPixelFormat: %d\n", res);
trace("PixelFormat from wglChoosePixelFormatARB: %d\n", iPixelFormat); trace("PixelFormat from wglChoosePixelFormatARB: %d\n", iPixelFormat);
pwglReleasePbufferDCARB(pbuffer, hdc); pwglReleasePbufferDCARB(pbuffer, pbuffer_hdc);
} }
else skip("Pbuffer test for onscreen pixelformat skipped as no onscreen format with pbuffer capabilities have been found\n"); else skip("Pbuffer test for onscreen pixelformat skipped as no onscreen format with pbuffer capabilities have been found\n");
......
...@@ -81,6 +81,7 @@ extern BOOL WINAPI GdiSwapBuffers( HDC hdc ); ...@@ -81,6 +81,7 @@ extern BOOL WINAPI GdiSwapBuffers( HDC hdc );
enum wgl_handle_type enum wgl_handle_type
{ {
HANDLE_CONTEXT = 0 << 12, HANDLE_CONTEXT = 0 << 12,
HANDLE_PBUFFER = 1 << 12,
HANDLE_TYPE_MASK = 15 << 12 HANDLE_TYPE_MASK = 15 << 12
}; };
...@@ -92,6 +93,7 @@ struct wgl_handle ...@@ -92,6 +93,7 @@ struct wgl_handle
union union
{ {
struct wgl_context *context; /* for HANDLE_CONTEXT */ struct wgl_context *context; /* for HANDLE_CONTEXT */
struct wgl_pbuffer *pbuffer; /* for HANDLE_PBUFFER */
struct wgl_handle *next; /* for free handles */ struct wgl_handle *next; /* for free handles */
} u; } u;
}; };
...@@ -849,11 +851,13 @@ void WINAPI wglFreeMemoryNV( void *pointer ) ...@@ -849,11 +851,13 @@ void WINAPI wglFreeMemoryNV( void *pointer )
*/ */
BOOL WINAPI wglBindTexImageARB( HPBUFFERARB handle, int buffer ) BOOL WINAPI wglBindTexImageARB( HPBUFFERARB handle, int buffer )
{ {
/* FIXME: get functions from pbuffer handle */ struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; BOOL ret;
if (!funcs->ext.p_wglBindTexImageARB) return FALSE; if (!ptr) return FALSE;
return funcs->ext.p_wglBindTexImageARB( handle, buffer ); ret = ptr->funcs->ext.p_wglBindTexImageARB( ptr->u.pbuffer, buffer );
release_handle_ptr( ptr );
return ret;
} }
/*********************************************************************** /***********************************************************************
...@@ -863,11 +867,13 @@ BOOL WINAPI wglBindTexImageARB( HPBUFFERARB handle, int buffer ) ...@@ -863,11 +867,13 @@ BOOL WINAPI wglBindTexImageARB( HPBUFFERARB handle, int buffer )
*/ */
BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB handle, int buffer ) BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB handle, int buffer )
{ {
/* FIXME: get functions from pbuffer handle */ struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; BOOL ret;
if (!funcs->ext.p_wglReleaseTexImageARB) return FALSE; if (!ptr) return FALSE;
return funcs->ext.p_wglReleaseTexImageARB( handle, buffer ); ret = ptr->funcs->ext.p_wglReleaseTexImageARB( ptr->u.pbuffer, buffer );
release_handle_ptr( ptr );
return ret;
} }
/*********************************************************************** /***********************************************************************
...@@ -877,11 +883,13 @@ BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB handle, int buffer ) ...@@ -877,11 +883,13 @@ BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB handle, int buffer )
*/ */
BOOL WINAPI wglSetPbufferAttribARB( HPBUFFERARB handle, const int *attribs ) BOOL WINAPI wglSetPbufferAttribARB( HPBUFFERARB handle, const int *attribs )
{ {
/* FIXME: get functions from pbuffer handle */ struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; BOOL ret;
if (!funcs->ext.p_wglSetPbufferAttribARB) return FALSE; if (!ptr) return FALSE;
return funcs->ext.p_wglSetPbufferAttribARB( handle, attribs ); ret = ptr->funcs->ext.p_wglSetPbufferAttribARB( ptr->u.pbuffer, attribs );
release_handle_ptr( ptr );
return ret;
} }
/*********************************************************************** /***********************************************************************
...@@ -933,10 +941,15 @@ BOOL WINAPI wglGetPixelFormatAttribfvARB( HDC hdc, int format, int layer, UINT c ...@@ -933,10 +941,15 @@ BOOL WINAPI wglGetPixelFormatAttribfvARB( HDC hdc, int format, int layer, UINT c
*/ */
HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hdc, int format, int width, int height, const int *attribs ) HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hdc, int format, int width, int height, const int *attribs )
{ {
const struct opengl_funcs *funcs = get_dc_funcs( hdc ); HPBUFFERARB ret = 0;
struct wgl_pbuffer *pbuffer;
struct opengl_funcs *funcs = get_dc_funcs( hdc );
if (!funcs || !funcs->ext.p_wglCreatePbufferARB) return 0; if (!funcs || !funcs->ext.p_wglCreatePbufferARB) return 0;
return funcs->ext.p_wglCreatePbufferARB( hdc, format, width, height, attribs ); if (!(pbuffer = funcs->ext.p_wglCreatePbufferARB( hdc, format, width, height, attribs ))) return 0;
ret = alloc_handle( HANDLE_PBUFFER, funcs, pbuffer );
if (!ret) funcs->ext.p_wglDestroyPbufferARB( pbuffer );
return ret;
} }
/*********************************************************************** /***********************************************************************
...@@ -946,11 +959,13 @@ HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hdc, int format, int width, int heig ...@@ -946,11 +959,13 @@ HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hdc, int format, int width, int heig
*/ */
HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB handle ) HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB handle )
{ {
/* FIXME: get functions from pbuffer handle */ struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; HDC ret;
if (!funcs->ext.p_wglGetPbufferDCARB) return 0; if (!ptr) return 0;
return funcs->ext.p_wglGetPbufferDCARB( handle ); ret = ptr->funcs->ext.p_wglGetPbufferDCARB( ptr->u.pbuffer );
release_handle_ptr( ptr );
return ret;
} }
/*********************************************************************** /***********************************************************************
...@@ -960,11 +975,13 @@ HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB handle ) ...@@ -960,11 +975,13 @@ HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB handle )
*/ */
int WINAPI wglReleasePbufferDCARB( HPBUFFERARB handle, HDC hdc ) int WINAPI wglReleasePbufferDCARB( HPBUFFERARB handle, HDC hdc )
{ {
/* FIXME: get functions from pbuffer handle */ struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
const struct opengl_funcs *funcs = get_dc_funcs( hdc ); BOOL ret;
if (!funcs || !funcs->ext.p_wglReleasePbufferDCARB) return 0; if (!ptr) return FALSE;
return funcs->ext.p_wglReleasePbufferDCARB( handle, hdc ); ret = ptr->funcs->ext.p_wglReleasePbufferDCARB( ptr->u.pbuffer, hdc );
release_handle_ptr( ptr );
return ret;
} }
/*********************************************************************** /***********************************************************************
...@@ -974,11 +991,12 @@ int WINAPI wglReleasePbufferDCARB( HPBUFFERARB handle, HDC hdc ) ...@@ -974,11 +991,12 @@ int WINAPI wglReleasePbufferDCARB( HPBUFFERARB handle, HDC hdc )
*/ */
BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB handle ) BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB handle )
{ {
/* FIXME: get functions from pbuffer handle */ struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
if (!funcs->ext.p_wglDestroyPbufferARB) return FALSE; if (!ptr) return FALSE;
return funcs->ext.p_wglDestroyPbufferARB( handle ); ptr->funcs->ext.p_wglDestroyPbufferARB( ptr->u.pbuffer );
free_handle_ptr( ptr );
return TRUE;
} }
/*********************************************************************** /***********************************************************************
...@@ -988,11 +1006,13 @@ BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB handle ) ...@@ -988,11 +1006,13 @@ BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB handle )
*/ */
BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB handle, int attrib, int *value ) BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB handle, int attrib, int *value )
{ {
/* FIXME: get functions from pbuffer handle */ struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; BOOL ret;
if (!funcs->ext.p_wglQueryPbufferARB) return FALSE; if (!ptr) return FALSE;
return funcs->ext.p_wglQueryPbufferARB( handle, attrib, value ); ret = ptr->funcs->ext.p_wglQueryPbufferARB( ptr->u.pbuffer, attrib, value );
release_handle_ptr( ptr );
return ret;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -160,7 +160,8 @@ struct wgl_context ...@@ -160,7 +160,8 @@ struct wgl_context
struct list entry; struct list entry;
}; };
typedef struct wine_glpbuffer { struct wgl_pbuffer
{
Drawable drawable; Drawable drawable;
Display* display; Display* display;
WineGLPixelFormat* fmt; WineGLPixelFormat* fmt;
...@@ -177,7 +178,7 @@ typedef struct wine_glpbuffer { ...@@ -177,7 +178,7 @@ typedef struct wine_glpbuffer {
GLenum texture_type; GLenum texture_type;
GLuint texture; GLuint texture;
int texture_level; int texture_level;
} Wine_GLPBuffer; };
struct glx_physdev struct glx_physdev
{ {
...@@ -647,7 +648,7 @@ static int describeContext( struct wgl_context *ctx ) { ...@@ -647,7 +648,7 @@ static int describeContext( struct wgl_context *ctx ) {
return ctx_vis_id; return ctx_vis_id;
} }
static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuffer* pbuf) { static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_pbuffer* pbuf) {
int nAttribs = 0; int nAttribs = 0;
unsigned cur = 0; unsigned cur = 0;
int pop; int pop;
...@@ -1956,10 +1957,10 @@ static const GLubyte *X11DRV_wglGetExtensionsStringARB(HDC hdc) ...@@ -1956,10 +1957,10 @@ static const GLubyte *X11DRV_wglGetExtensionsStringARB(HDC hdc)
* *
* WGL_ARB_pbuffer: wglCreatePbufferARB * WGL_ARB_pbuffer: wglCreatePbufferARB
*/ */
static HANDLE X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat, int iWidth, int iHeight, static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat, int iWidth, int iHeight,
const int *piAttribList ) const int *piAttribList )
{ {
Wine_GLPBuffer* object = NULL; struct wgl_pbuffer* object = NULL;
WineGLPixelFormat *fmt = NULL; WineGLPixelFormat *fmt = NULL;
int nCfgs = 0; int nCfgs = 0;
int attribs[256]; int attribs[256];
...@@ -1978,13 +1979,13 @@ static HANDLE X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat, int iWidth, ...@@ -1978,13 +1979,13 @@ static HANDLE X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat, int iWidth,
if(!fmt) { if(!fmt) {
ERR("(%p): unexpected iPixelFormat(%d) > nFormats(%d), returns NULL\n", hdc, iPixelFormat, nCfgs); ERR("(%p): unexpected iPixelFormat(%d) > nFormats(%d), returns NULL\n", hdc, iPixelFormat, nCfgs);
SetLastError(ERROR_INVALID_PIXEL_FORMAT); SetLastError(ERROR_INVALID_PIXEL_FORMAT);
goto create_failed; /* unexpected error */ return NULL;
} }
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(Wine_GLPBuffer)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (NULL == object) { if (NULL == object) {
SetLastError(ERROR_NO_SYSTEM_RESOURCES); SetLastError(ERROR_NO_SYSTEM_RESOURCES);
goto create_failed; /* unexpected error */ return NULL;
} }
object->hdc = hdc; object->hdc = hdc;
object->display = gdi_display; object->display = gdi_display;
...@@ -2137,7 +2138,7 @@ static HANDLE X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat, int iWidth, ...@@ -2137,7 +2138,7 @@ static HANDLE X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat, int iWidth,
goto create_failed; /* unexpected error */ goto create_failed; /* unexpected error */
} }
TRACE("->(%p)\n", object); TRACE("->(%p)\n", object);
return (HPBUFFERARB)object; return object;
create_failed: create_failed:
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
...@@ -2150,14 +2151,10 @@ create_failed: ...@@ -2150,14 +2151,10 @@ create_failed:
* *
* WGL_ARB_pbuffer: wglDestroyPbufferARB * WGL_ARB_pbuffer: wglDestroyPbufferARB
*/ */
static BOOL X11DRV_wglDestroyPbufferARB(HANDLE hPbuffer) static BOOL X11DRV_wglDestroyPbufferARB( struct wgl_pbuffer *object )
{ {
Wine_GLPBuffer* object = (Wine_GLPBuffer *)hPbuffer; TRACE("(%p)\n", object);
TRACE("(%p)\n", hPbuffer);
if (NULL == object) {
SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
wine_tsx11_lock(); wine_tsx11_lock();
pglXDestroyPbuffer(object->display, object->drawable); pglXDestroyPbuffer(object->display, object->drawable);
wine_tsx11_unlock(); wine_tsx11_unlock();
...@@ -2170,17 +2167,11 @@ static BOOL X11DRV_wglDestroyPbufferARB(HANDLE hPbuffer) ...@@ -2170,17 +2167,11 @@ static BOOL X11DRV_wglDestroyPbufferARB(HANDLE hPbuffer)
* *
* WGL_ARB_pbuffer: wglGetPbufferDCARB * WGL_ARB_pbuffer: wglGetPbufferDCARB
*/ */
static HDC X11DRV_wglGetPbufferDCARB(HANDLE hPbuffer) static HDC X11DRV_wglGetPbufferDCARB( struct wgl_pbuffer *object )
{ {
struct x11drv_escape_set_drawable escape; struct x11drv_escape_set_drawable escape;
Wine_GLPBuffer* object = (Wine_GLPBuffer *)hPbuffer;
HDC hdc; HDC hdc;
if (NULL == object) {
SetLastError(ERROR_INVALID_HANDLE);
return NULL;
}
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL ); hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
if (!hdc) return 0; if (!hdc) return 0;
...@@ -2194,7 +2185,7 @@ static HDC X11DRV_wglGetPbufferDCARB(HANDLE hPbuffer) ...@@ -2194,7 +2185,7 @@ static HDC X11DRV_wglGetPbufferDCARB(HANDLE hPbuffer)
escape.gl_type = DC_GL_PBUFFER; escape.gl_type = DC_GL_PBUFFER;
ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL );
TRACE( "(%p)->(%p)\n", hPbuffer, hdc ); TRACE( "(%p)->(%p)\n", object, hdc );
return hdc; return hdc;
} }
...@@ -2203,14 +2194,10 @@ static HDC X11DRV_wglGetPbufferDCARB(HANDLE hPbuffer) ...@@ -2203,14 +2194,10 @@ static HDC X11DRV_wglGetPbufferDCARB(HANDLE hPbuffer)
* *
* WGL_ARB_pbuffer: wglQueryPbufferARB * WGL_ARB_pbuffer: wglQueryPbufferARB
*/ */
static BOOL X11DRV_wglQueryPbufferARB(HANDLE hPbuffer, int iAttribute, int *piValue) static BOOL X11DRV_wglQueryPbufferARB( struct wgl_pbuffer *object, int iAttribute, int *piValue )
{ {
Wine_GLPBuffer* object = (Wine_GLPBuffer *)hPbuffer; TRACE("(%p, 0x%x, %p)\n", object, iAttribute, piValue);
TRACE("(%p, 0x%x, %p)\n", hPbuffer, iAttribute, piValue);
if (NULL == object) {
SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
switch (iAttribute) { switch (iAttribute) {
case WGL_PBUFFER_WIDTH_ARB: case WGL_PBUFFER_WIDTH_ARB:
wine_tsx11_lock(); wine_tsx11_lock();
...@@ -2300,9 +2287,9 @@ static BOOL X11DRV_wglQueryPbufferARB(HANDLE hPbuffer, int iAttribute, int *piVa ...@@ -2300,9 +2287,9 @@ static BOOL X11DRV_wglQueryPbufferARB(HANDLE hPbuffer, int iAttribute, int *piVa
* *
* WGL_ARB_pbuffer: wglReleasePbufferDCARB * WGL_ARB_pbuffer: wglReleasePbufferDCARB
*/ */
static int X11DRV_wglReleasePbufferDCARB(HANDLE hPbuffer, HDC hdc) static int X11DRV_wglReleasePbufferDCARB( struct wgl_pbuffer *object, HDC hdc )
{ {
TRACE("(%p, %p)\n", hPbuffer, hdc); TRACE("(%p, %p)\n", object, hdc);
return DeleteDC(hdc); return DeleteDC(hdc);
} }
...@@ -2311,16 +2298,12 @@ static int X11DRV_wglReleasePbufferDCARB(HANDLE hPbuffer, HDC hdc) ...@@ -2311,16 +2298,12 @@ static int X11DRV_wglReleasePbufferDCARB(HANDLE hPbuffer, HDC hdc)
* *
* WGL_ARB_pbuffer: wglSetPbufferAttribARB * WGL_ARB_pbuffer: wglSetPbufferAttribARB
*/ */
static BOOL X11DRV_wglSetPbufferAttribARB( HANDLE hPbuffer, const int *piAttribList ) static BOOL X11DRV_wglSetPbufferAttribARB( struct wgl_pbuffer *object, const int *piAttribList )
{ {
Wine_GLPBuffer* object = (Wine_GLPBuffer *)hPbuffer;
GLboolean ret = GL_FALSE; GLboolean ret = GL_FALSE;
WARN("(%p, %p): alpha-testing, report any problem\n", hPbuffer, piAttribList); WARN("(%p, %p): alpha-testing, report any problem\n", object, piAttribList);
if (NULL == object) {
SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
if (!object->use_render_texture) { if (!object->use_render_texture) {
SetLastError(ERROR_INVALID_HANDLE); SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE; return GL_FALSE;
...@@ -2729,16 +2712,12 @@ static BOOL X11DRV_wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int ...@@ -2729,16 +2712,12 @@ static BOOL X11DRV_wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int
* *
* WGL_ARB_render_texture: wglBindTexImageARB * WGL_ARB_render_texture: wglBindTexImageARB
*/ */
static BOOL X11DRV_wglBindTexImageARB(HANDLE hPbuffer, int iBuffer) static BOOL X11DRV_wglBindTexImageARB( struct wgl_pbuffer *object, int iBuffer )
{ {
Wine_GLPBuffer* object = (Wine_GLPBuffer *)hPbuffer;
GLboolean ret = GL_FALSE; GLboolean ret = GL_FALSE;
TRACE("(%p, %d)\n", hPbuffer, iBuffer); TRACE("(%p, %d)\n", object, iBuffer);
if (NULL == object) {
SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
if (!object->use_render_texture) { if (!object->use_render_texture) {
SetLastError(ERROR_INVALID_HANDLE); SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE; return GL_FALSE;
...@@ -2792,16 +2771,12 @@ static BOOL X11DRV_wglBindTexImageARB(HANDLE hPbuffer, int iBuffer) ...@@ -2792,16 +2771,12 @@ static BOOL X11DRV_wglBindTexImageARB(HANDLE hPbuffer, int iBuffer)
* *
* WGL_ARB_render_texture: wglReleaseTexImageARB * WGL_ARB_render_texture: wglReleaseTexImageARB
*/ */
static BOOL X11DRV_wglReleaseTexImageARB(HANDLE hPbuffer, int iBuffer) static BOOL X11DRV_wglReleaseTexImageARB( struct wgl_pbuffer *object, int iBuffer )
{ {
Wine_GLPBuffer* object = (Wine_GLPBuffer *)hPbuffer;
GLboolean ret = GL_FALSE; GLboolean ret = GL_FALSE;
TRACE("(%p, %d)\n", hPbuffer, iBuffer); TRACE("(%p, %d)\n", object, iBuffer);
if (NULL == object) {
SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
if (!object->use_render_texture) { if (!object->use_render_texture) {
SetLastError(ERROR_INVALID_HANDLE); SetLastError(ERROR_INVALID_HANDLE);
return GL_FALSE; return GL_FALSE;
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
#define WINE_GLAPI #define WINE_GLAPI
#endif #endif
#define WINE_WGL_DRIVER_VERSION 3 #define WINE_WGL_DRIVER_VERSION 4
struct wgl_context; struct wgl_context;
struct wgl_pbuffer;
struct opengl_funcs struct opengl_funcs
{ {
...@@ -2432,24 +2433,24 @@ struct opengl_funcs ...@@ -2432,24 +2433,24 @@ struct opengl_funcs
void (WINE_GLAPI *p_glWindowPos4svMESA)(const GLshort*); void (WINE_GLAPI *p_glWindowPos4svMESA)(const GLshort*);
void (WINE_GLAPI *p_glWriteMaskEXT)(GLuint,GLuint,GLenum,GLenum,GLenum,GLenum); void (WINE_GLAPI *p_glWriteMaskEXT)(GLuint,GLuint,GLenum,GLenum,GLenum,GLenum);
GLvoid* (WINE_GLAPI *p_wglAllocateMemoryNV)(GLsizei,GLfloat,GLfloat,GLfloat); GLvoid* (WINE_GLAPI *p_wglAllocateMemoryNV)(GLsizei,GLfloat,GLfloat,GLfloat);
BOOL (WINE_GLAPI *p_wglBindTexImageARB)(HANDLE,int); BOOL (WINE_GLAPI *p_wglBindTexImageARB)(struct wgl_pbuffer *,int);
BOOL (WINE_GLAPI *p_wglChoosePixelFormatARB)(HDC,const int*,const FLOAT*,UINT,int*,UINT*); BOOL (WINE_GLAPI *p_wglChoosePixelFormatARB)(HDC,const int*,const FLOAT*,UINT,int*,UINT*);
struct wgl_context * (WINE_GLAPI *p_wglCreateContextAttribsARB)(HDC,struct wgl_context *,const int*); struct wgl_context * (WINE_GLAPI *p_wglCreateContextAttribsARB)(HDC,struct wgl_context *,const int*);
HANDLE (WINE_GLAPI *p_wglCreatePbufferARB)(HDC,int,int,int,const int*); struct wgl_pbuffer * (WINE_GLAPI *p_wglCreatePbufferARB)(HDC,int,int,int,const int*);
BOOL (WINE_GLAPI *p_wglDestroyPbufferARB)(HANDLE); BOOL (WINE_GLAPI *p_wglDestroyPbufferARB)(struct wgl_pbuffer *);
void (WINE_GLAPI *p_wglFreeMemoryNV)(void*); void (WINE_GLAPI *p_wglFreeMemoryNV)(void*);
HDC (WINE_GLAPI *p_wglGetCurrentReadDCARB)(void); HDC (WINE_GLAPI *p_wglGetCurrentReadDCARB)(void);
const GLubyte * (WINE_GLAPI *p_wglGetExtensionsStringARB)(HDC); const GLubyte * (WINE_GLAPI *p_wglGetExtensionsStringARB)(HDC);
const GLubyte * (WINE_GLAPI *p_wglGetExtensionsStringEXT)(void); const GLubyte * (WINE_GLAPI *p_wglGetExtensionsStringEXT)(void);
HDC (WINE_GLAPI *p_wglGetPbufferDCARB)(HANDLE); HDC (WINE_GLAPI *p_wglGetPbufferDCARB)(struct wgl_pbuffer *);
BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribfvARB)(HDC,int,int,UINT,const int*,FLOAT*); BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribfvARB)(HDC,int,int,UINT,const int*,FLOAT*);
BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribivARB)(HDC,int,int,UINT,const int*,int*); BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribivARB)(HDC,int,int,UINT,const int*,int*);
int (WINE_GLAPI *p_wglGetSwapIntervalEXT)(void); int (WINE_GLAPI *p_wglGetSwapIntervalEXT)(void);
BOOL (WINE_GLAPI *p_wglMakeContextCurrentARB)(HDC,HDC,struct wgl_context *); BOOL (WINE_GLAPI *p_wglMakeContextCurrentARB)(HDC,HDC,struct wgl_context *);
BOOL (WINE_GLAPI *p_wglQueryPbufferARB)(HANDLE,int,int*); BOOL (WINE_GLAPI *p_wglQueryPbufferARB)(struct wgl_pbuffer *,int,int*);
int (WINE_GLAPI *p_wglReleasePbufferDCARB)(HANDLE,HDC); int (WINE_GLAPI *p_wglReleasePbufferDCARB)(struct wgl_pbuffer *,HDC);
BOOL (WINE_GLAPI *p_wglReleaseTexImageARB)(HANDLE,int); BOOL (WINE_GLAPI *p_wglReleaseTexImageARB)(struct wgl_pbuffer *,int);
BOOL (WINE_GLAPI *p_wglSetPbufferAttribARB)(HANDLE,const int*); BOOL (WINE_GLAPI *p_wglSetPbufferAttribARB)(struct wgl_pbuffer *,const int*);
BOOL (WINE_GLAPI *p_wglSetPixelFormatWINE)(HDC,int); BOOL (WINE_GLAPI *p_wglSetPixelFormatWINE)(HDC,int);
BOOL (WINE_GLAPI *p_wglSwapIntervalEXT)(int); BOOL (WINE_GLAPI *p_wglSwapIntervalEXT)(int);
} ext; } ext;
......
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