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
23a3b777
Vérifiée
Valider
23a3b777
rédigé
5 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Cleaning, nothing is showing in the window
parent
61df93a2
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
+40
-36
40 ajouts, 36 suppressions
src/module/module_sdl2.c
avec
40 ajouts
et
36 suppressions
src/module/module_sdl2.c
+
40
−
36
Voir le fichier @
23a3b777
...
@@ -129,22 +129,6 @@ module_sdl2_new(struct lkt_win *const win)
...
@@ -129,22 +129,6 @@ module_sdl2_new(struct lkt_win *const win)
return
false
;
return
false
;
struct
module_sdl2_window
*
sdl2
=
win
->
window
;
struct
module_sdl2_window
*
sdl2
=
win
->
window
;
mpv_render_param
params
[]
=
{
{
MPV_RENDER_PARAM_API_TYPE
,
MPV_RENDER_API_TYPE_OPENGL
},
{
MPV_RENDER_PARAM_OPENGL_INIT_PARAMS
,
&
(
mpv_opengl_init_params
)
{
.
get_proc_address
=
get_proc_address_mpv
,
}
},
{
MPV_RENDER_PARAM_ADVANCED_CONTROL
,
&
(
int
)
{
1
}
},
{
0
}
};
if
(
sdl2
==
NULL
)
{
if
(
sdl2
==
NULL
)
{
sdl2
=
calloc
(
1
,
sizeof
(
struct
module_sdl2_window
));
sdl2
=
calloc
(
1
,
sizeof
(
struct
module_sdl2_window
));
...
@@ -168,35 +152,55 @@ module_sdl2_new(struct lkt_win *const win)
...
@@ -168,35 +152,55 @@ module_sdl2_new(struct lkt_win *const win)
sdl2
->
glcontext
=
SDL_GL_CreateContext
(
sdl2
->
window
);
sdl2
->
glcontext
=
SDL_GL_CreateContext
(
sdl2
->
window
);
if
(
!
sdl2
->
glcontext
)
if
(
!
sdl2
->
glcontext
)
goto
error
;
goto
error
;
}
/* Init mpv here */
/* Init mpv here */
if
(
init_mpv__
(
&
sdl2
->
mpv
))
if
(
init_mpv__
(
&
sdl2
->
mpv
))
goto
error
;
goto
error
;
/* Init opengl with mpv and sdl2 */
mpv_render_param
params
[]
=
{
if
(
mpv_render_context_create
(
&
sdl2
->
mpv_gl
,
sdl2
->
mpv
,
params
)
<
0
)
{
MPV_RENDER_PARAM_API_TYPE
,
MPV_RENDER_API_TYPE_OPENGL
},
goto
error
;
{
MPV_RENDER_PARAM_OPENGL_INIT_PARAMS
,
&
(
mpv_opengl_init_params
)
{
.
get_proc_address
=
get_proc_address_mpv
,
}
},
{
MPV_RENDER_PARAM_ADVANCED_CONTROL
,
&
(
int
)
{
1
}
},
{
0
}
};
fprintf
(
stderr
,
" * Successfully created the SDL2 window
\n
"
);
/* Init mpv_gl here */
wakeup_on_mpv_render_update
=
SDL_RegisterEvents
(
1
);
if
(
init_mpv_gl__
(
sdl2
->
mpv
,
&
sdl2
->
mpv_gl
,
params
))
wakeup_on_mpv_events
=
SDL_RegisterEvents
(
1
);
goto
error
;
if
(
wakeup_on_mpv_render_update
==
(
Uint32
)
-
1
||
wakeup_on_mpv_events
==
(
Uint32
)
-
1
)
goto
error
;
mpv_set_wakeup_callback
(
sdl2
->
mpv
,
on_mpv_events
,
NULL
);
if
(
sdl2
->
mpv
==
NULL
&&
init_mpv__
(
&
sdl2
->
mpv
))
mpv_render_context_set_update_callback
(
sdl2
->
mpv_gl
,
on_mpv_render_update
,
NULL
)
;
goto
error
;
/* Init mpv_gl here */
if
(
sdl2
->
mpv_gl
==
NULL
)
{
mpv_render_param
params
[]
=
{
{
MPV_RENDER_PARAM_API_TYPE
,
MPV_RENDER_API_TYPE_OPENGL
},
{
MPV_RENDER_PARAM_OPENGL_INIT_PARAMS
,
&
(
mpv_opengl_init_params
)
{
.
get_proc_address
=
get_proc_address_mpv
,
}
},
{
MPV_RENDER_PARAM_ADVANCED_CONTROL
,
&
(
int
)
{
1
}
},
{
0
}
};
if
(
init_mpv_gl__
(
sdl2
->
mpv
,
&
sdl2
->
mpv_gl
,
params
))
if
(
init_mpv_gl__
(
sdl2
->
mpv
,
&
sdl2
->
mpv_gl
,
params
))
goto
error
;
goto
error
;
}
}
if
(
sdl2
->
mpv
==
NULL
&&
init_mpv__
(
&
sdl2
->
mpv
))
goto
error
;
if
(
sdl2
->
mpv_gl
==
NULL
&&
init_mpv_gl__
(
sdl2
->
mpv
,
&
sdl2
->
mpv_gl
,
params
))
goto
error
;
SDL_SetWindowTitle
(
sdl2
->
window
,
"Lektord"
);
SDL_SetWindowTitle
(
sdl2
->
window
,
"Lektord"
);
SDL_DisableScreenSaver
();
SDL_DisableScreenSaver
();
win
->
window
=
sdl2
;
win
->
window
=
sdl2
;
...
...
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