Glad this information came up. Nice commands there Petr. Will make it so much easier. Didn't know about them, or if I read about them forgot.
I like simple, and these make things simple!
Psch thanks for that, it was about 30 minutes after posting when i was about to leave for work that i reaslised it was working backwards but didnt have time to go and modify it.
Mike - it is your routine (i nabbed it. :P) thanks.
Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370
Glad this information came up. Nice commands there Petr. Will make it so much easier. Didn't know about them, or if I read about them forgot.
I like simple, and these make things simple!
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
I came across this lesson on Lazy Foo, some time ago.
I'm thinking of creating a General Routine for Capping the Frame Rate which could be used in all the Lessons.
Operating System: Windows 10 Home 64-bit
CPU: Intel Celeron N4000 CPU @ 1.10GHz
Memory: 4.00GB RAM
Graphics: Intel UHD Graphics 600
Hi,
matthew, whats wrong with tbgl_GetFrameRate :'( ?
Mikes system is probably the most precise one, but it needs to wait some frames before it returns something and it tends to return more average value, while normally I need to know framerate in each frame to perform movement calculations.
TBGL_GetFrameRate is very simple function, lets see what it does...
It can be called only once in each frame. Why ? First because it was designed this way ;D and second it leads to real man coding ;D. Because when you store result at begining of each frame to variable, it is much more faster to read value from it later than invoke some measuring function multiple times per frame.
As it is called once in frame, it is enough to measure time between two calls to this function and from this find out how long frame took. TBGL_getframeRate is kind of hybrid, because in case it runs in old ( ancient ) hardware it uses GetTickCount to get time, while on newer PCs it automatically makes uses of hardware counter, which is very precise ... at least for this purpose
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
^^
Lol, Okay then we'll use 'tbgl_GetFrameRate'.
Operating System: Windows 10 Home 64-bit
CPU: Intel Celeron N4000 CPU @ 1.10GHz
Memory: 4.00GB RAM
Graphics: Intel UHD Graphics 600
Good,
now I can sleep peacefuly
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Updated the Code a bit.
Operating System: Windows 10 Home 64-bit
CPU: Intel Celeron N4000 CPU @ 1.10GHz
Memory: 4.00GB RAM
Graphics: Intel UHD Graphics 600
Matthew thanks for the update.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Yes, thank you Mattew.
^^
Thank's, I'm going to start updating the Code for all the other Lessons as well.
Operating System: Windows 10 Home 64-bit
CPU: Intel Celeron N4000 CPU @ 1.10GHz
Memory: 4.00GB RAM
Graphics: Intel UHD Graphics 600
Bookmarks