![]() |
|
Allegro 4.9.8 |
Trezker
Member #1,739
December 2001
![]() |
Your patch works actually. I'm not getting any jerking. |
Elias
Member #358
May 2000
|
Ah, very nice. Committed it to SVN, thanks a lot. -- |
Don Freeman
Member #5,110
October 2004
![]() |
I get random crashes when using: ALLEGRO_MOUSE_STATE msestate; al_get_mouse_state(&msestate); The program dies, and then I debug and it breaks on al_get_mouse_state, saying that msestate is invalid. I've looked at the examples and I am just doing the same thing as they are. I don't get it.??? It doesn't happen every time, and that is what is frustrating. I think that something in the mouse code is screwy...but I'm not sure. I am using Windows Server 2008 (Vista) if that helps anyone. I can run it a few times before I get the crash...sometimes it just crashes right away. Actually, the ex_mouse example does the same thing. Maybe there is something wrong with the mouse driver code on windows?!:o I've attached the full project (code, data, and a Windows executable). This is just a learning exercise for the new API before I use it to work on my WarLand project.8-) Edit: (This is under the 4.9.8 API)
-- |
Trent Gamblin
Member #261
April 2000
![]() |
I'm experiencing problems with the mouse (seemingly) in ex_expose. It is failing assertions that mouse_directx_installed != 0, even though the mouse has been installed. Kind of seems like a memory bug.
|
Don Freeman
Member #5,110
October 2004
![]() |
With the changes made by Milan Mimica here, my mouse problems (that I've noticed anyway) are gone...that AND it fixes the issue where windows didn't get the focus unless their title bars where clicked.:D -- |
Milan Mimica
Member #3,877
September 2003
![]() |
Quote: AND it fixes the issue where windows didn't get the focus unless their title bars where clicked. Nah, Trent fixed that.
-- |
Trezker
Member #1,739
December 2001
![]() |
set_mouse_xy is borked. I attach a diff of ex_warp_mouse. EDIT: EDIT2: |
Elias
Member #358
May 2000
|
Well, it makes sense - we were using XWarpPointer in relative mode. Assume the mouse is at x=200 and you want to move it to x=100 on each movement event. Now the user twice moves it to the right for one pixel. The event queue will contain the two events: mouse event(x=201,dx=1), mouse event(x=202,dx=1) In response to those two events, ex_warp_mouse sends these commands to the X11 server: XWarpPointer(-101), XWarpPointer(-102)
So because the user moved the mouse two pixel to the right, we asked X11 to move the pointer 203 pixel to the left. Of course instead of getting to x=100 as intended, we were overshooting that and moved out of the window The attached patch fixes it here. -- |
Trezker
Member #1,739
December 2001
![]() |
Yeah, it's working. |
Elias
Member #358
May 2000
|
Quote: Yeah, it's working. Actually, depending on what you want to use this for, it's still not perfect. If you look at the mouse positions relative to (width/2, height/2), they won't always correspond to the user movement of the mouse. If you do something like make a game with infinite mouse movement but call al_set_mouse_xy(width/2, height/2), it will again have jerky movement. I proposed a solution for it on the mailing list. -- |
Trezker
Member #1,739
December 2001
![]() |
Heh, so now we're discussing this in two places I think the public could voice their opinion in the matter. The current solution in the mailing list is a special event when the mouse is set with a warp. So you get ALLEGRO_EVENT_MOUSE_AXES and ALLEGRO_EVENT_MOUSE_WARPED. I don't think I like this. I'd rather see the ALLEGRO_EVENT_MOUSE_AXES event have a flag event.mouse.warped you can check. |
Evert
Member #794
November 2000
![]() |
Quote: Heh, so now we're discussing this in two places Yes, so don't cross-post. Anyway, I'll just quote the reply I sent in the mailing list: Quote:
> I think that when you use the function you should get a mouse axes Why? > In my program I just ignore that event by checking if the event I got You can do that too by just ignoring the ALLEGRO_EVENT_MOUSE_WARPED event. No special code or checks needed in your code. > People may want to use that mouse axes event, I think it's unnecesary You don't have to do anything special. Just respond to ALLEGRO_EVENT_MOUSE_WARPED in the same way as you would respond to an AXES event, as in the example snippet I posted. > Possibly you may add a flag in the event. As I said, hacky. There is no functional difference to checking a flag, except that the code is cleaner because we don't need to hack in a flag to indicate special behavior. Another way to think of this is that an event that needs a flag to indicate that it's different from other events of the same name should be a different event. |
Trezker
Member #1,739
December 2001
![]() |
I wasn't the one moving this discussion over to the mailing list. You guys are the ones cross posting. So, different event it is. |
Michael Faerber
Member #4,800
July 2004
![]() |
Does the demo in SVN work for anybody currently? At least here it seems that it is failing due to sound problems: The almighty terminal said:
michi@michi-desktop:~/4.9/build/demo$ ./demo I boiled the problem down to line 144 in Misc.cpp: It seems that calling voice = al_create_voice(44100, ALLEGRO_AUDIO_DEPTH_INT16, ALLEGRO_CHANNEL_CONF_2);
fails, because voice is NULL afterwards. -- |
Matthew Leverton
Supreme Loser
January 1999
![]() |
What is al_install_audio(ALLEGRO_AUDIO_DRIVER_AUTODETECT) returning? |
SiegeLord
Member #7,827
October 2006
![]() |
You need to force a different sound driver via allegro.cfg (see this file in the 4.9 root folder for the options and format). The 'autodetection' of audio driver is at fault here, I think. It crashes similarly to me, but as soon as I force it to something other than the default (I don't remember the details) it works fine. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Don Freeman
Member #5,110
October 2004
![]() |
Quote:
void al_calculate_arc(ALLEGRO_VBUFFER* vbuff, float cx, float cy, How do you calculate how many points you will need for al_calculate_arc? Edit: -- |
SiegeLord
Member #7,827
October 2006
![]() |
Look at high_primitives.c, it shows how to estimate the number of points in an arc/circle etc. Flood fill is a tough one... there is no way that it can be made fast... the hardware 'accelerated' version of it would be unbearably slow. Honestly, I'd say it'd better be placed in an 'image editing' addon which can have that and blur and whatnot in it. Any people have other opinions? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Michael Faerber
Member #4,800
July 2004
![]() |
Hi! Matthew, al_install_sound() returns 0 - both for ALSA and OSS. By the way, great demo! Who made it? -- |
Trent Gamblin
Member #261
April 2000
![]() |
Quote: By the way, great demo! Who made it? That would be me. The space ship (I think) was drawn by Micah Crow (who is awol) and the music I got from some royalty free music site.
|
Elias
Member #358
May 2000
|
It would be nice if he could draw asteroids in the same style as well. They look kinda flat, and the ship has this nice 3d effect. -- |
Trent Gamblin
Member #261
April 2000
![]() |
Maybe someone else could do it.
|
ImLeftFooted
Member #3,935
October 2003
![]() |
Trent: You make Allegro sound like a military camp... |
Trent Gamblin
Member #261
April 2000
![]() |
That was... random.
|
Elias
Member #358
May 2000
|
Quote: Trent: You make Allegro sound like a military camp... It's what it is... -- |
|
|