Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Mouse performance problem

Author
Message
Philoso4 King
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location:
Posted: 22nd Feb 2008 19:53
I need to capture mouse movements for the game I'm working on and I noticed that frame rate dropped very low.

So I tried an experiment. I created a new 2D project, removed the default background so I could write text to the screen, and added the following code to inside the game loop:

static char buf[256];
sprintf( buf, "FPS = %d ", dbScreenFPS() );
dbText( 10, 10, buf );
sprintf( buf, "X = %d ", dbMouseX() );
dbText( 10, 25, buf );
sprintf( buf, "Y = %d ", dbMouseY() );
dbText( 10, 40, buf );

When I run it, the frame rate sits in the low to mid 60s (even though it is supposedly capped at 60) if I don't move the mouse, and drops significantly when I do. Moving the mouse rapidly I saw frame rates drop to single digits (even to 0 briefly).

Is this a bug or am I missing something? If Dark GDK can't handle simple mouse input, I'm going to need to change engines.

Any assistance or insight would be greatly appreciated.
Fusspawn
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 22nd Feb 2008 20:13
Im not sure whats causing it on your end, but can assure you it doesnt happen generally at least any of the projects im doing are, i even tried moving the mouse around the screen at an alarming rate while monitoring fps ( my mouse also controlled a camera in a 3d terrain )

an still had no issues i couldnt even make it drop by 1 fps.

Stuck in the land of the confused! and loving it!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Feb 2008 20:42 Edited at: 22nd Feb 2008 20:43
Bro - Dark Gdk has some issues - but Mouse Input isn't one of them.

Start a new project - the Default one - Toss up your little text test above - [edit]After test and you see its not the mouse[/edit] then come back with source code [edit]from your game so we can see how your MOUSE CODE is likely Triggering [edit]some code thats chowing your frame rates[/quote]. That's where your frame rates are going.

Missing a few header Declarations? A Couple Calls I wish Were There? Some times a value isn't what I thought - but Mouse Input?

FLAWLESS

kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 22nd Feb 2008 22:19
Could you please post your complete code?

Maybe there could be something wrong somewhere else.
Philoso4 King
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location:
Posted: 25th Feb 2008 21:35
Turns out it isn't a dark GDK problem.

I was worried when I created a new default 2D project and I still had the mouse problem - the only change I made from the default empty project was to remove the background and to print the mouse x/y to the screen.

Turns out the problem is with my PC. I'm still not sure what is wrong with it, but the code works fine on another machine.

Sorry about the misplaced alarm.

Stuart

Login to post a reply

Server time is: 2024-11-17 06:43:32
Your offset time is: 2024-11-17 06:43:32