Click here to Skip to main content
15,886,422 members
Articles / High Performance Computing / Vectorization

Bird Programming Language: Part 1

Rate me:
Please Sign up or sign in to vote.
4.92/5 (129 votes)
1 Jan 2013GPL312 min read 377.3K   2.7K   153  
A new general purpose language that aims to be fast, high level and simple to use.
Strict

Framework Brl.StandardIO
Import Brl.Max2D
Import Brl.GLMax2D
Import Brl.GLGraphics
Import BRL.PNGLoader
Import BRL.D3D9Max2D

Function DebugPrintString(Str:Byte Ptr)
	Str :+ 16
	Local Length = (Int Ptr(Str))[0]
	Str :+ 4
	
	Local Temp:Short Ptr = Short Ptr(MemAlloc((Length + 1) * 2))
	MemCopy Temp, Str, Length * 2
	Temp[Length] = 0
	Print String.FromWString(Temp)
	MemFree Temp
EndFunction

Function DebugPrintInt(x)
	Print x
EndFunction

Function FunctionCallTest(x, y, z, w)
	Print "x = " + x
	Print "y = " + y
	Print "z = " + z
	Print "w = " + w
EndFunction

Global Ms
Function BeginPerf()
	Ms = MilliSecs()
EndFunction

Function EndPerf()
	Ms = MilliSecs() - Ms
	Print "Time: " + String(Float(Ms) / 1000#)
EndFunction

Global PrevMs, Frames, FPS
Function DrawFrameStats()
	Local CurrentMS = MilliSecs()
	If Abs(CurrentMS - PrevMS) > 1000 
		PrevMS = CurrentMS
		FPS = Frames
		Frames = 0
	EndIf
	
	DrawText "FPS: " + FPS, 5, 5
	'DrawText "Frames: " + Frames, 5, 25
	'DrawText "PrevMS: " + PrevMS, 5, 45
	'DrawText "CurrentMS: " + CurrentMS, 5, 65
	'DrawText "CurrentMS - PrevMS: " + (CurrentMS - PrevMS), 5, 85
	Frames :+ 1
EndFunction

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)


Written By
Software Developer
Hungary Hungary
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions