view client/main.cpp @ 152:16f27d6543bf

Client: do not catch handler result While here, also fix an infinite handler call because the output queue is not popped after execution. Also rename read to recv.
author David Demelier <markand@malikania.fr>
date Wed, 13 Dec 2017 13:45:00 +0100
parents 473e1eb96363
children 43a26de57fe7
line wrap: on
line source

/*
 * main.cpp -- main client file
 *
 * Copyright (c) 2013-2017 David Demelier <markand@malikania.fr>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <iostream>

#include <malikania/client/client.hpp>
#include <malikania/client/connection.hpp>
#include <malikania/client/state/splashscreen_state.hpp>
#include <malikania/client/window.hpp>

namespace res {

namespace {

#include <kingthings_spike.hpp>

} // !namespace

} // !res

int main()
{
    boost::asio::io_service service;

    mlk::client::connection conn(service);
    mlk::client::window w;
    mlk::client::client clt(service, conn, w);
    mlk::client::font f(std::string(res::kingthings_spike, sizeof (res::kingthings_spike)), 64);

    clt.set_state(std::make_unique<mlk::client::splashscreen_state>(std::move(f), "Malikania Kingdom"));
    clt.run();
}