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
323d9e42
Commit
323d9e42
authored
Aug 01, 2007
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Aug 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wgl: SetPixelFormat should fail on the root window.
parent
219269c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
opengl.c
dlls/opengl32/tests/opengl.c
+39
-0
opengl.c
dlls/winex11.drv/opengl.c
+7
-0
No files found.
dlls/opengl32/tests/opengl.c
View file @
323d9e42
...
...
@@ -151,6 +151,43 @@ static void test_pbuffers(HDC hdc)
else
skip
(
"Pbuffer test for offscreen pixelformat skipped as no offscreen-only format with pbuffer capabilities has been found
\n
"
);
}
static
void
test_setpixelformat
(
void
)
{
int
res
=
0
;
int
pf
;
PIXELFORMATDESCRIPTOR
pfd
=
{
sizeof
(
PIXELFORMATDESCRIPTOR
),
1
,
/* version */
PFD_DRAW_TO_WINDOW
|
PFD_SUPPORT_OPENGL
|
PFD_DOUBLEBUFFER
,
PFD_TYPE_RGBA
,
24
,
/* 24-bit color depth */
0
,
0
,
0
,
0
,
0
,
0
,
/* color bits */
0
,
/* alpha buffer */
0
,
/* shift bit */
0
,
/* accumulation buffer */
0
,
0
,
0
,
0
,
/* accum bits */
32
,
/* z-buffer */
0
,
/* stencil buffer */
0
,
/* auxiliary buffer */
PFD_MAIN_PLANE
,
/* main layer */
0
,
/* reserved */
0
,
0
,
0
/* layer masks */
};
HDC
hdc
=
GetDC
(
0
);
ok
(
hdc
!=
0
,
"GetDC(0) failed!
\n
"
);
/* This should pass even on the main device context */
pf
=
ChoosePixelFormat
(
hdc
,
&
pfd
);
ok
(
pf
!=
0
,
"ChoosePixelFormat failed on main device context"
);
/* SetPixelFormat on the main device context 'X root window' should fail */
res
=
SetPixelFormat
(
hdc
,
pf
,
&
pfd
);
ok
(
res
==
0
,
"SetPixelFormat on main device context should fail
\n
"
);
}
START_TEST
(
opengl
)
{
HWND
hwnd
;
...
...
@@ -198,6 +235,8 @@ START_TEST(opengl)
ok
(
res
,
"wglMakeCurrent failed!
\n
"
);
init_functions
();
test_setpixelformat
();
wgl_extensions
=
pwglGetExtensionsStringARB
(
hdc
);
if
(
wgl_extensions
==
NULL
)
skip
(
"Skipping opengl32 tests because this OpenGL implementation doesn't support WGL extensions!
\n
"
);
...
...
dlls/winex11.drv/opengl.c
View file @
323d9e42
...
...
@@ -1298,6 +1298,13 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev,
return
0
;
}
/* SetPixelFormat is not allowed on the X root_window e.g. GetDC(0) */
if
(
get_glxdrawable
(
physDev
)
==
root_window
)
{
ERR
(
"Invalid operation on root_window
\n
"
);
return
0
;
}
/* Check if iPixelFormat is in our list of supported formats to see if it is supported. */
fmt
=
ConvertPixelFormatWGLtoGLX
(
gdi_display
,
iPixelFormat
,
FALSE
/* Offscreen */
,
&
value
);
if
(
!
fmt
)
{
...
...
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