Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Bird Programming Language: Part 1

, 1 Jan 2013
A new general purpose language that aims to be fast, high level and simple to use.
Bird-noexe.zip
Bird
Archives
crt2.o
crtbegin.o
crtend.o
libadvapi32.a
libcomctl32.a
libcomdlg32.a
libgcc.a
libgdi32.a
libglu32.a
libkernel32.a
libmingw32.a
libmingwex.a
libmoldname.a
libmsvcrt.a
libopengl32.a
libshell32.a
libstdc++.a
libuser32.a
libwinmm.a
libwsock32.a
Libraries
BirdCore
Array.bird
BigInteger.bird
BinaryRW.bird
BirdCore.a
BirdCore.blib
CategoryData.dat
Console.bird
Convert.bird
Debug.bird
Entry.bird
Environment.bird
Exception.bird
Float.bird
LEB128.bird
Math.bird
Memory.bird
Object.bird
Random.bird
Reflection.bird
StandardC.bird
Stream.bird
String.bird
ToLowerData.dat
ToUpperData.dat
Types.bird
ValueType.bird
Win32.bird
x86Helper.bird
BlitzMax
.bmx
Launcher.bmx.gui.release.win32.x86.o
appstub.release.win32.x86.a
bank.release.win32.x86.a
bankstream.release.win32.x86.a
blitz.release.win32.x86.a
BlitzMax.a
BlitzMax.bird
BlitzMax.blib
d3d7max2d.release.win32.x86.a
d3d9max2d.release.win32.x86.a
directx.release.win32.x86.a
dxgraphics.release.win32.x86.a
event.release.win32.x86.a
filesystem.release.win32.x86.a
font.release.win32.x86.a
glgraphics.release.win32.x86.a
glmax2d.release.win32.x86.a
graphics.release.win32.x86.a
hook.release.win32.x86.a
keycodes.release.win32.x86.a
Launcher.bmx
libpng.release.win32.x86.a
linkedlist.release.win32.x86.a
math.release.win32.x86.a
max2d.release.win32.x86.a
opengl.release.win32.x86.a
pixmap.release.win32.x86.a
pngloader.release.win32.x86.a
polledinput.release.win32.x86.a
standardio.release.win32.x86.a
stdc.release.win32.x86.a
stream.release.win32.x86.a
system.release.win32.x86.a
textstream.release.win32.x86.a
win32.release.win32.x86.a
zlib.release.win32.x86.a
PrgLinec.bmx
Samples
Circles
Circles.bird
CppMain.bird
Fire
Fire.bird
Higher Order Functions
C#
Higher Order Functions.v11.suo
Properties
Test.bird
msvcrt.lib
Reflection
Reflection.bird
Squares
Squares.bird
Template
Template.bird
Source
Base
Bird.v11.suo
Expressions
Identifiers
Languages
NativeCode
Properties
Recognizers
Expressions
Scopes
x86
Thumbs.db
Bird.zip
crt2.o
crtbegin.o
crtend.o
libadvapi32.a
libcomctl32.a
libcomdlg32.a
libgcc.a
libgdi32.a
libglu32.a
libkernel32.a
libmingw32.a
libmingwex.a
libmoldname.a
libmsvcrt.a
libopengl32.a
libshell32.a
libstdc++.a
libuser32.a
libwinmm.a
libwsock32.a
Binaries
ar.exe
Bird.exe
fasm.exe
ld.exe
libiconv-2.dll
libintl-8.dll
Array.bird
BigInteger.bird
BinaryRW.bird
BirdCore.a
BirdCore.blib
CategoryData.dat
Console.bird
Convert.bird
Debug.bird
Entry.bird
Environment.bird
Exception.bird
Float.bird
LEB128.bird
Math.bird
Memory.bird
Object.bird
Random.bird
Reflection.bird
StandardC.bird
Stream.bird
String.bird
ToLowerData.dat
ToUpperData.dat
Types.bird
ValueType.bird
Win32.bird
x86Helper.bird
Launcher.bmx.gui.release.win32.x86.o
appstub.release.win32.x86.a
bank.release.win32.x86.a
bankstream.release.win32.x86.a
blitz.release.win32.x86.a
BlitzMax.a
BlitzMax.bird
BlitzMax.blib
d3d7max2d.release.win32.x86.a
d3d9max2d.release.win32.x86.a
directx.release.win32.x86.a
dxgraphics.release.win32.x86.a
event.release.win32.x86.a
filesystem.release.win32.x86.a
font.release.win32.x86.a
glgraphics.release.win32.x86.a
glmax2d.release.win32.x86.a
graphics.release.win32.x86.a
hook.release.win32.x86.a
keycodes.release.win32.x86.a
Launcher.bmx
libpng.release.win32.x86.a
linkedlist.release.win32.x86.a
math.release.win32.x86.a
max2d.release.win32.x86.a
opengl.release.win32.x86.a
pixmap.release.win32.x86.a
pngloader.release.win32.x86.a
polledinput.release.win32.x86.a
standardio.release.win32.x86.a
stdc.release.win32.x86.a
stream.release.win32.x86.a
system.release.win32.x86.a
textstream.release.win32.x86.a
win32.release.win32.x86.a
zlib.release.win32.x86.a
PrgLinec.bmx
PrgLinec.exe
Circles.bird
CppMain.bird
Fire.bird
Higher Order Functions.v11.suo
Test.bird
msvcrt.lib
Reflection.bird
Squares.bird
Template.bird
Bird.v11.suo
Thumbs.db
examples.zip
Examples
As.exe
AsLibs.a
PerfTest
Launcher.bmx
Squares
.bmx
Launcher.bmx
Template
Launcher.bmx
source.zip
Anonymus 7_1
Anonymus.csproj.user
Anonymus.idc
Anonymus.pidb
Anonymus.suo
Anonymus.userprefs
Base
Expressions
Lib
Long
LongDivTest.bmx
ULongConv.bmx
Math
MISZ
AsLibs.a
PerfTest
Launcher.bmx
Squares
Launcher.bmx
Template
Launcher.bmx
PrgLinec.bmx
PrgLinec.exe
Properties
Scopes
Txt
Asm.docx
Code.docx
Lib.aslib
~$Code.docx
x86
#ifndef BMXLIBS_H
#define BMXLIBS_H

typedef void* INT_PTR;

enum KEY_CODES
{
	KEY_BACKSPACE = 8, KEY_TAB,
	KEY_ENTER = 13,
	KEY_ESCAPE = 27,
	KEY_SPACE = 32,
	KEY_PAGEUP = 33, KEY_PAGEDOWN, KEY_END, KEY_HOME,
	KEY_LEFT = 37, KEY_UP, KEY_RIGHT, KEY_DOWN,
	KEY_INSERT = 45, KEY_DELETE,
	KEY_N0 = 48, KEY_N1, KEY_N2, KEY_N3, KEY_N4, KEY_N5, KEY_N6, KEY_N7, KEY_N8, KEY_N9,
	KEY_A = 65, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
	KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
	KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z,
	
	KEY_LSYS = 91, KEY_RYS,
	
	KEY_NUMPAD0 = 96, KEY_NUMPAD1, KEY_NUMPAD2, KEY_NUMPAD3, KEY_NUMPAD4,
	KEY_NUMPAD5, KEY_NUMPAD6, KEY_NUMPAD7, KEY_NUMPAD8, KEY_NUMPAD9,
	KEY_NUMPADMUL = 106, KEY_NUMPADADD, KEY_NUMPADSLASH,
	KEY_NUMPADSUB, KEY_NUMPADDECIMAL, KEY_NUMPADDIVIDE,

	KEY_F1 = 112, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6,
	KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12,

	KEY_LSHIFT = 160, KEY_RSHIFT,
	KEY_LCONTROL = 162, KEY_RCONTROL,
	KEY_LALT = 164, KEY_RALT,

	KEY_TILDE = 192, KEY_MINUS = 189, KEY_EQUALS = 187,
	KEY_OPENBACKET = 219, KEY_CLOSEBRACKET = 221, KEY_BACKSLASH = 226,
	KEY_SEMICOLON = 186, KEY_QUTES = 222,
	KEY_COMMA = 188, KEY_PERIOD = 190, KEY_SLASH = 19,
};

enum BLEND_MODE
{
    BLEND_MODE_MASK = 1,
    BLEND_MODE_SOLID,
    BLEND_MODE_ALPHA,
    BLEND_MODE_LIGHT,
    BLEND_MODE_SHARE,
};
   
enum PIXEL_FORMAT
{
    PIXEL_FORMAT_A8,
    PIXEL_FORMAT_I8,
    PIXEL_FORMAT_RGB888,
    PIXEL_FORMAT_BGR888,
    PIXEL_FORMAT_RGBA8888,
    PIXEL_FORMAT_BGRA8888,
};

