fb:porticula NoPaste
example.bas
Uploader: | OneCypher |
Datum/Zeit: | 31.05.2010 22:25:14 |
#include "GFX2SDL.bi"
Dim MySDLWindow as any ptr
SDL.SetBufferPtr MySDLWindow
screenres 640,480,32
SDL.ScreenRes 640,480,,,&H100' + &H08
Dim t1 as double
dim f as double
dim SDLInkey as string
dim GFXInkey as string
Dim mx as integer, my as integer, mb as integer
t1 = timer
dim d as double
do
f = f +1
SDLInkey = sdl.Inkey
GFXInkey = Inkey
SDL.GetMouse mx,my, ,mb
if timer >= t1 + 0.1 then
d = 1 / (timer - t1)
line MySDLWindow, (0,0)-(1000,1000),RGB(255,128,128)
draw string MySDLWindow, (-1,0), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MySDLWindow, (+1,0), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MySDLWindow, (0,-1), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MySDLWindow, (0,+1), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MySDLWindow, (0,0 ), "Frames p/s=" & int(F*d)& ">" & mb,RGB(255,255,255)
f = 0
t1 = timer
endif
Circle MySDLWindow, (mx,my), 100,RGB(0,255,0)
Circle (mx,my), 100,RGB(0,255,0)
if SDL.Resized then SDL.FitBuffer
sleep 1,1
loop until SDLInkey = CHR(255) & CHR(107) or GFXInkey = CHR(255) & CHR(107)