view mlk-client/main.cpp @ 199:9ef01392a7f1

tests: make a database test fixture, closes #939 @4h Start PostgreSQL for each test in a clean directory and initialize a malikaniadb within. Only enable unix domain sockets to avoid collision with a system instance. While here, move out the init script into a dedicated file until we find a good solution for initializing databases and upgrading.
author David Demelier <markand@malikania.fr>
date Tue, 30 Oct 2018 13:21:55 +0100
parents 209bdaa13a49
children 0a285d62ace7
line wrap: on
line source

/*
 * main.cpp -- main client file
 *
 * Copyright (c) 2013-2018 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 <chrono>
#include <thread>

#include <malikania/client/color.hpp>
#include <malikania/client/button.hpp>
#include <malikania/client/window.hpp>

using namespace mlk;
using namespace mlk::client;

int main()
{
	window w;

	//SDL_RenderSetScale(w.get_renderer(), 2, 2);
	button b("click me");

	b.set_position({50, 50});
	b.set_size({100, 20});

	w.set_drawing_color(color::from_name("white"));
	w.clear();
	b.draw(w);
	w.present();
	std::this_thread::sleep_for(std::chrono::seconds(10));


#if 0
	boost::asio::io_service service;

	mlk::client::connection conn(service);
	mlk::client::window w;
	mlk::client::client clt(service, conn, w);

	clt.set_state(std::make_unique<mlk::client::login_state>(clt));
	clt.run();
#endif
}