#include "AFlib3_Sprite.bi"
#include "AFlib3_Font.bi"
#include "AFlib3_Starfield.bi"
#include "AFlib3_Miscellaneous.bi"
#include "AFlib3_Constants.bi"

ScreenRes 640, 480, 24, 2, 0
WindowTitle "AFlib III -- Starfield Test"

ScreenSet 1, 0

Dim StarAmount as Integer = 360
Dim SAngle as Double = 0
Dim AFlib3_title as any ptr = imagecreate( 306, 114 )

bload "AF3_logo320x240.bmp", AFlib3_title

AFlibIII_StarInit StarAmount

Dim DetectFPS as Integer

Do
  AFlibIII_ClearDisplay 0
  DetectFPS = AFlibIII_ShowFPS
  AFlibIII_StarMotion_thick StarAmount, RGB(0, 0, 50), RGB(255, 255, 255), 4, 3
  
  SAngle += .001
  If SAngle >= 360 then SAngle -= 360
  
  AFlibIII_StarMove_angle StarAmount, SAngle, 1
  
  AFlibIII_SprBlit 320, 340, AFlib3_title
  
  AFlibIII_Print "AFlib III - Starfield Test", 1, 464, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_Print "AFlib III - Starfield Test", 1, 465, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_Print "AFlib III - Starfield Test", 0, 465, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_PrintGradient "AFlib III - Starfield Test", 0, 464, 1, 1, rgb(255, 255, 255), rgb(128, 128, 255), 0, 2, 7

  AFlibIII_Print chr$(153) + "2005-2016 Adigun Azikiwe Polack/Aura Flow.  All Rights Reserved.", 1, 472, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_Print chr$(153) + "2005-2016 Adigun Azikiwe Polack/Aura Flow.  All Rights Reserved.", 1, 473, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_Print chr$(153) + "2005-2016 Adigun Azikiwe Polack/Aura Flow.  All Rights Reserved.", 0, 473, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_PrintGradient chr$(153) + "2005-2016 Adigun Azikiwe Polack/Aura Flow.  All Rights Reserved.", 0, 472, 1, 1, rgb(255, 255, 255), rgb(128, 128, 255), 0, 2, 7
  
  AFlibIII_Print "Frames/second: " + ltrim$(str(DetectFPS)), 1, 1, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_Print "Frames/second: " + ltrim$(str(DetectFPS)), 1, 0, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_Print "Frames/second: " + ltrim$(str(DetectFPS)), 0, 1, 1, 1, rgb(60, 60, 60), 0, 2, 7
  AFlibIII_PrintGradient "Frames/second: " + ltrim$(str(DetectFPS)), 0, 0, 1, 1, rgb(255, 255, 255), rgb(128, 128, 255), 0, 2, 7

  AFlibIII_CustomSync fps_OPTIMAL
  
  ScreenCopy
Loop while inkey$ = ""

ImageDestroy AFlib3_title

AFlibIII_EndProgram