]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/blob - kmscube/cube.cpp
14c340aa566c0156295c15c00e796ce706825dbd
[android/external-libkmsxx.git] / kmscube / cube.cpp
1 /*
2  * Copyright (c) 2012 Arvin Schnell <arvin.schnell@gmail.com>
3  * Copyright (c) 2012 Rob Clark <rob@ti.com>
4  * Copyright (c) 2015 Tomi Valkeinen <tomi.valkeinen@ti.com>
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sub license,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial portions
15  * of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23  * DEALINGS IN THE SOFTWARE.
24  */
26 /* Based on a egl cube test app originally written by Arvin Schnell */
28 #include "cube.h"
29 #include "opts.h"
30 #include "test.h"
32 using namespace std;
34 bool s_verbose;
36 int main(int argc, char *argv[])
37 {
38         OptionSet optionset = {
39                 Option("v|verbose",
40                 [&]()
41                 {
42                         s_verbose = true;
43                 }),
44         };
46         optionset.parse(argc, argv);
48         string m;
50         if (optionset.params().size() == 0)
51                 m = "gbm";
52         else
53                 m = optionset.params().front();
55         if (m == "gbm")
56                 main_gbm();
57         else if (m == "null")
58                 main_null();
59         else if (m == "x")
60                 main_x11();
61         else if (m == "wl")
62                 main_wl();
63         else {
64                 printf("Unknown mode %s\n", m.c_str());
65                 return -1;
66         }
68         return 0;
69 }