Buchempfehlung
Visual Basic 6 Kochbuch
Visual Basic 6 Kochbuch
Viele praktische Tipps zum Programmieren mit Visual Basic 6, die sich oft auch auf FB übertragen lassen. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

Videotest

Uploader:RedakteurJojo
Datum/Zeit:20.06.2007 18:03:56

Declare Sub pixeltest()
Declare Sub putTest()

Screen 19,32,2,1

putTest
pixeltest

Sub pixeltest()
    Dim backbuffer As Long Ptr
    backbuffer = imagecreate(800,600)

    Dim pixelamount As Integer = 5000000
    dim pixel as integer
    Dim result(1 To 4) As Double

    Dim zeit As Double
    zeit = Timer
    For pixel = 1 To pixelamount
        Pset(Int(800*Rnd),Int(600*Rnd)),Rgb(255*Rnd,255*Rnd,255*Rnd)
    Next
    result(1)=Timer-zeit

    Screenlock
    zeit = Timer
    For pixel = 1 To pixelamount
        Pset(Int(800*Rnd),Int(600*Rnd)),Rgb(255*Rnd,255*Rnd,255*Rnd)
        If pixel Mod 10000 = 0 Then Screenunlock:Screenlock
    Next
    result(2)=Timer-zeit
    Screenunlock

    Screenset 1,0
    zeit = Timer
    For pixel = 1 To pixelamount
        Pset(Int(800*Rnd),Int(600*Rnd)),Rgb(255*Rnd,255*Rnd,255*Rnd)
        If pixel Mod 10000 = 0 Then Screencopy
    Next
    result(3)=Timer-zeit
    Screencopy
    Screenset 0

    zeit = Timer
    For pixel = 1 To pixelamount
        backbuffer[1+Int(800*Rnd)+Int(600*Rnd)*800]=Rgb(255*Rnd,255*Rnd,255*Rnd)
        If pixel Mod 10000 = 0 Then Put(0,0),backbuffer,Pset
    Next
    Put(0,0),backbuffer,Pset
    result(4)=Timer-zeit

    Print "Direct Screen Drawing: ";result(1)
    Print "Hidden Screen Drawing: ";result(2)
    Print "Page Flipping Drawing: ";result(3)
    Print "Buffered RAM  Drawing: ";result(4)
    sleep
End Sub

Sub putTest()
    Dim tile As Long Ptr
    dim pixel as integer
    Line(0,0)-(63,63),Rgb(80,90,120),BF
    Line(0,0)-(63,63),Rgb(255,255,255)
    Line(0,63)-(63,0),0
    tile = imagecreate(64,64)
    Get(0,0)-(63,63),tile


    Dim backbuffer As Long Ptr
    backbuffer = imagecreate(800,600)

    Dim tileamount As Integer = 100000
    Dim result(1 To 4) As Double

    Dim zeit As Double
    zeit = Timer
    For pixel = 1 To tileamount
        Put(Int(736*Rnd),(536*Rnd)),tile,Pset
    Next
    result(1)=Timer-zeit

    Screenlock
    zeit = Timer
    For pixel = 1 To tileamount
        Put(Int(736*Rnd),(536*Rnd)),tile,Pset
        If pixel Mod 10000 = 0 Then Screenunlock:Screenlock
    Next
    result(2)=Timer-zeit
    Screenunlock

    Screenset 1,0
    zeit = Timer
    For pixel = 1 To tileamount
        Put(Int(736*Rnd),(536*Rnd)),tile,Pset
        If pixel Mod 10000 = 0 Then Screencopy
    Next
    result(3)=Timer-zeit
    Screencopy
    Screenset 0

    zeit = Timer
    For pixel = 1 To tileamount
        backbuffer[1+Int(800*Rnd)+Int(600*Rnd)*800]=Rgb(255*Rnd,255*Rnd,255*Rnd)
        Put backbuffer,(Int(736*Rnd),(536*Rnd)),tile,Pset
        If pixel Mod 10000 = 0 Then Put(0,0),backbuffer,Pset
    Next
    Put(0,0),backbuffer,Pset
    result(4)=Timer-zeit

    Print "Direct Screen Copying: ";result(1)
    Print "Hidden Screen Copying: ";result(2)
    Print "Page Flipping Copying: ";result(3)
    Print "Buffered RAM  Copying: ";result(4)
    sleep
End Sub