Add example to TCC melibc #2

git-svn-id: svn://kolibrios.org@8231 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack 2020-11-21 13:31:00 +00:00
parent de1d5c1767
commit f75ba1987d
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,3 @@
MENUETDEV = $(abspath ../../../../../libraries/menuetlibc)
all:
wine kos32-tcc.exe -o hello.kex hello.c -lmelibc -I $(MENUETDEV)/include

View File

@ -0,0 +1,32 @@
#include <menuet/os.h>
char title[] = "Menuetlibc in TinyC";
char string[] = "Text";
void draw_window(void)
{
// start redraw
__menuet__window_redraw(1);
// define&draw window
__menuet__define_window(10,40,300,150,0x33FFFFFF,0,(__u32)title);
// display string
__menuet__write_text(30,10,0x80000000,string,0);
// end redraw
__menuet__window_redraw(2);
}
int main()
{
draw_window();
for (;;)
{
switch (__menuet__wait_for_event())
{
case 1:
draw_window();
break;
case 3:
return;
}
}
}