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
8a13afed
Commit
8a13afed
authored
Jun 28, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Move GetPixelFormat to the WGL driver.
parent
bbdf77a3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
62 deletions
+50
-62
opengl.c
dlls/gdi32/opengl.c
+15
-0
painting.c
dlls/gdi32/painting.c
+0
-29
wgl.c
dlls/opengl32/wgl.c
+1
-3
opengl.c
dlls/winex11.drv/opengl.c
+32
-29
gdi_driver.h
include/wine/gdi_driver.h
+2
-1
No files found.
dlls/gdi32/opengl.c
View file @
8a13afed
...
...
@@ -42,6 +42,7 @@ static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l
static
HMODULE
opengl32
;
static
INT
(
WINAPI
*
wglChoosePixelFormat
)(
HDC
,
const
PIXELFORMATDESCRIPTOR
*
);
static
INT
(
WINAPI
*
wglDescribePixelFormat
)(
HDC
,
INT
,
UINT
,
PIXELFORMATDESCRIPTOR
*
);
static
INT
(
WINAPI
*
wglGetPixelFormat
)(
HDC
);
static
BOOL
(
WINAPI
*
wglSetPixelFormat
)(
HDC
,
INT
,
const
PIXELFORMATDESCRIPTOR
*
);
static
BOOL
(
WINAPI
*
wglSwapBuffers
)(
HDC
);
...
...
@@ -131,6 +132,20 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPT
}
/******************************************************************************
* GetPixelFormat (GDI32.@)
*/
INT
WINAPI
GetPixelFormat
(
HDC
hdc
)
{
if
(
!
wglGetPixelFormat
)
{
if
(
!
opengl32
)
opengl32
=
LoadLibraryW
(
opengl32W
);
if
(
!
(
wglGetPixelFormat
=
(
void
*
)
GetProcAddress
(
opengl32
,
"wglGetPixelFormat"
)))
return
0
;
}
return
wglGetPixelFormat
(
hdc
);
}
/******************************************************************************
* SetPixelFormat (GDI32.@)
*/
BOOL
WINAPI
SetPixelFormat
(
HDC
hdc
,
INT
fmt
,
const
PIXELFORMATDESCRIPTOR
*
pfd
)
...
...
dlls/gdi32/painting.c
View file @
8a13afed
...
...
@@ -509,35 +509,6 @@ BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT iPixelFormat, const PIXELFORMATDESCR
/******************************************************************************
* GetPixelFormat [GDI32.@]
* Gets index of pixel format of DC
*
* PARAMETERS
* hdc [I] Device context whose pixel format index is sought
*
* RETURNS
* Success: Currently selected pixel format
* Failure: 0
*/
INT
WINAPI
GetPixelFormat
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
TRACE
(
"(%p)
\n
"
,
hdc
);
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pGetPixelFormat
);
update_dc
(
dc
);
ret
=
physdev
->
funcs
->
pGetPixelFormat
(
physdev
);
release_dc_ptr
(
dc
);
}
return
ret
;
}
/******************************************************************************
* GdiDescribePixelFormat [GDI32.@]
*
* Probably not the correct semantics, it's supposed to be an internal backend for DescribePixelFormat.
...
...
dlls/opengl32/wgl.c
View file @
8a13afed
...
...
@@ -49,7 +49,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
static
struct
{
PROC
(
WINAPI
*
p_wglGetProcAddress
)(
LPCSTR
lpszProc
);
INT
(
WINAPI
*
p_GetPixelFormat
)(
HDC
hdc
);
/* internal WGL functions */
void
(
WINAPI
*
p_wglFinish
)(
void
);
...
...
@@ -361,7 +360,7 @@ INT WINAPI wglDescribePixelFormat(HDC hdc, INT iPixelFormat, UINT nBytes,
*/
INT
WINAPI
wglGetPixelFormat
(
HDC
hdc
)
{
return
wine_wgl
.
p_GetPixelFormat
(
hdc
);
return
wgl_driver
->
p_GetPixelFormat
(
hdc
);
}
/***********************************************************************
...
...
@@ -1129,7 +1128,6 @@ static BOOL process_attach(void)
}
wine_wgl
.
p_wglGetProcAddress
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"wglGetProcAddress"
);
wine_wgl
.
p_GetPixelFormat
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"GetPixelFormat"
);
/* internal WGL functions */
wine_wgl
.
p_wglFinish
=
(
void
*
)
wine_wgl
.
p_wglGetProcAddress
(
"wglFinish"
);
...
...
dlls/winex11.drv/opengl.c
View file @
8a13afed
...
...
@@ -1281,41 +1281,43 @@ static int glxdrv_DescribePixelFormat(PHYSDEV dev, int iPixelFormat,
return
ret
;
}
/**
* glxdrv_GetPixelFormat
*
* Get the pixel-format id used by this DC
/***********************************************************************
* glxdrv_GetPixelFormat
*/
static
int
glxdrv_GetPixelFormat
(
PHYSDEV
dev
)
static
int
glxdrv_GetPixelFormat
(
HDC
hdc
)
{
struct
glx_physdev
*
physdev
=
get_glxdrv_dev
(
dev
)
;
WineGLPixelFormat
*
fmt
;
int
tmp
;
struct
x11drv_escape_get_drawable
escape
;
WineGLPixelFormat
*
fmt
;
int
tmp
;
if
(
!
physdev
->
pixel_format
)
return
0
;
/* not set yet */
TRACE
(
"(%p)
\n
"
,
hdc
);
fmt
=
ConvertPixelFormatWGLtoGLX
(
gdi_display
,
physdev
->
pixel_format
,
TRUE
,
&
tmp
);
if
(
!
fmt
)
{
ERR
(
"Unable to find a WineGLPixelFormat for iPixelFormat=%d
\n
"
,
physdev
->
pixel_format
);
return
0
;
}
else
if
(
fmt
->
offscreenOnly
)
{
/* Offscreen formats can't be used with traditional WGL calls.
* As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */
TRACE
(
"Returning iPixelFormat=1 for offscreen format: %d
\n
"
,
fmt
->
iPixelFormat
);
return
1
;
}
escape
.
code
=
X11DRV_GET_DRAWABLE
;
if
(
!
ExtEscape
(
hdc
,
X11DRV_ESCAPE
,
sizeof
(
escape
.
code
),
(
LPCSTR
)
&
escape
.
code
,
sizeof
(
escape
),
(
LPSTR
)
&
escape
))
return
0
;
TRACE
(
"(%p): returns %d
\n
"
,
dev
->
hdc
,
physdev
->
pixel_format
);
return
physdev
->
pixel_format
;
if
(
!
escape
.
pixel_format
)
return
0
;
/* not set yet */
fmt
=
ConvertPixelFormatWGLtoGLX
(
gdi_display
,
escape
.
pixel_format
,
TRUE
,
&
tmp
);
if
(
!
fmt
)
{
ERR
(
"Unable to find a WineGLPixelFormat for iPixelFormat=%d
\n
"
,
escape
.
pixel_format
);
return
0
;
}
if
(
fmt
->
offscreenOnly
)
{
/* Offscreen formats can't be used with traditional WGL calls.
* As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */
TRACE
(
"Returning iPixelFormat=1 for offscreen format: %d
\n
"
,
fmt
->
iPixelFormat
);
return
1
;
}
TRACE
(
"(%p): returns %d
\n
"
,
hdc
,
escape
.
pixel_format
);
return
escape
.
pixel_format
;
}
/**
* glxdrv_SetPixelFormat
*
* Set the pixel-format id used by this DC
/***********************************************************************
* glxdrv_SetPixelFormat
*/
static
BOOL
glxdrv_SetPixelFormat
(
PHYSDEV
dev
,
int
iPixelFormat
,
const
PIXELFORMATDESCRIPTOR
*
ppfd
)
{
...
...
@@ -3513,7 +3515,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
NULL
,
/* pGetNearestColor */
NULL
,
/* pGetOutlineTextMetrics */
NULL
,
/* pGetPixel */
glxdrv_GetPixelFormat
,
/* pGetPixelFormat */
NULL
,
/* pGetPixelFormat */
NULL
,
/* pGetSystemPaletteEntries */
NULL
,
/* pGetTextCharsetInfo */
NULL
,
/* pGetTextExtentExPoint */
...
...
@@ -3601,6 +3603,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
static
const
struct
wgl_funcs
glxdrv_wgl_funcs
=
{
glxdrv_GetPixelFormat
,
/* p_GetPixelFormat */
glxdrv_wglCopyContext
,
/* p_wglCopyContext */
glxdrv_wglCreateContext
,
/* p_wglCreateContext */
glxdrv_wglCreateContextAttribsARB
,
/* p_wglCreateContextAttribsARB */
...
...
include/wine/gdi_driver.h
View file @
8a13afed
...
...
@@ -203,7 +203,7 @@ struct gdi_dc_funcs
};
/* increment this when you change the DC function table */
#define WINE_GDI_DRIVER_VERSION 3
6
#define WINE_GDI_DRIVER_VERSION 3
7
#define GDI_PRIORITY_NULL_DRV 0
/* null driver */
#define GDI_PRIORITY_FONT_DRV 100
/* any font driver */
...
...
@@ -233,6 +233,7 @@ static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct g
struct
wgl_funcs
{
INT
(
*
p_GetPixelFormat
)(
HDC
);
BOOL
(
*
p_wglCopyContext
)(
HGLRC
,
HGLRC
,
UINT
);
HGLRC
(
*
p_wglCreateContext
)(
HDC
);
HGLRC
(
*
p_wglCreateContextAttribsARB
)(
HDC
,
HGLRC
,
const
int
*
);
...
...
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