Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


question on my timer code...

This topic is 5616 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok i know there are some other posts about this type of stuff i just want to know why my code isnt working because it looks to me like it should yet it just shows me getting like a max of 72fps when i should be getting alot more since im not doing anything just making the window lol here is my class im using...all im using it for so far is to get the fps...
class Ctimer
	__int64 _startTime;
	__int64 _frequency;

	short	_fps;
	short	_frames;

	Ctimer() {}
	~Ctimer() {}

	void init();
	void update();

	inline short getFPS() { return _fps; }

void Ctimer::init()

void Ctimer::update()

	static __int64 lastTime =_startTime;

	if(currTime.QuadPart-lastTime >= _frequency)
		lastTime = currTime.QuadPart;

[edited by - AbsentMinded on July 26, 2003 8:00:20 AM]

Share this post

Link to post
Share on other sites
I''m not sure what kind of program you are creating, I''m assuming a game but the best thing you can do is control vsynch at the startup of your program, and leave the windows setting alone. In OpenGL this is done with the WGL_EXT_swap_control extension.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!