1 / 17

Input

Input. Zhaohui Ning Aaron Cardwell Boonthanome Nouanesengsy. Outline. Ogre Input Other input toolkits SDL OIS CEGUI. Ogre Input. Not supported well Does not support joysticks Inconsistent Use 0, 1, 2 or a mask to determine mouse button Mouse event in mouseDragged always returns 0.

acoughlin
Download Presentation

Input

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Input Zhaohui Ning Aaron Cardwell Boonthanome Nouanesengsy

  2. Outline • Ogre Input • Other input toolkits • SDL • OIS • CEGUI

  3. Ogre Input • Not supported well • Does not support joysticks • Inconsistent • Use 0, 1, 2 or a mask to determine mouse button • Mouse event in mouseDragged always returns 0

  4. SDL • Simple DirectMedia Layer • Provides low level access to audio, keyboard, mouse, and video • Cross-platform

  5. SDL Input • Keyboard Input • Mouse Input • Joystick Input

  6. Example Code SDL_Event event; while(SDL_PollEvent(&event)) { switch(event.type) { case SDL_KEYDOWN: out<<"Oh! Key press\n"; break; case SDL_MOUSEMOTION: out<<"Mouse Motion\n"; break; case SDL_QUIT: i=-1; break; default: out<<"I don't know what this event is!\n"; } }

  7. SDL with Ogre • Requires DirectX to compile • SDL wants to create its own window • Must tell SDL to use the Ogre window

  8. OIS Object Oriented Input System Phillip Castaneda zlib/libpng License 0.6.0 MS Windows, Linux

  9. Manual WreckedLibs:OIS:Manual Mouse Keyboard Joystick

  10. Compiling Official ReleaseFFTestErrors.txtFix An OIS InputManager available on Wiki http://www.ogre3d.org/wiki/index.php/Using_OIS Practical Application - Let's Get Started A working version Basic Tutorial 5

  11. CEGUI • CEGUI (Crazy Eddies Graphical User Interface) • Free graphical interface for graphics API’s which do not have or have a lacking graphical interface system • Combines graphical 2D overlaying displays with mouse input interfaces for the user

  12. CEGUI • Pro’s • Free for use under LGPL licensing • Already integrated in Ogre3D • Tutorials provided in OgreSDK and Ogre’s Wiki on using CEGUI with Ogre • Good responsive forums • Decent wiki with documentation for CEGUI classes and tutorials

  13. CEGUI • Cons • Random “holes” in documentation and tutorials but you can still figure most things out from forums • Large amount of external script files to compose a “Look” and a “scheme” are complicated • .scheme, .lookNfeel, .imageset, .layout

  14. CEGUI • Cons (Cont.) • One major con of CEGUI is its problem in slow speed with lots of windows and elements as noticed in the provided ogre + CEGUI sample. • Child windows with lots of events and elements cause a messaging slowdown because of the cascading mouse move events

  15. CEGUI • Solution to slowness of many layouts • Be careful and weary of using large CEGUI windows. • Efficiently group smaller child windows to exclude unnecessary checks on mouse enter/exits

  16. CEGUI • Features • Easily displayable overlays with a multitude of functionality • Static images, text boxes, buttons • Use of XML to import layouts from a easily changeable file • Build your own layouts into xml files using their “official” layout editor

  17. CEGUI • Features of using the editor • Very easy setup of the layout of a graphical display • Tree structure and snap-able grid for layout modification • Downfalls of using the editor • No ability to add specific images • Must still manually code in the event function calls • Missing attributes in the editor

More Related