Buchempfehlung
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
"Der" Petzold, das über 1000 Seiten starke Standardwerk zum Win32-API - besonders nützlich u. a. bei der GUI-Programmierung in FreeBASIC! [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

Beispiel.bi

Uploader:MitgliedOneCypher
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)