Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
e21895ca
Commit
e21895ca
authored
17 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Only check the video driver once. It cannot change.
parent
d37b4476
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/conio/sdl_con.c
+32
-23
32 additions, 23 deletions
src/conio/sdl_con.c
with
32 additions
and
23 deletions
src/conio/sdl_con.c
+
32
−
23
View file @
e21895ca
...
...
@@ -448,24 +448,9 @@ void exit_sdl_con(void)
sdl_user_func_ret
(
SDL_USEREVENT_QUIT
);
}
#if (defined(__MACH__) && defined(__APPLE__))
int
sdl_using_directx
=
0
;
int
sdl_using_quartz
=
0
;
#endif
#if !defined(NO_X) && defined(__unix__)
int
sdl_using_x11
()
{
char
driver
[
16
];
if
(
sdl
.
VideoDriverName
(
driver
,
sizeof
(
driver
))
==
NULL
)
return
(
FALSE
);
if
(
!
strcmp
(
driver
,
"x11"
))
return
(
TRUE
);
if
(
!
strcmp
(
driver
,
"dga"
))
return
(
TRUE
);
return
(
FALSE
);
}
#endif
int
sdl_using_x11
=
0
;
void
sdl_copytext
(
const
char
*
text
,
size_t
buflen
)
{
...
...
@@ -485,7 +470,7 @@ void sdl_copytext(const char *text, size_t buflen)
#endif
#if !defined(NO_X) && defined(__unix__)
if
(
sdl_x11available
&&
sdl_using_x11
()
)
{
if
(
sdl_x11available
&&
sdl_using_x11
)
{
sdl
.
mutexP
(
sdl_copybuf_mutex
);
FREE_AND_NULL
(
sdl_copybuf
);
...
...
@@ -529,7 +514,7 @@ char *sdl_getcliptext(void)
#endif
#if !defined(NO_X) && defined(__unix__)
if
(
sdl_x11available
&&
sdl_using_x11
()
)
{
if
(
sdl_x11available
&&
sdl_using_x11
)
{
sdl_user_func
(
SDL_USEREVENT_PASTE
,
0
,
0
,
0
,
0
);
sdl
.
SemWait
(
sdl_pastebuf_set
);
if
(
sdl_pastebuf
!=
NULL
)
{
...
...
@@ -1207,8 +1192,14 @@ void setup_surfaces(void)
SDL_Surface
*
tmp_rect
=
NULL
;
SDL_Event
ev
;
if
(
fullscreen
)
if
(
fullscreen
)
{
#if defined(_WIN32)
if
(
sdl_using_directx
)
{
flags
=
SDL_SWSURFACE
|
SDL_ANYFORMAT
;
}
#endif
flags
|=
SDL_FULLSCREEN
;
}
else
flags
|=
SDL_RESIZABLE
;
...
...
@@ -1319,6 +1310,24 @@ int sdl_video_event_thread(void *data)
SDL_Event
ev
;
if
(
!
init_sdl_video
())
{
char
driver
[
16
];
if
(
sdl
.
VideoDriverName
(
driver
,
sizeof
(
driver
))
!=
NULL
)
{
#if defined(_WIN32)
if
(
!
strcmp
(
driver
,
"directx"
))
sdl_using_directx
=
TRUE
;
#endif
#if (defined(__MACH__) && defined(__APPLE__))
if
(
!
strcmp
(
driver
,
"Quartz"
))
sdl_using_quartz
=
TRUE
;
#endif
#if !defined(NO_X) && defined(__unix__)
if
(
!
strcmp
(
driver
,
"x11"
))
sdl_using_x11
=
TRUE
;
if
(
!
strcmp
(
driver
,
"dga"
))
sdl_using_x11
=
TRUE
;
#endif
}
while
(
1
)
{
if
(
sdl
.
WaitEvent
(
&
ev
)
==
1
)
{
switch
(
ev
.
type
)
{
...
...
@@ -1561,7 +1570,7 @@ int sdl_video_event_thread(void *data)
#endif
#if !defined(NO_X) && defined(__unix__)
if
(
sdl_x11available
&&
sdl_using_x11
()
)
{
if
(
sdl_x11available
&&
sdl_using_x11
)
{
SDL_SysWMinfo
wmi
;
SDL_VERSION
(
&
(
wmi
.
version
));
...
...
@@ -1599,7 +1608,7 @@ int sdl_video_event_thread(void *data)
#endif
#if !defined(NO_X) && defined(__unix__)
if
(
sdl_x11available
&&
sdl_using_x11
()
)
{
if
(
sdl_x11available
&&
sdl_using_x11
)
{
Window
sowner
=
None
;
SDL_SysWMinfo
wmi
;
...
...
@@ -1640,7 +1649,7 @@ int sdl_video_event_thread(void *data)
}
case
SDL_SYSWMEVENT
:
/* ToDo... This is where Copy/Paste needs doing */
#if !defined(NO_X) && defined(__unix__)
if
(
sdl_x11available
&&
sdl_using_x11
()
)
{
if
(
sdl_x11available
&&
sdl_using_x11
)
{
XEvent
*
e
;
e
=&
ev
.
syswm
.
msg
->
event
.
xevent
;
switch
(
e
->
type
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment