Jump to content
  • Advertisement
Sign in to follow this  
traiger

OpenGL fps affected by mouse

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

I'm new to directx but have a bit of experience with opengl and plenty with c++. I've gone through the directx tutorials and I'm now basically modifying them in that time honoured tradition of making a quick pong clone. What I've noticed is that the fps does not appear to be constant or very high until I start moving the mouse where upons it doubles and becomes very smooth indeed. Does anyone have any experience in this? How can it be cured? Thanks Paul

Share this post


Link to post
Share on other sites
Advertisement
My guess is that you're using GetMessage() instead of PeekMessage() to handle windows messages, which means that your application will block on GetMessage() until the window receives a message (i.e. moving the mouse in it).

Share this post


Link to post
Share on other sites
Nope Im using PeekMessage as per the tutorials that come with the directx SDK.


if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}

Share this post


Link to post
Share on other sites
Are you sure your fps calculations have nothing to do with the input handling routines? (Like, you do some fps calculations in a routine that's only called when there's input, or stuff like that)

Share this post


Link to post
Share on other sites
Do you update your game logic somewhere inside the message proc or input handling routines? How do you update the logic?

Share this post


Link to post
Share on other sites
Sorry I don't understand what you mean by updating logic? Could you expand?

I'm still having problems with this if anyone can help.

Thanks

Paul

Share this post


Link to post
Share on other sites

while( msg.message!=WM_QUIT && !g_bl_exit_game )
{
player_control();
ai_paddle();
move_ball();

if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
Render();
}


Very slightly modified from the directx unmanaged examples.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!