'' ----------------------------------------------------------------------------
'' Irrlicht Wrapper For Imperative Languages - Freebasic Examples
'' Frank Dodd (2006-2010)
'' ----------------------------------------------------------------------------
'' Blitz-Irrlicht 1.8.3 Interface by Ed Musolino (AquaLung 2015)
'' ----------------------------------------------------------------------------
'' Example 03: Bitmap Fonts
'' This example uses a bitmap based font To draw Text To the screen
'' ----------------------------------------------------------------------------

'' ////////////////////////////////////////////////////////////////////////////
'' Includes For extension libraries
Framework usr.birrlicht

'' ////////////////////////////////////////////////////////////////////////////
'' Global variables
' This wrapper uses a series of types To bring Type errors To your attention
' when passing variables into the wrapper

Global BitmapFont:Int

'' ////////////////////////////////////////////////////////////////////////////
' start the irrlicht interface. The scene will be rendered using the Irrlicht,
' software renderer, the display will be a window 400 x 200 pixels in size, the
' display will Not support shadows And we will Not capture any keyboard And
' mouse events
iIrr3D( 640, 480, 32, False )

' Set the title of the display
iAppTitle( "Example 03: Bitmap Fonts" )

' Load a bitmap font as a texture
BitmapFont = iLoadFont ( "./media/bitmapfont.bmp" )

' erase the canvas To black before rendering
iCameraCLSColor( 0,0,0 )

' While the scene is still running
While iRun() And (Not iKeyHit(KEY_ESCAPE))
    iBeginScene()

    ' draw the Text using the loaded bitmap font at the supplied co-ordinates
    ' this font only has capitals in the bitmap at the moment lowercase
    ' characters will display as blanks
    iText ( BitmapFont, "SIMPLE MONOCHROME FONT", 120, 80, 250, 96 )

    ' End drawing the scene And render it
    iEndScene()
Wend

' -----------------------------------------------------------------------------
' Stop the irrlicht engine And Release resources
iEndIrr3D()

End