Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Steve Lhomme
vlc
Commits
f26ac5b8
Commit
f26ac5b8
authored
Nov 10, 2017
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wgl: refactor PFD initialization
parent
ed9fe3b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
27 deletions
+12
-27
modules/video_output/win32/wgl.c
modules/video_output/win32/wgl.c
+12
-27
No files found.
modules/video_output/win32/wgl.c
View file @
f26ac5b8
...
...
@@ -73,20 +73,21 @@ static void *OurGetProcAddress(vlc_gl_t *, const char *);
static
int
MakeCurrent
(
vlc_gl_t
*
gl
);
static
void
ReleaseCurrent
(
vlc_gl_t
*
gl
);
#define VLC_PFD_INITIALIZER { \
.nSize = sizeof(PIXELFORMATDESCRIPTOR), \
.nVersion = 1, \
.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, \
.iPixelType = PFD_TYPE_RGBA, \
.cColorBits = 24, \
.cDepthBits = 16, \
.iLayerType = PFD_MAIN_PLANE, \
}
/* Create an GPU Affinity DC */
static
void
CreateGPUAffinityDC
(
vlc_gl_t
*
gl
,
UINT
nVidiaAffinity
)
{
vout_display_sys_t
*
sys
=
gl
->
sys
;
PIXELFORMATDESCRIPTOR
pfd
;
memset
(
&
pfd
,
0
,
sizeof
(
pfd
));
pfd
.
nSize
=
sizeof
(
pfd
);
pfd
.
nVersion
=
1
;
pfd
.
dwFlags
=
PFD_DRAW_TO_WINDOW
|
PFD_SUPPORT_OPENGL
|
PFD_DOUBLEBUFFER
;
pfd
.
iPixelType
=
PFD_TYPE_RGBA
;
pfd
.
cColorBits
=
24
;
pfd
.
cDepthBits
=
16
;
pfd
.
iLayerType
=
PFD_MAIN_PLANE
;
PIXELFORMATDESCRIPTOR
pfd
=
VLC_PFD_INITIALIZER
;
/* create a temporary GL context */
HDC
winDC
=
GetDC
(
sys
->
sys
.
hvideownd
);
...
...
@@ -127,15 +128,7 @@ static void DestroyGPUAffinityDC(vlc_gl_t *gl) {
if
(
sys
->
affinityHDC
==
NULL
)
return
;
PIXELFORMATDESCRIPTOR
pfd
;
memset
(
&
pfd
,
0
,
sizeof
(
pfd
));
pfd
.
nSize
=
sizeof
(
pfd
);
pfd
.
nVersion
=
1
;
pfd
.
dwFlags
=
PFD_DRAW_TO_WINDOW
|
PFD_SUPPORT_OPENGL
|
PFD_DOUBLEBUFFER
;
pfd
.
iPixelType
=
PFD_TYPE_RGBA
;
pfd
.
cColorBits
=
24
;
pfd
.
cDepthBits
=
16
;
pfd
.
iLayerType
=
PFD_MAIN_PLANE
;
PIXELFORMATDESCRIPTOR
pfd
=
VLC_PFD_INITIALIZER
;
/* create a temporary GL context */
HDC
winDC
=
GetDC
(
sys
->
sys
.
hvideownd
);
...
...
@@ -183,15 +176,7 @@ static int Open(vlc_object_t *object)
}
/* Set the pixel format for the DC */
PIXELFORMATDESCRIPTOR
pfd
;
memset
(
&
pfd
,
0
,
sizeof
(
pfd
));
pfd
.
nSize
=
sizeof
(
pfd
);
pfd
.
nVersion
=
1
;
pfd
.
dwFlags
=
PFD_DRAW_TO_WINDOW
|
PFD_SUPPORT_OPENGL
|
PFD_DOUBLEBUFFER
;
pfd
.
iPixelType
=
PFD_TYPE_RGBA
;
pfd
.
cColorBits
=
24
;
pfd
.
cDepthBits
=
16
;
pfd
.
iLayerType
=
PFD_MAIN_PLANE
;
PIXELFORMATDESCRIPTOR
pfd
=
VLC_PFD_INITIALIZER
;
SetPixelFormat
(
sys
->
hGLDC
,
ChoosePixelFormat
(
sys
->
hGLDC
,
&
pfd
),
&
pfd
);
/* Create the context. */
...
...
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