TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / platform / base_platform.cpp
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #include "anbox/platform/base_platform.h"
19 #include "anbox/platform/null/platform.h"
20 #include "anbox/platform/sdl/platform.h"
21 #include "anbox/logger.h"
22
23 namespace anbox {
24 namespace platform {
25 std::shared_ptr<BasePlatform> create(const std::string &name,
26                                      const std::shared_ptr<input::Manager> &input_manager,
27                                      const Configuration &config) {
28   if (name.empty())
29     return std::make_shared<NullPlatform>();
30
31   if (name == "sdl")
32     return std::make_shared<sdl::Platform>(input_manager, config);
33
34   WARNING("Unsupported platform '%s'", name);
35
36   return nullptr;
37 }
38 } // namespace platform
39 } // namespace anbox