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 "mir/default_server_configuration.h"
24
#include "mir/report_exception.h"
27
namespace me = mir::examples;
29
///\page demo_inprocess_egl demo_inprocess_egl.cpp: A simple use of egl in process
31
/// The main() function uses a default configuration for Mir and sets up an InprocessEGLClient
32
/// that accesses the graphics platform and surface factory.
33
/// \snippet demo_inprocess_egl.cpp main_tag
34
/// This InprocessEGLClient sets up a single surface
35
/// \snippet inprocess_egl_client.cpp setup_tag
36
/// And loops updating the surface
37
/// \snippet inprocess_egl_client.cpp loop_tag
39
int main(int argc, char const* argv[])
42
///\internal [main_tag]
43
mir::DefaultServerConfiguration config(argc, argv);
45
std::shared_ptr<me::InprocessEGLClient> client;
46
mir::run_mir(config, [&config, &client](mir::DisplayServer&)
48
client = std::make_shared<me::InprocessEGLClient>(
49
config.the_main_loop(),
50
config.the_graphics_platform(),
51
config.the_shell_surface_factory());
53
///\internal [main_tag]
59
mir::report_exception(std::cerr);