FPS counter
Übersicht

![]() |
beanage.johannesBetreff: FPS counter |
![]() Antworten mit Zitat ![]() |
---|---|---|
ein simpler fps counter wenn man grad zu faul ist sich flott selber einen zu schreiben^^
Code: Type TFps
Field Old:Int Field Fps:Int Field count:Int Field time:Int Field timer:TTimer Function Create:TFps() Local n:TFps = New TFps n.timer = CreateTimer(1) Return n EndFunction Method Reset() time = 0 count = 0 fps = 0 old = 0 EndMethod Method Update() count:+ 1 time = TimerTicks(timer) Mod 2 If time <> old Then fps = count count = 0 old = time EndIf EndMethod Method Get:Int() Return fps EndMethod EndType und ein kleines beispiel... Code: graphics 640,480 fps:TFps = TFps.Create() repeat cls drawtext "fps: " + string(fps.get),5,5 fps.Update() flip(0) until keydown(key_escape) |
||
- Zuletzt bearbeitet von beanage.johannes am Di, Aug 18, 2009 21:08, insgesamt einmal bearbeitet
![]() |
Mathias-Kwiatkowski |
![]() Antworten mit Zitat ![]() |
---|---|---|
bei mir funtzt des net...
fps.TFps = TFps.Create() Compile Error: Identifier 'TFps' not found Build Error: failed to compile C:/Programme/BLIde for BlitzMax/tmp/bmx_file.bmx |
||
klepto2 |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Local fps:TFPS = TFPS.Create()
Hat sich wohl ein kleiner Fehler in den sample Code eingeschlichen ![]() |
||
Matrix Screensaver
Console Modul für BlitzMax KLPacker Modul für BlitzMax HomePage : http://www.brsoftware.de.vu |
![]() |
Nicdel |
![]() Antworten mit Zitat ![]() |
---|---|---|
Versuchs mal so:
BlitzMax: fps:TFps = TFps.Create()
|
||
Desktop: Intel Pentium 4 2650 Mhz, 2 GB RAM, ATI Radeon HD 3850 512 MB, Windows XP
Notebook: Intel Core i7 720 QM 1.6 Ghz, 4 GB DDR3 RAM, nVidia 230M GT, Windows 7 |
![]() |
Mathias-Kwiatkowski |
![]() Antworten mit Zitat ![]() |
---|---|---|
Graphics 640, 480
Local fps:TFps = TFps.Create() repeat cls drawtext "fps: " + string(fps.get),5,5 fps.Update() flip(0) until keydown(key_escape) -> Compile Error: Unable to convert from 'Int()' to 'String' Build Error: failed to compile C:/Programme/BLIde for BlitzMax/tmp/bmx_file.bmx funktioniert alles nich so wirklich O.o |
||
![]() |
XeresModerator |
![]() Antworten mit Zitat ![]() |
---|---|---|
BlitzMax: fps.get()Die Klammern sind nicht unwichtig... |
||
Win10 Prof.(x64)/Ubuntu 16.04|CPU 4x3Ghz (Intel i5-4590S)|RAM 8 GB|GeForce GTX 960
Wie man Fragen richtig stellt || "Es geht nicht" || Video-Tutorial: Sinus & Cosinus THERE IS NO FAIR. THERE IS NO JUSTICE. THERE IS JUST ME. (Death, Discworld) |
![]() |
beanage.johannes |
![]() Antworten mit Zitat ![]() |
---|---|---|
habe den fehler im beispiel ausgebessert^^ danke
müsste mit klammern eigentlich funzen ![]() |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group