VBGamer |
|
Re: World Build messix (0 replies, 1026 views) (2004-May-4) Wow Dan thanks heaps for all the feedback mate! Really appreciate it! There's not one thing I don't agree with what you said so I'll implement them all in.
Interestingly, I originally had it so the mouse worked pretty much like what you said would be a nice change - when you moved the mouse over the main picture box it would send the mouse back into world build and if you moved the mouse to any edge of the tile that you were working on the mouse would go back to the system. This obviously didn't work to well as you couldn't get to and of the edges on the tile. Should work pretty well if I only do it on the picture box side though.
Ok, the FPS calc. It's worked out as per the example given on Jack's DirectX 4 VB site (never found a better way to work it out then that) with the example below:
If GetTickCount() - LastTimeCheck >= 1000 Then
FrameRate = FramesDrawn
FramesDrawn = 0
LastTimeCheck = GetTickCount()
lblWorldName.Caption = World.strWorldName & " FPS: " & FrameRate
End If
FramesDrawn = FramesDrawn + 1
DoEvents
The above code sits in the main game loop, which is the way I've always done it. I thought this displayed the correct FPS as when I first started developing on the older PC it used to go down to numbers like 8, 13, etc. If there is something wrong with that then please tell me and I'll change it ASAP.
Note that GetTickCount() is a direct call to the windows API:
Public Declare Function GetTickCount Lib "kernel32" () As Long
|