aboutsummaryrefslogtreecommitdiff
path: root/apps/wm.c
blob: c5347e4611ed78403ea930394dc519bc28df9f15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// MIT License, Copyright (c) 2020 Marvin Borner

#include <cpu.h>
#include <def.h>
#include <gui.h>
#include <input.h>
#include <print.h>
#include <sys.h>
#include <vesa.h>

void onkey(u32 scancode)
{
	printf("KEY EVENT %d\n", scancode);
	if (KEY_ALPHANUMERIC(scancode)) {
		printf("ALPHANUMERIC!\n");
	}
}

int main(int argc, char **argv)
{
	struct vbe *vbe = (struct vbe *)argv[1];

	printf("%x\n", argc);
	printf("%s loaded.\n", argv[0]);
	printf("VBE: %dx%d\n", vbe->width, vbe->height);

	const u32 color[3] = { 0, 0, 0 };
	const u32 text[3] = { 0xff, 0xff, 0xff };
	vesa_fill(vbe, color);
	gui_init("/font/spleen-16x32.psfu");
	gui_write(vbe, 50, 50, text, "hallo");

	/* printf("onkey: %x\n", onkey); */
	/* map(EVENT_KEYBOARD, onkey); */

	while (1) {
	};
	return 0;
}