From: Manuel <in...@ma...> - 2008-09-09 20:28:34
|
I've a simple function like: void mhMotion(int x,int y) { G.modifiersKeyState = glutGetModifiers(); ...cut... glutPostRedisplay(); } and then glutMotionFunc(mhMotion); Under Windows it work without messages, while in Ubuntu, it return: "freeglut glutGetModifiers() called outside an input callback" Any suggestions? Best regards, Manuel PS: G is a global structure. |
From: Steve B. <st...@sj...> - 2008-09-09 20:36:37
|
Are you perhaps calling mhMotion from anywhere else? The problem is that under X11, you can only read the keyboard modifiers from inside an X11 key/mouse event. In windows there is no such restriction. However, it looks like you're doing exactly that in your example - so theoretically, there should be no problem. But if you were calling mhMotion someplace else - that would be bad. Manuel wrote: > I've a simple function like: > > void mhMotion(int x,int y) > { > > G.modifiersKeyState = glutGetModifiers(); > ...cut... > glutPostRedisplay(); > } > > and then > > glutMotionFunc(mhMotion); > > Under Windows it work without messages, while in Ubuntu, it return: > > "freeglut glutGetModifiers() called outside an input callback" > > Any suggestions? > > Best regards, > > Manuel > > PS: G is a global structure. > > > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |
From: Manuel <in...@ma...> - 2008-09-09 20:58:20
|
Thanks for fast reply. Here is the code: http://makehuman.svn.sourceforge.net/viewvc/makehuman/trunk/mh_phoenix/src/glmodule.c?revision=572&view=markup In my local copy, to test the bug, I've commented all glutGetModifiers() calls, except one in mhMotion (line 140). In detail, here I've: void mhMotion(int x,int y) 141 { ... 144 G.modifiersKeyState = glutGetModifiers(); ... 147 int modf = 0; instead void mhMotion(int x,int y) 141 { ... 144 G.modifiersKeyState = glutGetModifiers(); ... 147 int modf = glutGetModifiers(); So only the call in line 144, but the message happen again... Thanks for help, Manuel On Tue, 2008-09-09 at 15:35 -0500, Steve Baker wrote: > Are you perhaps calling mhMotion from anywhere else? > > The problem is that under X11, you can only read the keyboard modifiers > from inside an X11 key/mouse event. In windows there is no such > restriction. > > However, it looks like you're doing exactly that in your example - so > theoretically, > there should be no problem. > > But if you were calling mhMotion someplace else - that would be bad. > > > Manuel wrote: > > I've a simple function like: > > > > void mhMotion(int x,int y) > > { > > > > G.modifiersKeyState = glutGetModifiers(); > > ...cut... > > glutPostRedisplay(); > > } > > > > and then > > > > glutMotionFunc(mhMotion); > > > > Under Windows it work without messages, while in Ubuntu, it return: > > > > "freeglut glutGetModifiers() called outside an input callback" > > > > Any suggestions? > > > > Best regards, > > > > Manuel > > > > PS: G is a global structure. > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > > Build the coolest Linux based applications with Moblin SDK & win great prizes > > Grand prize is a trip for two to an Open Source event anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Freeglut-developer mailing list > > Fre...@li... > > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |
From: Steve B. <st...@sj...> - 2008-09-09 22:23:49
|
I think you'll have to use a debugger to figure out where glutGetModifiers is being called from - a stack back-trace should enable you to figure it out. -- Steve Manuel wrote: > Thanks for fast reply. > Here is the code: > > http://makehuman.svn.sourceforge.net/viewvc/makehuman/trunk/mh_phoenix/src/glmodule.c?revision=572&view=markup > > In my local copy, to test the bug, I've commented all glutGetModifiers() > calls, except one in mhMotion (line 140). In detail, here I've: > > void mhMotion(int x,int y) > 141 { > ... > 144 G.modifiersKeyState = glutGetModifiers(); > ... > 147 int modf = 0; > > instead > > void mhMotion(int x,int y) > 141 { > ... > 144 G.modifiersKeyState = glutGetModifiers(); > ... > 147 int modf = glutGetModifiers(); > > > So only the call in line 144, but the message happen again... > Thanks for help, > > Manuel > > > > > On Tue, 2008-09-09 at 15:35 -0500, Steve Baker wrote: > >> Are you perhaps calling mhMotion from anywhere else? >> >> The problem is that under X11, you can only read the keyboard modifiers >> from inside an X11 key/mouse event. In windows there is no such >> restriction. >> >> However, it looks like you're doing exactly that in your example - so >> theoretically, >> there should be no problem. >> >> But if you were calling mhMotion someplace else - that would be bad. >> >> >> Manuel wrote: >> >>> I've a simple function like: >>> >>> void mhMotion(int x,int y) >>> { >>> >>> G.modifiersKeyState = glutGetModifiers(); >>> ...cut... >>> glutPostRedisplay(); >>> } >>> >>> and then >>> >>> glutMotionFunc(mhMotion); >>> >>> Under Windows it work without messages, while in Ubuntu, it return: >>> >>> "freeglut glutGetModifiers() called outside an input callback" >>> >>> Any suggestions? >>> >>> Best regards, >>> >>> Manuel >>> >>> PS: G is a global structure. >>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Freeglut-developer mailing list >>> Fre...@li... >>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >>> >>> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Freeglut-developer mailing list >> Fre...@li... >> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >> >> > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |
From: Manuel <in...@ma...> - 2008-09-10 06:20:47
|
On Tue, 2008-09-09 at 17:23 -0500, Steve Baker wrote: > I think you'll have to use a debugger to figure out where > glutGetModifiers is being called from - a stack back-trace should enable > you to figure it out. I've double checked the code. The mhMotion is called only by glutMotionFunc. I know all glutGetModifiers calls because I've added them just yesterday: they are only in the module I've posted in previous email. Some additional infos: when glutGetModifiers is called by others callbacks event, like: glutMouseWheelFunc glutMouseFunc glutKeyboardFunc it work fine. The problem seem to be related only to mouse motion (passive too). I'm not expert in gdb, so, to be sure about the problem, I've done a simple experiments: I've written a new callback function: void mhMotionFoo(int x,int y) { int a = glutGetModifiers(); } I've reproduced the bug with mhMotionFoo too. If I comment the call of glutGetModifiers(): void mhMotionFoo(int x,int y) { //int a = glutGetModifiers(); } all work fine. Unfortunately C is not my primary language, so I'm not so expert to handle a debugger sessions. Any help is very appreciated. Anyway the simple test above should be sufficiently indicative that the problem is related just to motion function. Best regards, Manuel > > -- Steve > > Manuel wrote: > > Thanks for fast reply. > > Here is the code: > > > > http://makehuman.svn.sourceforge.net/viewvc/makehuman/trunk/mh_phoenix/src/glmodule.c?revision=572&view=markup > > > > In my local copy, to test the bug, I've commented all glutGetModifiers() > > calls, except one in mhMotion (line 140). In detail, here I've: > > > > void mhMotion(int x,int y) > > 141 { > > ... > > 144 G.modifiersKeyState = glutGetModifiers(); > > ... > > 147 int modf = 0; > > > > instead > > > > void mhMotion(int x,int y) > > 141 { > > ... > > 144 G.modifiersKeyState = glutGetModifiers(); > > ... > > 147 int modf = glutGetModifiers(); > > > > > > So only the call in line 144, but the message happen again... > > Thanks for help, > > > > Manuel > > > > > > > > > > On Tue, 2008-09-09 at 15:35 -0500, Steve Baker wrote: > > > >> Are you perhaps calling mhMotion from anywhere else? > >> > >> The problem is that under X11, you can only read the keyboard modifiers > >> from inside an X11 key/mouse event. In windows there is no such > >> restriction. > >> > >> However, it looks like you're doing exactly that in your example - so > >> theoretically, > >> there should be no problem. > >> > >> But if you were calling mhMotion someplace else - that would be bad. > >> > >> > >> Manuel wrote: > >> > >>> I've a simple function like: > >>> > >>> void mhMotion(int x,int y) > >>> { > >>> > >>> G.modifiersKeyState = glutGetModifiers(); > >>> ...cut... > >>> glutPostRedisplay(); > >>> } > >>> > >>> and then > >>> > >>> glutMotionFunc(mhMotion); > >>> > >>> Under Windows it work without messages, while in Ubuntu, it return: > >>> > >>> "freeglut glutGetModifiers() called outside an input callback" > >>> > >>> Any suggestions? > >>> > >>> Best regards, > >>> > >>> Manuel > >>> > >>> PS: G is a global structure. > >>> > >>> > >>> > >>> > >>> > >>> > >>> ------------------------------------------------------------------------- > >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > >>> Build the coolest Linux based applications with Moblin SDK & win great prizes > >>> Grand prize is a trip for two to an Open Source event anywhere in the world > >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >>> _______________________________________________ > >>> Freeglut-developer mailing list > >>> Fre...@li... > >>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer > >>> > >>> > >> ------------------------------------------------------------------------- > >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > >> Build the coolest Linux based applications with Moblin SDK & win great prizes > >> Grand prize is a trip for two to an Open Source event anywhere in the world > >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >> _______________________________________________ > >> Freeglut-developer mailing list > >> Fre...@li... > >> https://lists.sourceforge.net/lists/listinfo/freeglut-developer > >> > >> > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > > Build the coolest Linux based applications with Moblin SDK & win great prizes > > Grand prize is a trip for two to an Open Source event anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Freeglut-developer mailing list > > Fre...@li... > > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |
From: Steve B. <st...@sj...> - 2008-09-10 12:56:14
|
Oh!!! OK - now I get it - I hadn't noticed that this was the PASSIVE motion callback. I don't think you can call glutGetModifiers there either. The "passive motion" callback doesn't involve a key up/down event. You have to remember the state of the modifiers when the mouse button goes down. In X11, if you start a "shift-drag" or "ctrl-drag" mouse operation and release the shift or ctrl key partway through the drag, the operation will continue as if you held the key down. The kind of click you have is only knowable at the onset or the end of the click/drag/release operation. One of those ikky little things sent to drive cross-platform programmers nuts! -- Steve. Manuel wrote: > On Tue, 2008-09-09 at 17:23 -0500, Steve Baker wrote: > >> I think you'll have to use a debugger to figure out where >> glutGetModifiers is being called from - a stack back-trace should enable >> you to figure it out. >> > > > I've double checked the code. > The mhMotion is called only by glutMotionFunc. > I know all glutGetModifiers calls because I've added them just > yesterday: they are only in the module I've posted in previous email. > Some additional infos: > when glutGetModifiers is called by others callbacks event, like: > glutMouseWheelFunc > glutMouseFunc > glutKeyboardFunc > it work fine. > The problem seem to be related only to mouse motion (passive too). > I'm not expert in gdb, so, to be sure about the problem, I've done a > simple experiments: > > I've written a new callback function: > > void mhMotionFoo(int x,int y) > { > int a = glutGetModifiers(); > } > > I've reproduced the bug with mhMotionFoo too. If I comment the call of > glutGetModifiers(): > > void mhMotionFoo(int x,int y) > { > //int a = glutGetModifiers(); > } > > all work fine. > > Unfortunately C is not my primary language, so I'm not so expert to > handle a debugger sessions. Any help is very appreciated. > Anyway the simple test above should be sufficiently indicative that the > problem is related just to motion function. > > Best regards, > > Manuel > > > > > > > >> -- Steve >> >> Manuel wrote: >> >>> Thanks for fast reply. >>> Here is the code: >>> >>> http://makehuman.svn.sourceforge.net/viewvc/makehuman/trunk/mh_phoenix/src/glmodule.c?revision=572&view=markup >>> >>> In my local copy, to test the bug, I've commented all glutGetModifiers() >>> calls, except one in mhMotion (line 140). In detail, here I've: >>> >>> void mhMotion(int x,int y) >>> 141 { >>> ... >>> 144 G.modifiersKeyState = glutGetModifiers(); >>> ... >>> 147 int modf = 0; >>> >>> instead >>> >>> void mhMotion(int x,int y) >>> 141 { >>> ... >>> 144 G.modifiersKeyState = glutGetModifiers(); >>> ... >>> 147 int modf = glutGetModifiers(); >>> >>> >>> So only the call in line 144, but the message happen again... >>> Thanks for help, >>> >>> Manuel >>> >>> >>> >>> >>> On Tue, 2008-09-09 at 15:35 -0500, Steve Baker wrote: >>> >>> >>>> Are you perhaps calling mhMotion from anywhere else? >>>> >>>> The problem is that under X11, you can only read the keyboard modifiers >>>> from inside an X11 key/mouse event. In windows there is no such >>>> restriction. >>>> >>>> However, it looks like you're doing exactly that in your example - so >>>> theoretically, >>>> there should be no problem. >>>> >>>> But if you were calling mhMotion someplace else - that would be bad. >>>> >>>> >>>> Manuel wrote: >>>> >>>> >>>>> I've a simple function like: >>>>> >>>>> void mhMotion(int x,int y) >>>>> { >>>>> >>>>> G.modifiersKeyState = glutGetModifiers(); >>>>> ...cut... >>>>> glutPostRedisplay(); >>>>> } >>>>> >>>>> and then >>>>> >>>>> glutMotionFunc(mhMotion); >>>>> >>>>> Under Windows it work without messages, while in Ubuntu, it return: >>>>> >>>>> "freeglut glutGetModifiers() called outside an input callback" >>>>> >>>>> Any suggestions? >>>>> >>>>> Best regards, >>>>> >>>>> Manuel >>>>> >>>>> PS: G is a global structure. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------- >>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>>>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>>>> Grand prize is a trip for two to an Open Source event anywhere in the world >>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>>> _______________________________________________ >>>>> Freeglut-developer mailing list >>>>> Fre...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >>>>> >>>>> >>>>> >>>> ------------------------------------------------------------------------- >>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>>> Grand prize is a trip for two to an Open Source event anywhere in the world >>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>> _______________________________________________ >>>> Freeglut-developer mailing list >>>> Fre...@li... >>>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >>>> >>>> >>>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Freeglut-developer mailing list >>> Fre...@li... >>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >>> >>> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Freeglut-developer mailing list >> Fre...@li... >> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >> >> > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |
From: Manuel <in...@ma...> - 2008-09-10 21:23:17
|
On Wed, 2008-09-10 at 07:55 -0500, Steve Baker wrote: > Oh!!! OK - now I get it - I hadn't noticed that this was the PASSIVE motion > callback. > > I don't think you can call glutGetModifiers there either. The "passive > motion" > callback doesn't involve a key up/down event. Thanks! In fact, reading some docs, in example this: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/glutGetModifiers.3.html it seem that the callbacks to be used are only 3 (I've this suspect looking the "see also" section): -------------------- glutGetModifiers returns the modifier key state at the time the input event for a keyboard, special, or mouse callback is generated. This routine may only be called while a keyboard, special, or mouse callback is being handled. The window system is permitted to intercept window system defined modifier key strokes or mouse buttons, in which case, no GLUT callback will be generated. This interception will be independent of use of glutGetModifiers. SEE ALSO glutSpecialFunc(3G), glutKeyboardFunc(3G), glutMouseFunc(3G) ------------------- So maybe it's correct that glutGetModifiers don't work for motion (both active and passive mode) of mouse....it can be just a lack of explicit documentation. Anyway (thanks John!!!) this is the stack back-trace: --------------------- Breakpoint 1, mhMotion (x=308, y=402) at ./src/glmodule.c:142 142 G.diffx=x-g_lastx; (gdb) where #0 mhMotion (x=308, y=402) at ./src/glmodule.c:142 #1 0xb7d64091 in glutMainLoopEvent () from /usr/lib/libglut.so.3 #2 0xb7d64326 in glutMainLoop () from /usr/lib/libglut.so.3 #3 0x0804b3ca in mhGlutLoop () at ./src/glmodule.c:453 #4 0x080497f6 in mh_startWindow (self=0x0, args=0xb794b02c) at ./src/main.c:143 #5 0xb7ec25ea in PyCFunction_Call () from /usr/lib/libpython2.5.so.1.0 #6 0xb7f10e16 in PyEval_EvalFrameEx () from /usr/lib/libpython2.5.so.1.0 #7 0xb7f11490 in PyEval_EvalFrameEx () from /usr/lib/libpython2.5.so.1.0 #8 0xb7f125a8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.5.so.1.0 #9 0xb7f12703 in PyEval_EvalCode () from /usr/lib/libpython2.5.so.1.0 #10 0xb7f35b1a in PyRun_FileExFlags () from /usr/lib/libpython2.5.so.1.0 #11 0xb7f08c0b in ?? () from /usr/lib/libpython2.5.so.1.0 #12 0xb7ec25ea in PyCFunction_Call () from /usr/lib/libpython2.5.so.1.0 #13 0xb7f10e16 in PyEval_EvalFrameEx () from /usr/lib/libpython2.5.so.1.0 #14 0xb7f125a8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.5.so.1.0 #15 0xb7f12703 in PyEval_EvalCode () from /usr/lib/libpython2.5.so.1.0 #16 0xb7f338ac in PyRun_StringFlags () from /usr/lib/libpython2.5.so.1.0 #17 0xb7f34b93 in PyRun_SimpleStringFlags () from /usr/lib/libpython2.5.so.1.0 #18 0x0804a492 in main (argc=1, argv=0xbfde4be4) at ./src/main.c:583 (gdb) quit ------------------ Do you see some strangeness here? THANKS, Manuel > > You have to remember the state of the modifiers when the mouse button > goes down. > In X11, if you start a "shift-drag" or "ctrl-drag" mouse operation and > release the > shift or ctrl key partway through the drag, the operation will continue > as if you > held the key down. The kind of click you have is only knowable at the > onset or > the end of the click/drag/release operation. > > One of those ikky little things sent to drive cross-platform programmers > nuts! > > -- Steve. > > Manuel wrote: > > On Tue, 2008-09-09 at 17:23 -0500, Steve Baker wrote: > > > >> I think you'll have to use a debugger to figure out where > >> glutGetModifiers is being called from - a stack back-trace should enable > >> you to figure it out. > >> > > > > > > I've double checked the code. > > The mhMotion is called only by glutMotionFunc. > > I know all glutGetModifiers calls because I've added them just > > yesterday: they are only in the module I've posted in previous email. > > Some additional infos: > > when glutGetModifiers is called by others callbacks event, like: > > glutMouseWheelFunc > > glutMouseFunc > > glutKeyboardFunc > > it work fine. > > The problem seem to be related only to mouse motion (passive too). > > I'm not expert in gdb, so, to be sure about the problem, I've done a > > simple experiments: > > > > I've written a new callback function: > > > > void mhMotionFoo(int x,int y) > > { > > int a = glutGetModifiers(); > > } > > > > I've reproduced the bug with mhMotionFoo too. If I comment the call of > > glutGetModifiers(): > > > > void mhMotionFoo(int x,int y) > > { > > //int a = glutGetModifiers(); > > } > > > > all work fine. > > > > Unfortunately C is not my primary language, so I'm not so expert to > > handle a debugger sessions. Any help is very appreciated. > > Anyway the simple test above should be sufficiently indicative that the > > problem is related just to motion function. > > > > Best regards, > > > > Manuel > > > > > > > > > > > > > > > >> -- Steve > >> > >> Manuel wrote: > >> > >>> Thanks for fast reply. > >>> Here is the code: > >>> > >>> http://makehuman.svn.sourceforge.net/viewvc/makehuman/trunk/mh_phoenix/src/glmodule.c?revision=572&view=markup > >>> > >>> In my local copy, to test the bug, I've commented all glutGetModifiers() > >>> calls, except one in mhMotion (line 140). In detail, here I've: > >>> > >>> void mhMotion(int x,int y) > >>> 141 { > >>> ... > >>> 144 G.modifiersKeyState = glutGetModifiers(); > >>> ... > >>> 147 int modf = 0; > >>> > >>> instead > >>> > >>> void mhMotion(int x,int y) > >>> 141 { > >>> ... > >>> 144 G.modifiersKeyState = glutGetModifiers(); > >>> ... > >>> 147 int modf = glutGetModifiers(); > >>> > >>> > >>> So only the call in line 144, but the message happen again... > >>> Thanks for help, > >>> > >>> Manuel > >>> > >>> > >>> > >>> > >>> On Tue, 2008-09-09 at 15:35 -0500, Steve Baker wrote: > >>> > >>> > >>>> Are you perhaps calling mhMotion from anywhere else? > >>>> > >>>> The problem is that under X11, you can only read the keyboard modifiers > >>>> from inside an X11 key/mouse event. In windows there is no such > >>>> restriction. > >>>> > >>>> However, it looks like you're doing exactly that in your example - so > >>>> theoretically, > >>>> there should be no problem. > >>>> > >>>> But if you were calling mhMotion someplace else - that would be bad. > >>>> > >>>> > >>>> Manuel wrote: > >>>> > >>>> > >>>>> I've a simple function like: > >>>>> > >>>>> void mhMotion(int x,int y) > >>>>> { > >>>>> > >>>>> G.modifiersKeyState = glutGetModifiers(); > >>>>> ...cut... > >>>>> glutPostRedisplay(); > >>>>> } > >>>>> > >>>>> and then > >>>>> > >>>>> glutMotionFunc(mhMotion); > >>>>> > >>>>> Under Windows it work without messages, while in Ubuntu, it return: > >>>>> > >>>>> "freeglut glutGetModifiers() called outside an input callback" > >>>>> > >>>>> Any suggestions? > >>>>> > >>>>> Best regards, > >>>>> > >>>>> Manuel > >>>>> > >>>>> PS: G is a global structure. > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> ------------------------------------------------------------------------- > >>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > >>>>> Build the coolest Linux based applications with Moblin SDK & win great prizes > >>>>> Grand prize is a trip for two to an Open Source event anywhere in the world > >>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >>>>> _______________________________________________ > >>>>> Freeglut-developer mailing list > >>>>> Fre...@li... > >>>>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer > >>>>> > >>>>> > >>>>> > >>>> ------------------------------------------------------------------------- > >>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > >>>> Build the coolest Linux based applications with Moblin SDK & win great prizes > >>>> Grand prize is a trip for two to an Open Source event anywhere in the world > >>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >>>> _______________________________________________ > >>>> Freeglut-developer mailing list > >>>> Fre...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer > >>>> > >>>> > >>>> > >>> ------------------------------------------------------------------------- > >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > >>> Build the coolest Linux based applications with Moblin SDK & win great prizes > >>> Grand prize is a trip for two to an Open Source event anywhere in the world > >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >>> _______________________________________________ > >>> Freeglut-developer mailing list > >>> Fre...@li... > >>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer > >>> > >>> > >> ------------------------------------------------------------------------- > >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > >> Build the coolest Linux based applications with Moblin SDK & win great prizes > >> Grand prize is a trip for two to an Open Source event anywhere in the world > >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >> _______________________________________________ > >> Freeglut-developer mailing list > >> Fre...@li... > >> https://lists.sourceforge.net/lists/listinfo/freeglut-developer > >> > >> > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > > Build the coolest Linux based applications with Moblin SDK & win great prizes > > Grand prize is a trip for two to an Open Source event anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Freeglut-developer mailing list > > Fre...@li... > > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |
From: Rolf S. <ro...@sc...> - 2009-03-06 09:34:37
|
Hi! there seems to be a problem with FreeGLUT's event queue. We've developed a large application with a comprehensive GUI. In fact, we developed an object oriented user interface kit featuring all kinds of components (buttons, toggles, slider, menus, forms, panes, etc.) which is entirely based on OpenGL/FreeGLUT... It runs under Linux, Mac & Windows and the performance so far is great! The problem is, as soon as our app must perform some complex tasks (rendering 1000s of points/lines/polygons, glDrawPixels of highres images >3k, doing some intensive background computations) while we feed events into the queue using the mouse, the window rendering "hangs" for a short moment. This does *not* happen, if we simply refresh the window display without feeding event into the queue (e.g. playback a sequence of frames). It seems that if the event queue becomes "flooded" with too many events, it skips rendering until the queue is has been "flushed" again. We see this behavior on all platforms! Does this make sense to you? ...or does it sound familiar? FYI, we use a modified version of FreeGLUT 2.4... Any help would be great! Thanks a lot, Rolf -- S c i e n c e . D . V i s i o n s Heiliger Weg 60 44135 Dortmund Germany phone +49.231.1675.450 fax +49.231.1675.451 |
From: Rolf S. <ro...@sc...> - 2009-03-09 11:10:23
|
Hmm... has no one an idea what could be going on, here? R. Rolf Schneider wrote: > Hi! > > there seems to be a problem with FreeGLUT's event queue. > > We've developed a large application with a comprehensive GUI. In fact, > we developed an object oriented user interface kit featuring all kinds > of components (buttons, toggles, slider, menus, forms, panes, etc.) > which is entirely based on OpenGL/FreeGLUT... > > It runs under Linux, Mac & Windows and the performance so far is great! > > The problem is, as soon as our app must perform some complex tasks > (rendering 1000s of points/lines/polygons, glDrawPixels of highres > images >3k, doing some intensive background computations) while we feed > events into the queue using the mouse, the window rendering "hangs" for > a short moment. This does *not* happen, if we simply refresh the window > display without feeding event into the queue (e.g. playback a sequence > of frames). > > It seems that if the event queue becomes "flooded" with too many events, > it skips rendering until the queue is has been "flushed" again. > > We see this behavior on all platforms! > > Does this make sense to you? ...or does it sound familiar? > > FYI, we use a modified version of FreeGLUT 2.4... > > Any help would be great! > > Thanks a lot, > > Rolf > > -- S c i e n c e . D . V i s i o n s Heiliger Weg 60 44135 Dortmund Germany phone +49.231.1675.450 fax +49.231.1675.451 |
From: Fay, J. F Dr C. U. A. 46 S. <joh...@eg...> - 2009-03-09 14:21:37
|
Rolf, First, I would encourage you to try again with the latest SVN version of "freeglut". There have been a lot of changes made since the 2.4.0 release, although I do not know that anything has changed that will fix your problem. What you are describing sounds reasonable to the extent that if you have a computer do a lot of stuff, performance is likely to suffer. The function "glutMainLoop" is found in "freeglut_main.c" starting on line 1451 and it calls "glutMainLoopEvent" which starts on line 951 of the same file. Within the latter function there is a while loop (starting on line 969 for X11 and on line 1419 for Windows) that continues to handle events as long as the operating system continues to send them. This would explain the pause in rendering if the event queues were flooded, but it doesn't explain why the flooding would occur. My first course of action would be to stick a "fprintf" statement in at the beginning of the while-loop to see whether the queue is actually being flooded, and if so with what. - John (originally sent from home on Sat 3/7/2009 6:52 PM) John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294 -----Original Message----- From: Rolf Schneider [mailto:ro...@sc...] Sent: Monday, March 09, 2009 5:55 AM To: FreeGLUT developers list Subject: Re: [Freeglut-developer] Event queue problem Hmm... has no one an idea what could be going on, here? R. Rolf Schneider wrote: > Hi! > > there seems to be a problem with FreeGLUT's event queue. > > We've developed a large application with a comprehensive GUI. In fact, > we developed an object oriented user interface kit featuring all kinds > of components (buttons, toggles, slider, menus, forms, panes, etc.) > which is entirely based on OpenGL/FreeGLUT... > > It runs under Linux, Mac & Windows and the performance so far is great! > > The problem is, as soon as our app must perform some complex tasks > (rendering 1000s of points/lines/polygons, glDrawPixels of highres > images >3k, doing some intensive background computations) while we feed > events into the queue using the mouse, the window rendering "hangs" for > a short moment. This does *not* happen, if we simply refresh the window > display without feeding event into the queue (e.g. playback a sequence > of frames). > > It seems that if the event queue becomes "flooded" with too many events, > it skips rendering until the queue is has been "flushed" again. > > We see this behavior on all platforms! > > Does this make sense to you? ...or does it sound familiar? > > FYI, we use a modified version of FreeGLUT 2.4... > > Any help would be great! > > Thanks a lot, > > Rolf > > -- S c i e n c e . D . V i s i o n s Heiliger Weg 60 44135 Dortmund Germany phone +49.231.1675.450 fax +49.231.1675.451 ------------------------------------------------------------------------ ------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Freeglut-developer mailing list Fre...@li... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
From: Manuel <in...@ma...> - 2008-09-09 21:05:08
|
On Tue, 2008-09-09 at 15:35 -0500, Steve Baker wrote: > But if you were calling mhMotion someplace else - that would be bad. Sorry, I've send previous email without reply about this important aspect, so I add the info here: mhMotion is called only by glutMotionFunc. Regards, Manuel |