Jump to content
  • Advertisement
Sign in to follow this  
daskrs

OpenSceneGraph + SDL + Guichan input problem

This topic is 3557 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i trying join OSG +SDL +Guichan. And I had a problem with Guichan input. The widgets are rending but the events not work. I use the following code to the events
Quote:
bool SDLbase::convertEvents(SDL_Event& event, osgGA::EventQueue& eventQueue) { switch (event.type) { case SDL_MOUSEMOTION: eventQueue.mouseMotion(event.motion.x, event.motion.y); return true; case SDL_MOUSEBUTTONDOWN: eventQueue.mouseButtonPress(event.button.x, event.button.y, event.button.button); return true; case SDL_MOUSEBUTTONUP: eventQueue.mouseButtonRelease(event.button.x, event.button.y, event.button.button); return true; case SDL_KEYUP: eventQueue.keyRelease( (osgGA::GUIEventAdapter::KeySymbol) event.key.keysym.unicode); return true; case SDL_KEYDOWN: eventQueue.keyPress( (osgGA::GUIEventAdapter::KeySymbol) event.key.keysym.unicode); return true; case SDL_VIDEORESIZE: eventQueue.windowResize(0, 0, event.resize.w, event.resize.h ); return true; default: break; } return false; } void SDLbase::events() { // message processing loop SDL_Event event; while (SDL_PollEvent(&event)) { this->convertEvents(event, *(scene3d->gw->getEventQueue())); // check for messages switch (event.type) { // exit if the window is closed case SDL_QUIT: done = true; break; // check for keypresses case SDL_KEYDOWN: { // exit if ESCAPE is pressed if (event.key.keysym.sym == SDLK_ESCAPE) done = true; break; } } // end switch guichan->input->pushInput(event); } // end of message processing }
Anyone know what is wrong? EDIT: here is the link to complete source source [Edited by - daskrs on November 18, 2008 5:38:43 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!