Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3d73e0a3
Commit
3d73e0a3
authored
Oct 03, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add a helper function to get a pixel format index.
parent
730479e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
opengl.c
dlls/winex11.drv/opengl.c
+7
-2
No files found.
dlls/winex11.drv/opengl.c
View file @
3d73e0a3
...
...
@@ -1043,6 +1043,11 @@ static inline BOOL is_onscreen_pixel_format( int format )
return
format
>
0
&&
format
<=
nb_onscreen_formats
;
}
static
inline
int
pixel_format_index
(
const
struct
wgl_pixel_format
*
format
)
{
return
format
-
pixel_formats
+
1
;
}
/* GLX can advertise dozens of different pixelformats including offscreen and onscreen ones.
* In our WGL implementation we only support a subset of these formats namely the format of
* Wine's main visual and offscreen formats (if they are available).
...
...
@@ -1506,7 +1511,7 @@ static int glxdrv_wglGetPixelFormat( HDC hdc )
if
((
gl
=
get_gl_drawable
(
WindowFromDC
(
hdc
),
hdc
)))
{
ret
=
gl
->
format
-
pixel_formats
+
1
;
ret
=
pixel_format_index
(
gl
->
format
)
;
/* Offscreen formats can't be used with traditional WGL calls.
* As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */
if
(
!
is_onscreen_pixel_format
(
ret
))
ret
=
1
;
...
...
@@ -1550,7 +1555,7 @@ static BOOL glxdrv_wglSetPixelFormat( HDC hdc, int iPixelFormat, const PIXELFORM
if
((
gl
=
get_gl_drawable
(
hwnd
,
hdc
)))
{
int
prev
=
gl
->
format
-
pixel_formats
+
1
;
int
prev
=
pixel_format_index
(
gl
->
format
)
;
release_gl_drawable
(
gl
);
return
prev
==
iPixelFormat
;
/* cannot change it if already set */
}
...
...
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