Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
a2983659
Commit
a2983659
authored
Jul 19, 2010
by
Sunny Sachanandani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respect environment variables.
parent
4ded0f62
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
29 deletions
+100
-29
SDL_error.c
src/SDL_error.c
+1
-1
SDL_x11render.c
src/video/x11/SDL_x11render.c
+91
-28
SDL_x11sym.h
src/video/x11/SDL_x11sym.h
+2
-0
SDL_x11video.h
src/video/x11/SDL_x11video.h
+6
-0
No files found.
src/SDL_error.c
View file @
a2983659
...
...
@@ -38,7 +38,7 @@ extern SDL_error *SDL_GetErrBuf(void);
#define SDL_ERRBUFIZE 1024
#define DEBUG_ERROR
//
#define DEBUG_ERROR
/* Private functions */
...
...
src/video/x11/SDL_x11render.c
View file @
a2983659
...
...
@@ -176,11 +176,87 @@ UpdateYUVTextureData(SDL_Texture * texture)
texture
->
h
,
data
->
pixels
,
data
->
pitch
);
}
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
static
SDL_bool
CheckXRender
(
Display
*
display
,
int
*
major
,
int
*
minor
)
{
const
char
*
env
;
*
major
=
*
minor
=
0
;
env
=
SDL_getenv
(
"SDL_VIDEO_X11_XRENDER"
);
if
(
env
&&
!
SDL_atoi
(
env
))
{
return
SDL_FALSE
;
}
if
(
!
SDL_X11_HAVE_XRENDER
)
{
return
SDL_FALSE
;
}
if
(
!
XRenderQueryVersion
(
display
,
major
,
minor
))
{
return
SDL_FALSE
;
}
return
SDL_TRUE
;
}
#endif
#ifdef SDL_VIDEO_DRIVER_X11_XFIXES
static
SDL_bool
CheckXFixes
(
Display
*
display
,
int
*
major
,
int
*
minor
)
{
const
char
*
env
;
*
major
=
*
minor
=
0
;
env
=
SDL_getenv
(
"SDL_VIDEO_X11_XFIXES"
);
if
(
env
&&
!
SDL_atoi
(
env
))
{
return
SDL_FALSE
;
}
if
(
!
SDL_X11_HAVE_XFIXES
)
{
return
SDL_FALSE
;
}
if
(
!
XFixesQueryVersion
(
display
,
major
,
minor
))
{
return
SDL_FALSE
;
}
return
SDL_TRUE
;
}
#endif
#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
static
SDL_bool
CheckXDamage
(
Display
*
display
,
int
*
major
,
int
*
minor
)
{
const
char
*
env
;
*
major
=
*
minor
=
0
;
env
=
SDL_getenv
(
"SDL_VIDEO_X11_XDAMAGE"
);
if
(
env
&&
!
SDL_atoi
(
env
))
{
return
SDL_FALSE
;
}
if
(
!
SDL_X11_HAVE_XDAMAGE
)
{
return
SDL_FALSE
;
}
if
(
!
XDamageQueryVersion
(
display
,
major
,
minor
))
{
return
SDL_FALSE
;
}
return
SDL_TRUE
;
}
#endif
void
X11_AddRenderDriver
(
_THIS
)
{
SDL_RendererInfo
*
info
=
&
X11_RenderDriver
.
info
;
SDL_DisplayMode
*
mode
=
&
SDL_CurrentDisplay
->
desktop_mode
;
SDL_VideoData
*
data
=
(
SDL_VideoData
*
)
_this
->
driverdata
;
int
i
;
info
->
texture_formats
[
info
->
num_texture_formats
++
]
=
mode
->
format
;
...
...
@@ -189,7 +265,13 @@ X11_AddRenderDriver(_THIS)
info
->
texture_formats
[
info
->
num_texture_formats
++
]
=
SDL_PIXELFORMAT_YUY2
;
info
->
texture_formats
[
info
->
num_texture_formats
++
]
=
SDL_PIXELFORMAT_UYVY
;
info
->
texture_formats
[
info
->
num_texture_formats
++
]
=
SDL_PIXELFORMAT_YVYU
;
info
->
texture_formats
[
info
->
num_texture_formats
++
]
=
SDL_PIXELFORMAT_ARGB8888
;
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
int
major
,
minor
;
if
(
CheckXRender
(
data
->
display
,
&
major
,
&
minor
))
{
info
->
texture_formats
[
info
->
num_texture_formats
++
]
=
SDL_PIXELFORMAT_ARGB8888
;
}
#endif
for
(
i
=
0
;
i
<
_this
->
num_displays
;
++
i
)
{
SDL_AddRenderDriver
(
&
_this
->
displays
[
i
],
&
X11_RenderDriver
);
...
...
@@ -255,36 +337,17 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags)
renderer
->
info
.
flags
=
SDL_RENDERER_ACCELERATED
;
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
data
->
use_xrender
=
SDL_FALSE
;
data
->
use_xdamage
=
SDL_FALSE
;
int
event_basep
,
error_basep
;
if
(
SDL_X11_HAVE_XRENDER
)
{
/* Query the extension. This is the server runtime check. */
if
(
XRenderQueryExtension
(
data
->
display
,
&
event_basep
,
&
error_basep
)
==
True
)
data
->
use_xrender
=
SDL_TRUE
;
}
int
major
,
minor
;
data
->
use_xrender
=
CheckXRender
(
data
->
display
,
&
major
,
&
minor
);
#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
if
(
data
->
use_xrender
)
{
if
(
SDL_X11_HAVE_XDAMAGE
&&
SDL_X11_HAVE_XFIXES
)
{
/* Query XDamage and XFixes */
if
(
XDamageQueryExtension
(
data
->
display
,
&
event_basep
,
&
error_basep
)
==
True
&&
(
XFixesQueryExtension
(
data
->
display
,
&
event_basep
,
&
error_basep
)
==
True
))
{
int
major_version
,
minor_version
;
XFixesQueryVersion
(
data
->
display
,
&
major_version
,
&
minor_version
);
/* Only XFixes v 2 or greater
* Required for XFixesSetPictureClipRegion() */
if
(
major_version
>=
2
)
data
->
use_xdamage
=
SDL_TRUE
;
}
if
(
CheckXDamage
(
data
->
display
,
&
major
,
&
minor
))
{
if
(
CheckXFixes
(
data
->
display
,
&
major
,
&
minor
))
{
if
(
major
>=
2
)
data
->
use_xdamage
=
SDL_TRUE
;
}
}
#endif
if
(
data
->
use_xrender
)
{
/* Find the PictFormat from the visual.
* Should be an RGB PictFormat most of the time. */
data
->
xwindow_pict_fmt
=
XRenderFindVisualFormat
(
data
->
display
,
...
...
src/video/x11/SDL_x11sym.h
View file @
a2983659
...
...
@@ -240,6 +240,7 @@ SDL_X11_SYM(void,XScreenSaverSuspend,(Display *dpy,Bool suspend),(dpy,suspend),r
#if SDL_VIDEO_DRIVER_X11_XRENDER
SDL_X11_MODULE
(
XRENDER
)
SDL_X11_SYM
(
Bool
,
XRenderQueryExtension
,(
Display
*
dpy
,
int
*
event_base
,
int
*
error_base
),(
dpy
,
event_base
,
error_base
),
return
)
SDL_X11_SYM
(
Bool
,
XRenderQueryVersion
,(
Display
*
dpy
,
int
*
major
,
int
*
minor
),(
dpy
,
major
,
minor
),
return
)
SDL_X11_SYM
(
XRenderPictFormat
*
,
XRenderFindVisualFormat
,(
Display
*
dpy
,
_Xconst
Visual
*
visual
),(
dpy
,
visual
),
return
)
SDL_X11_SYM
(
XRenderPictFormat
*
,
XRenderFindStandardFormat
,(
Display
*
dpy
,
int
format
),(
dpy
,
format
),
return
)
SDL_X11_SYM
(
XRenderPictFormat
*
,
XRenderFindFormat
,(
Display
*
dpy
,
unsigned
long
mask
,
_Xconst
XRenderPictFormat
*
templ
,
int
count
),(
dpy
,
mask
,
templ
,
count
),
return
)
...
...
@@ -256,6 +257,7 @@ SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst
#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
SDL_X11_MODULE
(
XDAMAGE
)
SDL_X11_SYM
(
Bool
,
XDamageQueryExtension
,(
Display
*
dpy
,
int
*
event_base_return
,
int
*
error_base_return
),(
dpy
,
event_base_return
,
error_base_return
),
return
)
SDL_X11_SYM
(
Status
,
XDamageQueryVersion
,(
Display
*
dpy
,
int
*
major
,
int
*
minor
),(
dpy
,
major
,
minor
),
return
)
SDL_X11_SYM
(
Damage
,
XDamageCreate
,(
Display
*
dpy
,
Drawable
d
,
int
level
),(
dpy
,
d
,
level
),
return
)
SDL_X11_SYM
(
void
,
XDamageSubtract
,(
Display
*
dpy
,
Damage
damage
,
XserverRegion
repair
,
XserverRegion
parts
),(
dpy
,
damage
,
repair
,
parts
),
return
)
SDL_X11_SYM
(
void
,
XDamageDestroy
,(
Display
*
dpy
,
Damage
damage
),(
dpy
,
damage
),
return
)
...
...
src/video/x11/SDL_x11video.h
View file @
a2983659
...
...
@@ -48,6 +48,12 @@
#if SDL_VIDEO_DRIVER_X11_XRENDER
#include <X11/extensions/Xrender.h>
#endif
#if SDL_VIDEO_DRIVER_X11_XDAMAGE
#include <X11/extensions/Xdamage.h>
#endif
#if SDL_VIDEO_DRIVER_X11_XFIXES
#include <X11/extensions/Xfixes.h>
#endif
#include "SDL_x11dyn.h"
#include "SDL_x11events.h"
...
...
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