forked from KolibriOS/kolibrios
Add example
git-svn-id: svn://kolibrios.org@8144 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
18
programs/bcc32/examples/window/Makefile
Executable file
18
programs/bcc32/examples/window/Makefile
Executable 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
|
||||
38
programs/bcc32/examples/window/hello.cpp
Executable file
38
programs/bcc32/examples/window/hello.cpp
Executable 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) {}
|
||||
6
programs/bcc32/examples/window/hello_cpp.bat
Executable file
6
programs/bcc32/examples/window/hello_cpp.bat
Executable 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
|
||||
7
programs/bcc32/examples/window/kos_make.inc
Executable file
7
programs/bcc32/examples/window/kos_make.inc
Executable 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"
|
||||
Reference in New Issue
Block a user