Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| 3 | * Use of this source code is governed by a BSD-style license that can be |
| 4 | * found in the LICENSE file. |
| 5 | */ |
| 6 | |
| 7 | #include <libtsm.h> |
| 8 | #include <stdio.h> |
| 9 | #include <stdlib.h> |
| 10 | #include <unistd.h> |
| 11 | |
Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 12 | #include "input.h" |
| 13 | #include "term.h" |
| 14 | #include "video.h" |
| 15 | |
| 16 | int main() |
| 17 | { |
Stéphane Marchesin | af4423b | 2014-08-13 16:39:24 -0700 | [diff] [blame^] | 18 | int32_t width, height, pitch, scaling; |
Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 19 | int ret; |
| 20 | |
Stéphane Marchesin | af4423b | 2014-08-13 16:39:24 -0700 | [diff] [blame^] | 21 | ret = video_init(&width, &height, &pitch, &scaling); |
Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 22 | if (ret) { |
| 23 | printf("Video init failed\n"); |
| 24 | return EXIT_FAILURE; |
| 25 | } |
| 26 | |
| 27 | ret = input_init(); |
| 28 | if (ret) { |
| 29 | printf("Input init failed\n"); |
| 30 | video_close(); |
| 31 | return EXIT_FAILURE; |
| 32 | } |
| 33 | |
Stéphane Marchesin | af4423b | 2014-08-13 16:39:24 -0700 | [diff] [blame^] | 34 | ret = term_init(width, height, pitch, scaling); |
Stéphane Marchesin | ae37e6c | 2014-08-08 18:19:40 -0700 | [diff] [blame] | 35 | if (ret) { |
| 36 | printf("Term init failed\n"); |
| 37 | input_close(); |
| 38 | video_close(); |
| 39 | return EXIT_FAILURE; |
| 40 | } |
| 41 | |
| 42 | ret = term_run(); |
| 43 | |
| 44 | input_close(); |
| 45 | term_close(); |
| 46 | video_close(); |
| 47 | |
| 48 | return ret; |
| 49 | } |