annotate client/main.cpp @ 182:3107ce017c3a

Misc: switch back to SDL Qt Quick and QML was an exciting experiment but it's definitely not enough flexible and easy to use for game development. Using SDL2 will let us focusing on our own drawing functions without any kind of overhead. While here, start massive cleanup.
author David Demelier <markand@malikania.fr>
date Fri, 19 Oct 2018 20:18:19 +0200
parents
children bfc6b9c9081a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
182
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 /*
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 * main.cpp -- main client file
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 *
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 * Copyright (c) 2013-2018 David Demelier <markand@malikania.fr>
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 *
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 * Permission to use, copy, modify, and/or distribute this software for any
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 * purpose with or without fee is hereby granted, provided that the above
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 * copyright notice and this permission notice appear in all copies.
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 *
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 */
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 #include <iostream>
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 #include <malikania/client/client.hpp>
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 #include <malikania/client/connection.hpp>
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 #include <malikania/client/state/login_state.hpp>
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 #include <malikania/client/window.hpp>
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
25
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 int main()
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 {
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 boost::asio::io_service service;
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
29
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 mlk::client::connection conn(service);
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 mlk::client::window w;
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 mlk::client::client clt(service, conn, w);
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
33
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 clt.set_state(std::make_unique<mlk::client::login_state>(clt));
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 clt.run();
3107ce017c3a Misc: switch back to SDL
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 }