fb:porticula NoPaste
Beispiel.bi
Uploader: | OneCypher |
Datum/Zeit: | 02.05.2010 00:27:35 |
Hinweis: Dieser Quelltext ist Bestandteil des Projekts GFX 2 SDL, zu dem es auf FreeBASIC-Portal.de eine Projektseite gibt.
#include "GFX2SDL.bi"
Dim MeinSDLFenster as any ptr
SDL.SetBufferPtr MeinSDLFenster
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 MeinSDLFenster, (0,0)-(1000,1000),RGB(255,128,128)
draw string MeinSDLFenster, (-1,0), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MeinSDLFenster, (+1,0), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MeinSDLFenster, (0,-1), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MeinSDLFenster, (0,+1), "Frames p/s=" & int(F*d)& ">" & mb,RGB(0,0,0)
draw string MeinSDLFenster, (0,0 ), "Frames p/s=" & int(F*d)& ">" & mb,RGB(255,255,255)
f = 0
t1 = timer
endif
Circle MeinSDLFenster, (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)