Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
db25d402
Commit
db25d402
authored
Jun 28, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Simplify wglSetPixelFormatWINE and export it as a standard extension function.
parent
02b00ffb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
63 deletions
+48
-63
opengl.c
dlls/gdi32/opengl.c
+0
-23
context.c
dlls/wined3d/context.c
+1
-1
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+1
-2
opengl.c
dlls/winex11.drv/opengl.c
+46
-37
No files found.
dlls/gdi32/opengl.c
View file @
db25d402
...
@@ -101,27 +101,6 @@ static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, con
...
@@ -101,27 +101,6 @@ static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, con
return
ret
;
return
ret
;
}
}
/**************************************************************************************
* WINE-specific wglSetPixelFormat which can set the iPixelFormat multiple times
*
*/
static
BOOL
WINAPI
wglSetPixelFormatWINE
(
HDC
hdc
,
int
iPixelFormat
,
const
PIXELFORMATDESCRIPTOR
*
ppfd
)
{
INT
bRet
=
FALSE
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
TRACE
(
"(%p,%d,%p)
\n
"
,
hdc
,
iPixelFormat
,
ppfd
);
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pwglSetPixelFormatWINE
);
update_dc
(
dc
);
bRet
=
physdev
->
funcs
->
pwglSetPixelFormatWINE
(
physdev
,
iPixelFormat
,
ppfd
);
release_dc_ptr
(
dc
);
}
return
bRet
;
}
/***********************************************************************
/***********************************************************************
* Internal wglGetProcAddress for retrieving WGL extensions
* Internal wglGetProcAddress for retrieving WGL extensions
*/
*/
...
@@ -151,8 +130,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
...
@@ -151,8 +130,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
*/
*/
if
(
ret
&&
strcmp
(
func
,
"wglCreateContextAttribsARB"
)
==
0
)
if
(
ret
&&
strcmp
(
func
,
"wglCreateContextAttribsARB"
)
==
0
)
return
(
PROC
)
wglCreateContextAttribsARB
;
return
(
PROC
)
wglCreateContextAttribsARB
;
else
if
(
ret
&&
strcmp
(
func
,
"wglSetPixelFormatWINE"
)
==
0
)
return
(
PROC
)
wglSetPixelFormatWINE
;
return
ret
;
return
ret
;
}
}
...
...
dlls/wined3d/context.c
View file @
db25d402
...
@@ -741,7 +741,7 @@ static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC
...
@@ -741,7 +741,7 @@ static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC
* when really needed. */
* when really needed. */
if
(
gl_info
->
supported
[
WGL_WINE_PIXEL_FORMAT_PASSTHROUGH
])
if
(
gl_info
->
supported
[
WGL_WINE_PIXEL_FORMAT_PASSTHROUGH
])
{
{
if
(
!
GL_EXTCALL
(
wglSetPixelFormatWINE
(
dc
,
format
,
NULL
)))
if
(
!
GL_EXTCALL
(
wglSetPixelFormatWINE
(
dc
,
format
)))
{
{
ERR
(
"wglSetPixelFormatWINE failed to set pixel format %d on device context %p.
\n
"
,
ERR
(
"wglSetPixelFormatWINE failed to set pixel format %d on device context %p.
\n
"
,
format
,
dc
);
format
,
dc
);
...
...
dlls/wined3d/wined3d_gl.h
View file @
db25d402
...
@@ -3770,8 +3770,7 @@ typedef BOOL (WINAPI *WINED3D_PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int
...
@@ -3770,8 +3770,7 @@ typedef BOOL (WINAPI *WINED3D_PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int
#endif
#endif
/* WGL_WINE_pixel_format_passthrough */
/* WGL_WINE_pixel_format_passthrough */
typedef
BOOL
(
WINAPI
*
WINED3D_PFNWGLSETPIXELFORMATWINE
)(
HDC
hdc
,
int
iPixelFormat
,
typedef
BOOL
(
WINAPI
*
WINED3D_PFNWGLSETPIXELFORMATWINE
)(
HDC
hdc
,
int
iPixelFormat
);
const
PIXELFORMATDESCRIPTOR
*
ppfd
);
typedef
BOOL
(
WINAPI
*
WINED3D_PFNWGLSWAPINTERVALEXTPROC
)(
int
interval
);
typedef
BOOL
(
WINAPI
*
WINED3D_PFNWGLSWAPINTERVALEXTPROC
)(
int
interval
);
...
...
dlls/winex11.drv/opengl.c
View file @
db25d402
...
@@ -1310,17 +1310,25 @@ static int glxdrv_GetPixelFormat(PHYSDEV dev)
...
@@ -1310,17 +1310,25 @@ static int glxdrv_GetPixelFormat(PHYSDEV dev)
return
physdev
->
pixel_format
;
return
physdev
->
pixel_format
;
}
}
/*
This function is the core of X11DRV_SetPixelFormat and X11DRV_SetPixelFormatWINE.
/*
*
*
Both functions are the same except that X11DRV_SetPixelFormatWINE allows you to
*
glxdrv_SetPixelFormat
*
set the pixel format multiple times. */
*
static
BOOL
internal_SetPixelFormat
(
struct
glx_physdev
*
physdev
,
* Set the pixel-format id used by this DC
int
iPixelFormat
,
*/
const
PIXELFORMATDESCRIPTOR
*
ppfd
)
static
BOOL
glxdrv_SetPixelFormat
(
PHYSDEV
dev
,
int
iPixelFormat
,
const
PIXELFORMATDESCRIPTOR
*
ppfd
)
{
{
struct
glx_physdev
*
physdev
=
get_glxdrv_dev
(
dev
);
WineGLPixelFormat
*
fmt
;
WineGLPixelFormat
*
fmt
;
int
value
;
int
value
;
HWND
hwnd
;
HWND
hwnd
;
TRACE
(
"(%p,%d,%p)
\n
"
,
dev
->
hdc
,
iPixelFormat
,
ppfd
);
if
(
!
has_opengl
())
return
FALSE
;
if
(
physdev
->
pixel_format
)
/* cannot change it if already set */
return
(
physdev
->
pixel_format
==
iPixelFormat
);
/* SetPixelFormat is not allowed on the X root_window e.g. GetDC(0) */
/* SetPixelFormat is not allowed on the X root_window e.g. GetDC(0) */
if
(
physdev
->
x11dev
->
drawable
==
root_window
)
if
(
physdev
->
x11dev
->
drawable
==
root_window
)
{
{
...
@@ -1385,26 +1393,6 @@ static BOOL internal_SetPixelFormat( struct glx_physdev *physdev,
...
@@ -1385,26 +1393,6 @@ static BOOL internal_SetPixelFormat( struct glx_physdev *physdev,
return
TRUE
;
return
TRUE
;
}
}
/**
* glxdrv_SetPixelFormat
*
* Set the pixel-format id used by this DC
*/
static
BOOL
glxdrv_SetPixelFormat
(
PHYSDEV
dev
,
int
iPixelFormat
,
const
PIXELFORMATDESCRIPTOR
*
ppfd
)
{
struct
glx_physdev
*
physdev
=
get_glxdrv_dev
(
dev
);
TRACE
(
"(%p,%d,%p)
\n
"
,
dev
->
hdc
,
iPixelFormat
,
ppfd
);
if
(
!
has_opengl
())
return
FALSE
;
if
(
physdev
->
pixel_format
)
/* cannot change it if already set */
return
(
physdev
->
pixel_format
==
iPixelFormat
);
return
internal_SetPixelFormat
(
physdev
,
iPixelFormat
,
ppfd
);
}
/**
/**
* X11DRV_wglCopyContext
* X11DRV_wglCopyContext
*
*
...
@@ -2991,24 +2979,45 @@ static void WINAPI X11DRV_wglFreeMemoryNV(GLvoid* pointer) {
...
@@ -2991,24 +2979,45 @@ static void WINAPI X11DRV_wglFreeMemoryNV(GLvoid* pointer) {
}
}
/**
/**
*
glxdrv
_wglSetPixelFormatWINE
*
X11DRV
_wglSetPixelFormatWINE
*
*
* WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE
* WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE
* This is a WINE-specific wglSetPixelFormat which can set the pixel format multiple times.
* This is a WINE-specific wglSetPixelFormat which can set the pixel format multiple times.
*/
*/
static
BOOL
glxdrv_wglSetPixelFormatWINE
(
PHYSDEV
dev
,
int
iPixelFormat
,
const
PIXELFORMATDESCRIPTOR
*
ppfd
)
static
BOOL
WINAPI
X11DRV_wglSetPixelFormatWINE
(
HDC
hdc
,
int
format
)
{
{
struct
glx_physdev
*
physdev
=
get_glxdrv_dev
(
dev
);
WineGLPixelFormat
*
fmt
;
int
value
;
HWND
hwnd
;
TRACE
(
"(%p,%d
,%p)
\n
"
,
dev
->
hdc
,
iPixelFormat
,
ppfd
);
TRACE
(
"(%p,%d
)
\n
"
,
hdc
,
format
);
if
(
!
has_opengl
())
return
FALSE
;
fmt
=
ConvertPixelFormatWGLtoGLX
(
gdi_display
,
format
,
FALSE
/* Offscreen */
,
&
value
);
if
(
!
fmt
)
{
ERR
(
"Invalid format %d
\n
"
,
format
);
return
FALSE
;
}
if
(
physdev
->
pixel_format
==
iPixelFormat
)
return
TRUE
;
hwnd
=
WindowFromDC
(
hdc
);
if
(
!
hwnd
||
hwnd
==
GetDesktopWindow
())
{
ERR
(
"not a valid window DC %p
\n
"
,
hdc
);
return
FALSE
;
}
wine_tsx11_lock
();
pglXGetFBConfigAttrib
(
gdi_display
,
fmt
->
fbconfig
,
GLX_DRAWABLE_TYPE
,
&
value
);
wine_tsx11_unlock
();
if
(
!
(
value
&
GLX_WINDOW_BIT
))
{
WARN
(
"Pixel format %d is not compatible for window rendering
\n
"
,
format
);
return
FALSE
;
}
/* Relay to the core SetPixelFormat */
return
SendMessageW
(
hwnd
,
WM_X11DRV_SET_WIN_FORMAT
,
fmt
->
fmt_id
,
0
);
TRACE
(
"Changing iPixelFormat from %d to %d
\n
"
,
physdev
->
pixel_format
,
iPixelFormat
);
/* DC pixel format will be set by the DCE update */
return
internal_SetPixelFormat
(
physdev
,
iPixelFormat
,
ppfd
);
}
}
/**
/**
...
@@ -3167,7 +3176,7 @@ static const WineGLExtension WGL_WINE_pixel_format_passthrough =
...
@@ -3167,7 +3176,7 @@ static const WineGLExtension WGL_WINE_pixel_format_passthrough =
{
{
"WGL_WINE_pixel_format_passthrough"
,
"WGL_WINE_pixel_format_passthrough"
,
{
{
{
"wglSetPixelFormatWINE"
,
(
void
*
)
1
/* not called directly */
},
{
"wglSetPixelFormatWINE"
,
X11DRV_wglSetPixelFormatWINE
},
}
}
};
};
...
@@ -3586,7 +3595,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
...
@@ -3586,7 +3595,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
glxdrv_wglGetProcAddress
,
/* pwglGetProcAddress */
glxdrv_wglGetProcAddress
,
/* pwglGetProcAddress */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
NULL
,
/* pwglMakeCurrent */
glxdrv_wglSetPixelFormatWINE
,
/* pwglSetPixelFormatWINE */
NULL
,
/* pwglSetPixelFormatWINE */
GDI_PRIORITY_GRAPHICS_DRV
+
20
/* priority */
GDI_PRIORITY_GRAPHICS_DRV
+
20
/* priority */
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment