2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Robert Carr <robert.carr@canonical.com>
19
#include "inprocess_egl_client.h"
21
#include "mir/run_mir.h"
22
#include "server_configuration.h"
24
#include "mir/report_exception.h"
28
namespace me = mir::examples;
30
///\page demo_inprocess_egl demo_inprocess_egl.cpp: A simple use of egl in process
32
/// The main() function uses a default configuration for Mir and sets up an InprocessEGLClient
33
/// that accesses the graphics platform and surface factory.
34
/// \snippet demo_inprocess_egl.cpp main_tag
35
/// This InprocessEGLClient sets up a single surface
36
/// \snippet inprocess_egl_client.cpp setup_tag
37
/// And loops updating the surface
38
/// \snippet inprocess_egl_client.cpp loop_tag
40
int main(int argc, char const* argv[])
43
///\internal [main_tag]
44
me::ServerConfiguration config(argc, argv);
46
std::shared_ptr<me::InprocessEGLClient> client;
48
mir::run_mir(config, [&config, &client](mir::DisplayServer&)
50
client = std::make_shared<me::InprocessEGLClient>(
51
config.the_graphics_platform(),
52
config.the_frontend_shell(),
53
config.the_focus_controller());
55
///\internal [main_tag]
61
mir::report_exception(std::cerr);