Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
93673b8d
Vérifiée
Valider
93673b8d
rédigé
5 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Draw won't draw in the SDL window
parent
6f61189f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!57
Resolve "SDL2 module"
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
src/module/module_sdl2.c
+8
-16
8 ajouts, 16 suppressions
src/module/module_sdl2.c
avec
8 ajouts
et
16 suppressions
src/module/module_sdl2.c
+
8
−
16
Voir le fichier @
93673b8d
...
@@ -52,15 +52,11 @@ sdl_thread__(struct lkt_thread_arg *arg)
...
@@ -52,15 +52,11 @@ sdl_thread__(struct lkt_thread_arg *arg)
int
w
,
h
;
int
w
,
h
;
free
(
arg
);
free
(
arg
);
(
void
)
self
;
(
void
)
self
;
RETURN_UNLESS
(
sdl2
,
"Big nope here, the sdl window pointer is NULL"
,
NULL
);
RETURN_UNLESS
(
sdl2
&&
sdl2
->
window
,
"Big nope here, the sdl window pointer is NULL"
,
NULL
);
fprintf
(
stderr
,
" * Started SDL thread
\n
"
);
fprintf
(
stderr
,
" * Started SDL thread
\n
"
);
/* SDL events won't change the database, only the mpv one's will.
Do this to be able to put the SDL stuff inside a thread and don't change
to much things. */
loop:
loop:
if
(
!
SDL_PollEvent
(
&
event
))
RETURN_UNLESS
(
SDL_WaitEvent
(
&
event
),
"Failed to wait SDL event"
,
NULL
);
sched_yield
();
switch
(
event
.
type
)
{
switch
(
event
.
type
)
{
case
SDL_QUIT
:
case
SDL_QUIT
:
...
@@ -70,8 +66,8 @@ loop:
...
@@ -70,8 +66,8 @@ loop:
case
SDL_WINDOWEVENT
:
case
SDL_WINDOWEVENT
:
if
(
event
.
window
.
event
==
SDL_WINDOWEVENT_EXPOSED
)
if
(
event
.
window
.
event
==
SDL_WINDOWEVENT_EXPOSED
)
redraw
=
1
;
redraw
=
1
;
break
;
break
;
case
SDL_KEYDOWN
:
case
SDL_KEYDOWN
:
if
(
event
.
key
.
keysym
.
sym
==
SDLK_SPACE
)
{
if
(
event
.
key
.
keysym
.
sym
==
SDLK_SPACE
)
{
const
char
*
cmd_pause
[]
=
{
"cycle"
,
"pause"
,
NULL
};
const
char
*
cmd_pause
[]
=
{
"cycle"
,
"pause"
,
NULL
};
...
@@ -81,14 +77,12 @@ loop:
...
@@ -81,14 +77,12 @@ loop:
case
SDL_KEYUP
:
case
SDL_KEYUP
:
if
(
event
.
key
.
keysym
.
sym
==
SDLK_F11
)
{
if
(
event
.
key
.
keysym
.
sym
==
SDLK_F11
)
{
if
(
sdl2
->
is_fullscreen
)
{
if
(
sdl2
->
is_fullscreen
)
SDL_SetWindowFullscreen
(
sdl2
->
window
,
0
);
SDL_SetWindowFullscreen
(
sdl2
->
window
,
0
);
sdl2
->
is_fullscreen
=
0
;
else
}
else
{
/* May use SDL_WINDOW_FULLSCREEN_DESKTOP, need to check. */
SDL_SetWindowFullscreen
(
sdl2
->
window
,
SDL_WINDOW_FULLSCREEN
);
SDL_SetWindowFullscreen
(
sdl2
->
window
,
SDL_WINDOW_FULLSCREEN
);
sdl2
->
is_fullscreen
=
1
;
/* May use SDL_WINDOW_FULLSCREEN_DESKTOP, need to check. */
}
sdl2
->
is_fullscreen
=
1
-
sdl2
->
is_fullscreen
;
}
}
break
;
break
;
...
@@ -158,9 +152,7 @@ on_mpv_render_update(void *ctx)
...
@@ -158,9 +152,7 @@ on_mpv_render_update(void *ctx)
extern
int
extern
int
module_set_function
(
void
*
arg__
,
void
*
handle__
)
module_set_function
(
void
*
arg__
,
void
*
handle__
)
{
{
if
(
NULL
==
arg__
||
handle__
==
NULL
)
RETURN_UNLESS
(
arg__
&&
handle__
,
"Invalid argument"
,
1
);
return
1
;
struct
lkt_win
*
win
=
(
struct
lkt_win
*
)
arg__
;
struct
lkt_win
*
win
=
(
struct
lkt_win
*
)
arg__
;
win
->
new
=
module_sdl2_new
;
win
->
new
=
module_sdl2_new
;
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter