I'm playing around in openGL with some code I wrote a few years back, and while I have it for the most part working, it appears that my code for sending a wm_timer message every second isn't working anymore.

I've got a variable 'hWindow' (gee, wonder what that is), a GLWindowProc procedure that is intercepting wm_keyup,wm_keydown, wm_mousemove, etc just fine...

But trying to trap wm_timer:
Code:
		wm_timer:begin
			fps_report:='hit';
			result:=0;
		end;
Fails. I'm setting up the timer thus:

SetTimer(hWindow,1,1000,nil);

I also tried making a procedure as stdcall, and pointing settimer's last parameter at that, also no-go. No errors are thrown, it just doesn't fire. I know at the point I'm trying to start the timer hWindow is assigned a valid value and I'm able to hook it with other functions, it's just SetTimer that's failing to work.

Anybody got a clue?

Windows 7, FPC 2.2.4

-- edit --

Nevermind - I'm pumping out 2400+ iterations a second, so I'm just polling queryPerformanceFrequency and queryPerformanceCounter... I hate polling and would really prefer event driven, but it works so who am I to argue.

I actually set it up to test six times in a row the 'accuracy' of how often queryperformancefrequency is updated - if the value is more than 16ms it calls timeBeginPeriod and timeGetTime instead... Which is good since queryPerformanceCounter is awesome on my Q6600 desktop and intel atom netbook (around 2ms accuracy), but blows chunks on my pentium M. Laptop where it only seems to get updated every 48ms - so the 16ms of timeGetTime is better.

Uhg, this is so much more complicated than it should need to be, as evidenced by how I was doing it before just fine in Delphi... But I can't find my Delphi CD, can't afford a new copy for a 'hobby' at the moment... so FPC will have to do - which is ok since I didn't use the visual part of Delphi anyways. Odd mental block - after 30 years of programming all the way down to hand compiling my own z80 machine code, I still can't wrap my head around visual programming. I'd sooner use the Win32 api directly than touch the VCL - it makes no sense to me.