Jump to content
  • Advertisement
Sign in to follow this  
Waaayoff

Not getting Input fast enough?

This topic is 3054 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

In my tetris game (which is taking way too long to finish :( ) The user can rotate the camera around the grid box by clicking on the left mouse button and moving the curser around. But, there is always a couple of seconds' delay. When i stop clicking on the mouse button, rotation should stop, but the camera keeps rotating for a couple of seconds (more or less). Same goes for starting the rotation. I would post the code if you want to, but i doubt that the rotation code is the culprit: I used the same code to rotate the camera in a project where the only thing being done is rendering a teapot, and it worked just fine.. Thanks for your help :)

Share this post


Link to post
Share on other sites
Advertisement
Are you using Win32? If so, are you processing all of your window messages before rendering a frame (I.e. while(PeekMessage())... )?

Share this post


Link to post
Share on other sites
I'm such an idiot!

I found the problem -.-

I have a loop function that calls a handlemessages function:

Loop.cpp:

while (HandleMessages())

//code here

HandleMessages Function:

bool HandleMessages()
{
static MSG msg;

if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) // NOTICE THE IF
{
if (msg.message == WM_QUIT)
return FALSE;

TranslateMessage(&msg);
DispatchMessage(&msg);
}

return TRUE;
}


I put in if instead of while by mistake..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!