Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
c9664a24
Commit
c9664a24
authored
Oct 25, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GLX: drop support for GLX version 1.2
This is useless as we require OpenGL 1.4.
parent
9fc6fc4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
103 deletions
+62
-103
modules/video_output/xcb/glx.c
modules/video_output/xcb/glx.c
+62
-103
No files found.
modules/video_output/xcb/glx.c
View file @
c9664a24
...
@@ -68,7 +68,6 @@ struct vout_display_sys_t
...
@@ -68,7 +68,6 @@ struct vout_display_sys_t
xcb_window_t
window
;
/* drawable X window */
xcb_window_t
window
;
/* drawable X window */
xcb_window_t
glwin
;
/* GLX window */
xcb_window_t
glwin
;
/* GLX window */
bool
visible
;
/* whether to draw */
bool
visible
;
/* whether to draw */
bool
v1_3
;
/* whether GLX >= 1.3 is available */
GLXContext
ctx
;
GLXContext
ctx
;
vlc_gl_t
gl
;
vlc_gl_t
gl
;
...
@@ -151,7 +150,7 @@ FindWindow (vout_display_t *vd, xcb_connection_t *conn,
...
@@ -151,7 +150,7 @@ FindWindow (vout_display_t *vd, xcb_connection_t *conn,
return
screen
;
return
screen
;
}
}
static
bool
CheckGLX
(
vout_display_t
*
vd
,
Display
*
dpy
,
bool
*
restrict
pv13
)
static
bool
CheckGLX
(
vout_display_t
*
vd
,
Display
*
dpy
)
{
{
int
major
,
minor
;
int
major
,
minor
;
bool
ok
=
false
;
bool
ok
=
false
;
...
@@ -162,13 +161,12 @@ static bool CheckGLX (vout_display_t *vd, Display *dpy, bool *restrict pv13)
...
@@ -162,13 +161,12 @@ static bool CheckGLX (vout_display_t *vd, Display *dpy, bool *restrict pv13)
if
(
major
!=
1
)
if
(
major
!=
1
)
msg_Dbg
(
vd
,
"GLX extension version %d.%d unknown"
,
major
,
minor
);
msg_Dbg
(
vd
,
"GLX extension version %d.%d unknown"
,
major
,
minor
);
else
else
if
(
minor
<
2
)
if
(
minor
<
3
)
msg_Dbg
(
vd
,
"GLX extension version %d.%d too old"
,
major
,
minor
);
msg_Dbg
(
vd
,
"GLX extension version %d.%d too old"
,
major
,
minor
);
else
else
{
{
msg_Dbg
(
vd
,
"using GLX extension version %d.%d"
,
major
,
minor
);
msg_Dbg
(
vd
,
"using GLX extension version %d.%d"
,
major
,
minor
);
ok
=
true
;
ok
=
true
;
*
pv13
=
minor
>=
3
;
}
}
return
ok
;
return
ok
;
}
}
...
@@ -246,7 +244,7 @@ static int Open (vlc_object_t *obj)
...
@@ -246,7 +244,7 @@ static int Open (vlc_object_t *obj)
sys
->
conn
=
conn
;
sys
->
conn
=
conn
;
sys
->
ctx
=
NULL
;
sys
->
ctx
=
NULL
;
if
(
!
CheckGLX
(
vd
,
dpy
,
&
sys
->
v1_3
))
if
(
!
CheckGLX
(
vd
,
dpy
))
goto
error
;
goto
error
;
RegisterMouseEvents
(
obj
,
conn
,
sys
->
embed
->
handle
.
xid
);
RegisterMouseEvents
(
obj
,
conn
,
sys
->
embed
->
handle
.
xid
);
...
@@ -263,8 +261,6 @@ static int Open (vlc_object_t *obj)
...
@@ -263,8 +261,6 @@ static int Open (vlc_object_t *obj)
sys
->
window
=
xcb_generate_id
(
conn
);
sys
->
window
=
xcb_generate_id
(
conn
);
/* Determine our pixel format */
/* Determine our pixel format */
if
(
sys
->
v1_3
)
{
/* GLX 1.3 */
static
const
int
attr
[]
=
{
static
const
int
attr
[]
=
{
GLX_RED_SIZE
,
5
,
GLX_RED_SIZE
,
5
,
GLX_GREEN_SIZE
,
5
,
GLX_GREEN_SIZE
,
5
,
...
@@ -272,12 +268,12 @@ static int Open (vlc_object_t *obj)
...
@@ -272,12 +268,12 @@ static int Open (vlc_object_t *obj)
GLX_DOUBLEBUFFER
,
True
,
GLX_DOUBLEBUFFER
,
True
,
GLX_X_RENDERABLE
,
True
,
GLX_X_RENDERABLE
,
True
,
GLX_DRAWABLE_TYPE
,
GLX_WINDOW_BIT
,
GLX_DRAWABLE_TYPE
,
GLX_WINDOW_BIT
,
None
};
None
};
xcb_get_window_attributes_reply_t
*
wa
=
xcb_get_window_attributes_reply_t
*
wa
=
xcb_get_window_attributes_reply
(
conn
,
xcb_get_window_attributes_reply
(
conn
,
xcb_get_window_attributes
(
conn
,
sys
->
embed
->
handle
.
xid
),
xcb_get_window_attributes
(
conn
,
sys
->
embed
->
handle
.
xid
),
NULL
);
NULL
);
if
(
wa
==
NULL
)
if
(
wa
==
NULL
)
goto
error
;
goto
error
;
xcb_visualid_t
visual
=
wa
->
visual
;
xcb_visualid_t
visual
=
wa
->
visual
;
...
@@ -324,8 +320,7 @@ static int Open (vlc_object_t *obj)
...
@@ -324,8 +320,7 @@ static int Open (vlc_object_t *obj)
}
}
/* Create an OpenGL context */
/* Create an OpenGL context */
sys
->
ctx
=
glXCreateNewContext
(
dpy
,
conf
,
GLX_RGBA_TYPE
,
NULL
,
sys
->
ctx
=
glXCreateNewContext
(
dpy
,
conf
,
GLX_RGBA_TYPE
,
NULL
,
True
);
True
);
if
(
sys
->
ctx
==
NULL
)
if
(
sys
->
ctx
==
NULL
)
{
{
msg_Err
(
vd
,
"cannot create GLX context"
);
msg_Err
(
vd
,
"cannot create GLX context"
);
...
@@ -334,38 +329,6 @@ static int Open (vlc_object_t *obj)
...
@@ -334,38 +329,6 @@ static int Open (vlc_object_t *obj)
if
(
!
glXMakeContextCurrent
(
dpy
,
sys
->
glwin
,
sys
->
glwin
,
sys
->
ctx
))
if
(
!
glXMakeContextCurrent
(
dpy
,
sys
->
glwin
,
sys
->
glwin
,
sys
->
ctx
))
goto
error
;
goto
error
;
}
else
{
/* GLX 1.2 */
int
attr
[]
=
{
GLX_RGBA
,
GLX_RED_SIZE
,
5
,
GLX_GREEN_SIZE
,
5
,
GLX_BLUE_SIZE
,
5
,
GLX_DOUBLEBUFFER
,
None
};
XVisualInfo
*
vi
=
glXChooseVisual
(
dpy
,
snum
,
attr
);
if
(
vi
==
NULL
)
{
msg_Err
(
vd
,
"cannot find GLX 1.2 visual"
);
goto
error
;
}
msg_Dbg
(
vd
,
"using GLX visual ID 0x%"
PRIx32
,
(
uint32_t
)
vi
->
visualid
);
if
(
CreateWindow
(
vd
,
conn
,
depth
,
0
/* ??? */
,
width
,
height
)
==
0
)
sys
->
ctx
=
glXCreateContext
(
dpy
,
vi
,
0
,
True
);
XFree
(
vi
);
if
(
sys
->
ctx
==
NULL
)
{
msg_Err
(
vd
,
"cannot create GLX context"
);
goto
error
;
}
if
(
glXMakeCurrent
(
dpy
,
sys
->
window
,
sys
->
ctx
)
==
False
)
goto
error
;
sys
->
glwin
=
sys
->
window
;
}
const
char
*
glx_extensions
=
glXQueryExtensionsString
(
dpy
,
snum
);
const
char
*
glx_extensions
=
glXQueryExtensionsString
(
dpy
,
snum
);
...
@@ -450,12 +413,8 @@ static void Close (vlc_object_t *obj)
...
@@ -450,12 +413,8 @@ static void Close (vlc_object_t *obj)
if
(
sys
->
ctx
!=
NULL
)
if
(
sys
->
ctx
!=
NULL
)
{
{
if
(
sys
->
v1_3
)
glXMakeContextCurrent
(
dpy
,
None
,
None
,
NULL
);
glXMakeContextCurrent
(
dpy
,
None
,
None
,
NULL
);
else
glXMakeCurrent
(
dpy
,
None
,
NULL
);
glXDestroyContext
(
dpy
,
sys
->
ctx
);
glXDestroyContext
(
dpy
,
sys
->
ctx
);
if
(
sys
->
v1_3
)
glXDestroyWindow
(
dpy
,
sys
->
glwin
);
glXDestroyWindow
(
dpy
,
sys
->
glwin
);
}
}
XCloseDisplay
(
dpy
);
XCloseDisplay
(
dpy
);
...
...
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