README.md 2.31 KB
Newer Older
1
# RetroGTK
2

Adrien Plazas's avatar
Adrien Plazas committed
3
The GTK Libretro frontend framework.
4
5
6
7
8

[Libretro](https://www.libretro.com/) is a plugin format design to implement
video game console emulators, video games and similar multimedia software. Such
plugins are called Libretro cores.

9
RetroGTK is a framework easing the use of Libretro cores in conjunction with
Adrien Plazas's avatar
Adrien Plazas committed
10
[GTK](https://www.gtk.org/).
11
12
13

It encourages the cores to be installed in a well defined centralized place —
namely the `libretro` subdirectory of your `lib` directory — and it recommends
14
them to come with [Libretro core descriptors](https://gnome.pages.gitlab.gnome.org/retro-gtk/doc/master/libretro-core-descriptor.html).
Adrien Plazas's avatar
Adrien Plazas committed
15

16
17
## Example

18
Writing a Libretro application with RetroGTK can be as simple as the following
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Vala code:

```vala
int main (string[] args) {
    Gtk.init (ref args);

    var core = new Retro.Core ("/path/to/your/core_libretro.so");
    core.set_medias ({ "file:///uri/of/you/game.file" });
    try {
        core.boot();
    }
    catch (Error e) {
        critical (e.message);

        return 1;
    }

    var view = new Retro.CoreView ();
    view.set_as_default_controller (core);
    view.set_core (core);
    view.show ();

    var loop = new Retro.MainLoop (core);
    loop.start ();

    var win = new Gtk.Window ();
    win.destroy.connect (Gtk.main_quit);
    win.add (view);
    win.present ();

    Gtk.main ();

    return 0;
}
```

Adrien Plazas's avatar
Adrien Plazas committed
55
56
## Dependencies

57
RetroGTK depends on the following libraries at compile time and at run time:
Adrien Plazas's avatar
Adrien Plazas committed
58
59
- gobject-2.0
- glib-2.0
Adrien Plazas's avatar
Adrien Plazas committed
60
- gio-2.0
61
- gmodule-2.0
Adrien Plazas's avatar
Adrien Plazas committed
62
63
64
- gtk+-3.0
- cairo
- libpulse
65
- libpulse-simple
66

67
## Compiling
68

Adrien Plazas's avatar
Adrien Plazas committed
69
To configure the compilation, do:
70
`meson build`
Adrien Plazas's avatar
Adrien Plazas committed
71
72

You can specify the installation prefix by doing:
73
`meson build --prefix /my/prefix`
74

Adrien Plazas's avatar
Adrien Plazas committed
75
Then compile:
76
`ninja -C build`
77
78

## Installing
79

80
`ninja -C build install`
81
82
83
84
85
86
87
88
89
90
91
92
93
94

## Implemented

The Libretro API extracted from RetroArch 1.7.2 can be found in
`libretro/libretro.h`. `libretro/implemented.h` is a version of this file
containing only the parts that have been implemented in RetroGTK.

To know what is yet to be implemented, run the following command:
`diff libretro/implemented.h libretro/libretro.h`

Parts which have been partially implemented can be found by looking for the
`UNIMPLEMENTED` keyword in the code base, typically found in comments or macros.
To do so, run the following command:
`git grep UNIMPLEMENTED`