Add example

git-svn-id: svn://kolibrios.org@8144 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack
2020-11-06 13:40:38 +00:00
parent 22c8fa4272
commit d45967888e
7 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
SVN_BCC32:=../..
T2FASM:=$(SVN_BCC32)/t2fasm
INCLUDE:=$(SVN_BCC32)/include
# Path to Bin folder
KOS32_BCC:=/home/autobuild/borlandcpp/bin
# Filename
FN:=hello
hello_world:
wine $(KOS32_BCC)/kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I$(INCLUDE) $(FN).cpp
echo 'include "kos_make.inc"' > f_$(FN).asm
$(T2FASM)/t2fasm < $(FN).asm >> f_$(FN).asm
fasm f_$(FN).asm $(FN).kex
rm f_$(FN).asm
rm $(FN).asm

View File

@@ -0,0 +1,38 @@
#include <kolibri.h>
#include <kos_heap.h>
#include <kos_file.h>
using namespace Kolibri;
const char header[] = "Title";
const char string[] = "Text";
bool KolibriOnStart(TStartData &kos_start, TThreadData th)
{
kos_start.Left = 10;
kos_start.Top = 40;
kos_start.Width = 150;
kos_start.Height = 80;
kos_start.WinData.WindowColor = 0xFFFFFF;
kos_start.WinData.Title = header;
return true;
}
void KolibriOnPaint(void)
{
DrawText(10, 10, 0, string);
}
bool KolibriOnClose(TThreadData th)
{
return true;
}
int KolibriOnIdle(TThreadData th)
{
return -1;
}
void KolibriOnSize(int window_rect[], TThreadData th) {}
void KolibriOnKeyPress(TThreadData th)
{
GetKey();
}
void KolibriOnMouse(TThreadData th) {}

View File

@@ -0,0 +1,6 @@
kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -Iinclude hello.cpp
echo include "kos_make.inc" > f_hello.asm
t2fasm < hello.asm >> f_hello.asm
fasm f_hello.asm hello.kex
kpack hello.kex
pause

View File

@@ -0,0 +1,7 @@
STACKSIZE equ 102400
HEAPSIZE equ 102400
include "..\..\..\proc32.inc"
include "..\..\include\kos_start.inc"
include "..\..\include\kos_func.inc"
include "..\..\include\kos_heap.inc"