extern "C"
{
	void			Main();
	void            bb_BeginPerf();
	void            bb_EndPerf();
    void            bbGCCollect();
    int             bbMilliSecs();
	void 			bb_FunctionCallTest(int x, int y, int z, int w);
    
	INT_PTR         brl_graphics_Graphics(int Width, int Height, int Depth = 0, int Hertz = 60, int Flags = 0);
	void            brl_graphics_Flip(int Sync);

	bool            brl_polledinput_AppTerminate();
	bool            brl_polledinput_KeyHit(KEY_CODES key);
	int             brl_polledinput_MouseX();
	int             brl_polledinput_MouseY();
	
    INT_PTR         brl_max2d_CreateImage(int Width, int Height, int Frames = 1, int Flags = -1);
    INT_PTR         brl_max2d_LockImage(INT_PTR Image, int Frame = 0, bool Read = true, bool Write = true);
    void            brl_max2d_UnlockImage(INT_PTR Image, int Frame = 0);
    int             brl_max2d_ImageWidth(INT_PTR Image);
    int             brl_max2d_ImageHeight(INT_PTR Image);
    
	void            brl_max2d_Cls();
    void            bb_DrawFrameStats();
	void            brl_max2d_DrawRect(float x, float y, float Width, float Height);
	void            brl_max2d_SetColor(int Red, int Green, int Blue);
	void            brl_max2d_SetBlend(BLEND_MODE Mode);
	void            brl_max2d_SetAlpha(float Alpha);
    void            brl_max2d_DrawImage(INT_PTR Image, float X, float Y, int Frame = 0);
    void            brl_max2d_DrawImageRect(INT_PTR Image, float X, float Y, float Width, float Height, int Frame = 0);
	void 			brl_max2d_DrawPixmap(INT_PTR Pixmap, int X, int Y);
	
    INT_PTR         brl_pixmap_CreatePixmap(int Width, int Height, PIXEL_FORMAT Format, int Align);
    INT_PTR         brl_pixmap_CopyPixmap(INT_PTR Pixmap);
    INT_PTR         brl_pixmap_ConvertPixmap(INT_PTR Pixmap, PIXEL_FORMAT Format);
    int             brl_pixmap_PixmapWidth(INT_PTR Pixmap);
    int             brl_pixmap_PixmapHeight(INT_PTR Pixmap);
    int             brl_pixmap_PixmapPitch(INT_PTR Pixmap);
    PIXEL_FORMAT    brl_pixmap_PixmapFormat(INT_PTR Pixmap);
    void*           brl_pixmap_PixmapPixelPtr(INT_PTR Pixmap, int X, int Y);
    INT_PTR         brl_pixmap_PixmapWindow(INT_PTR Pixmap, int X, int Y, int Width, int Height);
    INT_PTR         brl_pixmap_ResizePixmap(INT_PTR Pixmap, int Width, int Height);
    void            brl_pixmap_ClearPixels(INT_PTR Pixmap, int Color);
    void            brl_pixmap_WritePixel(INT_PTR Pixmap, int X, int Y, int Color);
    int             brl_pixmap_ReadPixel(INT_PTR Pixmap, int X, int Y);
}

#ifndef SKIP_DEFINES
#define BeginPerf bb_BeginPerf
#define EndPerf bb_EndPerf
#define PrintInt bb_PrintInt
#define PrintLong bb_PrintLong
#define PrintDouble bb_PrintDouble
#define NewLine bb_NewLine

#define GCCollect bbGCCollect
#define MilliSecs bbMilliSecs

#define CreatePixmap brl_pixmap_CreatePixmap
#define CopyPixmap brl_pixmap_CopyPixmap
#define ConvertPixmap brl_pixmap_ConvertPixmap
#define PixmapWidth brl_pixmap_PixmapWidth
#define PixmapHeight brl_pixmap_PixmapHeight
#define PixmapPitch brl_pixmap_PixmapPitch
#define PixmapFormat brl_pixmap_PixmapFormat
#define PixmapPixelPtr brl_pixmap_PixmapPixelPtr
#define PixmapWindow brl_pixmap_PixmapWindow
#define ResizePixmap brl_pixmap_ResizePixmap
#define ClearPixels brl_pixmap_ClearPixels
#define WritePixel brl_pixmap_WritePixel
#define ReadPixel brl_pixmap_ReadPixel

#define Graphics brl_graphics_Graphics
#define Flip brl_graphics_Flip

#define AppTerminate brl_polledinput_AppTerminate
#define KeyHit brl_polledinput_KeyHit
#define MouseX brl_polledinput_MouseX
#define MouseY brl_polledinput_MouseY

#define CreateImage brl_max2d_CreateImage
#define LockImage brl_max2d_LockImage
#define UnlockImage brl_max2d_UnlockImage
#define ImageWidth brl_max2d_ImageWidth
#define ImageHeight brl_max2d_ImageHeight

#define Cls brl_max2d_Cls
#define DrawFrameStats bb_DrawFrameStats
#define DrawRect brl_max2d_DrawRect
#define SetColor brl_max2d_SetColor
#define SetBlend brl_max2d_SetBlend
#define SetAlpha brl_max2d_SetAlpha
#define DrawImage brl_max2d_DrawImage
#define DrawImageRect brl_max2d_DrawImageRect
#define DrawPixmap brl_max2d_DrawPixmap
#endif

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Dávid Kocsis
Student
Hungary Hungary
I've been programming for 8 years. My first big project was a remake of a nice bomberman game called Dyna Blaster. When i was little i played a lot with it. Now i'm working on a new programming language and code generator.
I would like to work with someone, so feel free to contact me about it.

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 1 Jan 2013
Article Copyright 2011 by Dávid Kocsis
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid