view src/main.c @ 1:03f6d572fd17

core: implement basic drawing, closes #2438
author David Demelier <markand@malikania.fr>
date Mon, 06 Jan 2020 13:06:52 +0100
parents efcc908bca21
children cd58eabb7fb4
line wrap: on
line source

/*
 * main.c -- Molko's Adventure
 *
 * Copyright (c) 2020 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 <stdio.h>

#include "window.h"

int
main(int argc, char **argv)
{
	(void)argc;
	(void)argv;

	struct window *w = window_init("Molko's Adventure", 640, 480);

	window_set_color(w, 0x667788ff);
	window_clear(w);
	window_set_color(w, 0xffffffff);
	window_draw_line(w, 50, 50, 100, 100);
	window_draw_point(w, 60, 60);
	window_draw_rectangle(w, true, 20, 20, 70, 10);
	window_present(w);
	SDL_Delay(5000);

	return 0;
}