I didn't save it, but I did other codes and it was jerky even in a window.
I'd to 'force' Unlock instruction to display every effects in a frame. I'm pretty sure that's why I got the problem.
What is the good method to print fast dots with text and other draw commands ?
Code: Select all
' Replace "If 0" by If "1" to permute between fullscreen/windowed mode
If 0 Then SCREEN 800,600,0,2 : SetWindow "COOLBASIC",3 Else SCREEN 800,600,16,0
' How do you change the size of a font without a load ? (freeze)
font = LoadFont("arial",16)
fontLOGO = LoadFont("impact",210)
SetFont fontLOGO
Dim star(100)
For i = 1 To 100
star(i) = Rnd(800)
Next i
'--- Main routine ---
Repeat
Lock
'1/ 2D starfield dots and texts
SetFont font
For i = 1 To 100
c = int(Abs(5*Sin(i^4)))
vit = 1 + c
star(i) = star(i) + vit
If star(i) > 870 Then star(i) = 0
Color 0,9*vit,100+17*vit
PutPixel 8*i,star(i), 50+ vit * 30 Shl 16 + 50+ vit * 30 Shl 8
Text star(i)-70,i * 6,"COOLBASIC"
Next i
'2/ Big text
j = j + 5
Color 100,100,245
SetFont fontLOGO
Text 15,300-Abs(200*Sin(j)), "COOLBASIC"
Color 0,20,170
SetFont font
Text 0,0,"("+ FPS() +" FPS)"
' Wihtout a second unlock, it only display the vertical starfield on the background
Unlock
Unlock
DrawScreen 1,1 : Forever