speed of mouse movement!

Posted By: NeoNeper

speed of mouse movement! - 03/16/13 15:26

My game is running at 35 frames per second.
I use the mouse to drag panels menus, but the speed of mouse is much slower, due to this low frames rate.
Has some technique I can use to increase the speed of the mouse, without the need to increase the frames?

PS: I use mouse_map. when I refer to the speed of the mouse I mean the bmap accompanying the mouse. Be the mouse_map or the bmaps that are dragged by it
Posted By: Kartoffel

Re: speed of mouse movement! - 03/16/13 15:36

what about time_step?
Posted By: NeoNeper

Re: speed of mouse movement! - 03/17/13 21:24

whats? no understand
Posted By: 3run

Re: speed of mouse movement! - 03/17/13 21:47

NeoNeper@ how do you move the mouse cursor? like this:
Code:
while(1){
    vec_set(mouse_pos.x, mouse_cursor.x);
    wait(1);
}

Or somehow different? If you move it, in a different way, make sure, that you use "time_step" with it:
Code:
camera.pan -= mouse_force.x * time_step;

Posted By: NeoNeper

Re: speed of mouse movement! - 03/18/13 14:54

I USE
Code:
while(1){
    vec_set(mouse_pos.x, mouse_cursor.x);
    wait(1);
}



would be the correct way?
mouse_pos.x = mouse_cursor.x * time_step;
mouse_pos.y = mouse_cursor.y * time_step;

?
Posted By: Uhrwerk

Re: speed of mouse movement! - 03/18/13 15:53

Your code is correct. Don't use the second snippet, i.t. don't multiply with time_step!

You're already using the windows mouse position. If the mouse does not move fast enough for you consider increasing the sensitivity in the control panel.
Posted By: Kartoffel

Re: speed of mouse movement! - 03/18/13 16:39

...and just a little tip:
set mouse_mode = 4; once and mouse_pos gets updated automatically.
Posted By: NeoNeper

Re: speed of mouse movement! - 03/19/13 13:05

yes currently use mouse_mode = 4 and vec_set(mouse_pos.x, mouse_cursor.x);.
But as I reported earlier the speed of the mouse map is related to fps_max.

if I set fps_max = 60; its is good.
the map of the mouse or click and drag of the panels are made in the same speed the mouse but if i SET fps_max = 35; Ohhh. the map of the mouse or click and drag of the panels are made in a long delay.

My main question is: how can accelerate the speed of the drag of the bmaps that follow the mouse, including the mouse map.without the need to use fps_max
Posted By: 3run

Re: speed of mouse movement! - 03/19/13 14:09

NeoNeper@ you are doing something wrong. Cause it works pretty nice on my side. BTW, if you set mouse_mode to 4, there is no need to manually move the mouse position with cursor position, that might cause the problem.
Posted By: Kartoffel

Re: speed of mouse movement! - 03/19/13 16:22

you can use
mouse_sync = 1;

...but it looks like it only applies for the mouse cursor image, not mouse_pos - which makes it somehow useless.
Posted By: NeoNeper

Re: speed of mouse movement! - 03/21/13 11:07

It's true.
it only applies for the mouse cursor image.
I'm using the LBGUI.
I'll do some tests with simple drag panels and see if the movement remains slow
Posted By: Kartoffel

Re: speed of mouse movement! - 03/21/13 12:49

@NeoNeper
The movement stays the same, I've tested it yesterday.

But you could try to get the windows cursor information by using the windows.h functions.
I tested it out and (it seems like) the input has less lag.
© 2023 lite-C Forums