[retro-gtk] demo: Use retro_core_view_set_as_default_controller()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] demo: Use retro_core_view_set_as_default_controller()
- Date: Mon, 6 Nov 2017 08:41:23 +0000 (UTC)
commit 3f8892d95188983a543df0fc8212d494eea51735
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon Nov 6 09:20:52 2017 +0100
demo: Use retro_core_view_set_as_default_controller()
This simplifies controller management.
demos/retro-demo.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
---
diff --git a/demos/retro-demo.c b/demos/retro-demo.c
index 2254885..405b90d 100644
--- a/demos/retro-demo.c
+++ b/demos/retro-demo.c
@@ -82,7 +82,6 @@ retro_demo_activate (GApplication *application)
{
RetroDemoApplication *self;
GtkWidget *window;
- RetroController *controller;
self = RETRO_DEMO_APPLICATION (application);
@@ -90,24 +89,10 @@ retro_demo_activate (GApplication *application)
self->view = retro_core_view_new ();
retro_core_view_set_core (self->view, self->core);
+ retro_core_view_set_as_default_controller (self->view, self->core);
retro_core_set_keyboard (self->core, GTK_WIDGET (self->view));
- controller = retro_core_view_as_controller (self->view,
- RETRO_CONTROLLER_TYPE_JOYPAD);
- retro_core_set_default_controller (self->core, controller);
- g_object_unref (controller);
-
- controller = retro_core_view_as_controller (self->view,
- RETRO_CONTROLLER_TYPE_MOUSE);
- retro_core_set_default_controller (self->core, controller);
- g_object_unref (controller);
-
- controller = retro_core_view_as_controller (self->view,
- RETRO_CONTROLLER_TYPE_POINTER);
- retro_core_set_default_controller (self->core, controller);
- g_object_unref (controller);
-
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (self->view));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]