diff options
Diffstat (limited to 'src/main/engine/ui/x11/ui.c')
-rw-r--r-- | src/main/engine/ui/x11/ui.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/engine/ui/x11/ui.c b/src/main/engine/ui/x11/ui.c index 2501f5c..3c302b1 100644 --- a/src/main/engine/ui/x11/ui.c +++ b/src/main/engine/ui/x11/ui.c @@ -114,16 +114,22 @@ ui_set_title(const char *title) XStoreName(display, window, title); } +/* + * This is the function used to init a UI. + */ UI * -ui_init(int width, int height) +ui_new(int width, int height) { init_log(); + /* Inizilize the UI */ UI *ui = malloc(sizeof(UI)); if (ui == NULL) { - log_error(log, "Error allocating UI"); - exit(1); + log_error(log, "Error allocating the UI"); + exit(EXIT_FAILURE); } + ui->width = width; + ui->height = height; display = ui_open_display(); @@ -140,9 +146,6 @@ ui_init(int width, int height) exit(1); } - ui->width = width; - ui->height = height; - return ui; } |