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
53ac5199
Commit
53ac5199
authored
7 years ago
by
Daniel Lehman
Committed by
Alexandre Julliard
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32/tests: Add tests for ChoosePixelFormat.
Signed-off-by:
Daniel Lehman
<
dlehman@esri.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
94af0276
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
0 deletions
+96
-0
opengl.c
dlls/opengl32/tests/opengl.c
+96
-0
No files found.
dlls/opengl32/tests/opengl.c
View file @
53ac5199
...
...
@@ -232,6 +232,101 @@ 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
int
test_pfd
(
const
PIXELFORMATDESCRIPTOR
*
pfd
)
{
int
pf
;
HDC
hdc
;
HWND
hwnd
;
hwnd
=
CreateWindowA
(
"static"
,
"Title"
,
WS_OVERLAPPEDWINDOW
,
10
,
10
,
200
,
200
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
hwnd
)
return
0
;
hdc
=
GetDC
(
hwnd
);
pf
=
ChoosePixelFormat
(
hdc
,
pfd
);
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
return
pf
;
}
static
void
test_choosepixelformat
(
void
)
{
PIXELFORMATDESCRIPTOR
pfd
=
{
sizeof
(
PIXELFORMATDESCRIPTOR
),
1
,
/* version */
PFD_DRAW_TO_WINDOW
|
PFD_SUPPORT_OPENGL
|
PFD_TYPE_RGBA
,
0
,
/* 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 */
0
,
/* z-buffer */
0
,
/* stencil buffer */
0
,
/* auxiliary buffer */
PFD_MAIN_PLANE
,
/* main layer */
0
,
/* reserved */
0
,
0
,
0
/* layer masks */
};
ok
(
test_pfd
(
&
pfd
),
"Simple pfd failed
\n
"
);
pfd
.
dwFlags
|=
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE failed
\n
"
);
pfd
.
dwFlags
|=
PFD_STEREO_DONTCARE
;
todo_wine
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_STEREO_DONTCARE
;
pfd
.
cColorBits
=
32
;
ok
(
test_pfd
(
&
pfd
),
"Simple pfd failed
\n
"
);
pfd
.
dwFlags
|=
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE failed
\n
"
);
pfd
.
dwFlags
|=
PFD_STEREO_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_STEREO_DONTCARE
;
pfd
.
cColorBits
=
0
;
pfd
.
cAlphaBits
=
8
;
ok
(
test_pfd
(
&
pfd
),
"Simple pfd failed
\n
"
);
pfd
.
dwFlags
|=
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE failed
\n
"
);
pfd
.
dwFlags
|=
PFD_STEREO_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_STEREO_DONTCARE
;
pfd
.
cAlphaBits
=
0
;
pfd
.
cStencilBits
=
8
;
ok
(
test_pfd
(
&
pfd
),
"Simple pfd failed
\n
"
);
pfd
.
dwFlags
|=
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE failed
\n
"
);
pfd
.
dwFlags
|=
PFD_STEREO_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_STEREO_DONTCARE
;
pfd
.
cStencilBits
=
0
;
pfd
.
cAuxBuffers
=
1
;
ok
(
test_pfd
(
&
pfd
),
"Simple pfd failed
\n
"
);
pfd
.
dwFlags
|=
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE failed
\n
"
);
pfd
.
dwFlags
|=
PFD_STEREO_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_DOUBLEBUFFER_DONTCARE|PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_DOUBLEBUFFER_DONTCARE
;
ok
(
test_pfd
(
&
pfd
),
"PFD_STEREO_DONTCARE failed
\n
"
);
pfd
.
dwFlags
&=
~
PFD_STEREO_DONTCARE
;
pfd
.
cAuxBuffers
=
0
;
}
static
void
test_setpixelformat
(
HDC
winhdc
)
{
int
res
=
0
;
...
...
@@ -1689,6 +1784,7 @@ START_TEST(opengl)
return
;
}
test_choosepixelformat
();
test_setpixelformat
(
hdc
);
test_destroy
(
hdc
);
test_sharelists
(
hdc
);
...
...
This diff is collapsed.
Click to expand it.
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