After reading this article by Microsoft about timing in games in which they encourage always clamping the delta values (and even imply they could potentially be negative due to bugs) when using QueryPerformanceCounter I decided I could have ruled out this function returning erroneous values a bit too early. And indeed I had. This function was exactly what was causing the glitches and although I had tried capping the delta values earlier I can only assume I must have done something wrong because now it's running flawlessly! I even made a festive screensaver to celebrate:
Thanks for all your feedback and suggestions
PS: Jason, I did run the program in release mode and if it's still of any interest here are the specs for my computer:
- Driver version: 331.65 (November 7 2013)
- CUDA Cores: 384
- Core clock: 822 MHz
- Shader clock: 1645 MHz
- Memory data rate: 4008 MHz
- Memory interface: 256-bit
- Memory bandwidth: 128.26 GB/s
- Total available graphics memory: 4095 MB
- Dedicated video memory: 2048 MB GDDR5
- System video memory: 0 MB
- Shared system memory: 2047 MB
- Video BIOS version: 70.24.21.00.60
- IRQ: 16
- Bus: PCI Express x16 Gen2