Thread: [Plib-users] Errors using PW
Brought to you by:
sjbaker
From: Tinoshi K. <ti...@li...> - 2005-09-19 16:39:34
|
Hello everybody! I have got a big problem with PW. Well, when I use PW my program crashes = whenever I call something like glOrtho(), or glVertex() etc... The = debugger says it's due to an access violation. I guess it is 'cause I = created my windows using pwInit() and OpenGL doesn't know what is the = 'current' window (i.e. says 'this' is NULL).=20 What can I do? I want to use pwInit() instead of glutMainLoop() etc. = 'cause I need a keyboard function who can deal with multiple pressed and = released keys.=20 It is not a 'coding' problem because using the 'glut approach' = (glutMainLoop etc... and callbacks) everything works great! Thanks! |
From: Steve B. <sjb...@ai...> - 2005-09-20 04:18:59
|
Tinoshi Kitazawa wrote: > Hello everybody! > > I have got a big problem with PW. Well, when I use PW my program crashes > whenever I call something like glOrtho(), or glVertex() etc... The > debugger says it's due to an access violation. I guess it is 'cause I > created my windows using pwInit() and OpenGL doesn't know what is the > 'current' window (i.e. says 'this' is NULL). Weird. I havn't seen that happen before. Do the 'PW' demo programs work on your machine? > What can I do? I want to use pwInit() instead of > glutMainLoop() etc. 'cause I need a keyboard function who can deal with > multiple pressed and released keys. You can do that in GLUT. Check out: glutKeyboardUpFunc/glutSpecialUpFunc. You can use the regular glutKeyboardFunc to detect keys pressed down and use the UpFunc to figure out when they are released - then you can keep an array with one element per key character to handle multiple press/releases. However: 1) Be sure to disable key auto-repeat - which confuse the issue horribly. 2) Beware of the situation where someone presses (say) 'a' - then pushes down the shift key - then releases the 'a'...which will now report as the capital 'A' being released. PW has the same kinds of problems. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Tinoshi K. <ti...@li...> - 2005-09-20 07:57:48
|
Thanks for the answer, I solved the problem, but I really don't know why. I know how, however: I cut&pasted my old code (where I used glutMainLoop() etc... ), put some objects into the scenegraph, the sky, the sea etc... used the functions begin2D() and end2D() given in viewer.cxx. Everything worked fine. Then I've simply commented the glut initialization and main loop and put the pwInit() etc.. instead. The crash happened while trying to glutGet ( (GLenum) GLUT_WINDOW_HEIGHT ) ; and, deleting this line, in glOrtho(). The strange thing is that if I don't show the 2D text and figures (I'm developing a Flight simulator, so I mean the HUD etc..) the sea and the sky are displayed correctly, but nothing in the scenegraph is drawned. Well, I re-wrote the whole code, avoided using begin2D() etc... and now everything works fine... but I don't know really what happened. It was just a stupid mistake I think so I ask you please forgive me, but the gl calls are quite the same in the working code and in the crashing one! The debugger only said access violation for the glutGet(), so I thought that it didn't know my pw window's address... or something like that. Well, excuse me for bothering, but I was going crazy... May I ask you a few questions? Where can I find a list of changes between plib 1.8.3 and 1.8.4? Where can I find source code using plib's collision detection not only for HOT, but also for the other two methods? THANK YOU SO MUCH!!!! |
From: Steve B. <sjb...@ai...> - 2005-09-20 22:22:40
|
Tinoshi Kitazawa wrote: > The crash happened while trying to > glutGet ( (GLenum) GLUT_WINDOW_HEIGHT ) ; Wooaah. You aren't trying to use glutGet inside a PW program are you? That wouldn't work. *EITHER* use GLUT *OR* use PW - you can't mix them. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |