DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2006 Torus Knot Software Ltd Also see acknowledgements in Readme.html You may use this sample code for anything you like, it is not covered by the LGPL like the rest of the engine. ----------------------------------------------------------------------------- */ #ifndef _OceanDemo_H_ #define _OceanDemo_H_ #include "CEGUI/CEGUI.h" #include "OgreCEGUIRenderer.h" #include "OgreConfigFile.h" #include "OgreStringConverter.h" #include "OgreException.h" #include "OgreFrameListener.h" #include "MaterialControls.h" #include
//--------------------------------------------------------------------------- enum MovementType { mv_CAMERA, mv_MODEL, mv_LIGHT }; //--------------------------------------------------------------------------- class OceanDemo; class OceanDemo_FrameListener : public Ogre::FrameListener, public OIS::KeyListener, OIS::MouseListener { #define MINSPEED .150f #define MOVESPEED 30 #define MAXSPEED 1.800f protected: OceanDemo* mMain; Ogre::Vector3 mTranslateVector; bool mStatsOn; unsigned int mNumScreenShots; bool mWriteToFile; float mMoveScale; float mRotScale; float mSpeed; float mAvgFrameTime; int mSceneDetailIndex; Ogre::Real mMoveSpeed; Ogre::Real mRotateSpeed; float mSkipCount; float mUpdateFreq; CEGUI::Point mLastMousePosition; bool mLastMousePositionSet; bool mSpinModel; bool mSpinLight; OIS::Mouse *mMouse; OIS::Keyboard *mKeyboard; OIS::InputManager* mInputManager; // just to stop toggles flipping too fast Ogre::Real mTimeUntilNextToggle ; float mRotX, mRotY; Ogre::TextureFilterOptions mFiltering; int mAniso; bool mQuit; bool mLMBDown; bool mRMBDown; bool mProcessMovement; bool mUpdateMovement; bool mMoveFwd; bool mMoveBck; bool mMoveLeft; bool mMoveRight; CEGUI::Renderer* mGuiRenderer; CEGUI::Window* mGuiAvg; CEGUI::Window* mGuiCurr; CEGUI::Window* mGuiBest; CEGUI::Window* mGuiWorst; CEGUI::Window* mGuiTris; CEGUI::Window* mGuiDbg; CEGUI::Window* mRoot; std::string mDebugText; CEGUI::MouseButton convertOISButtonToCegui(int ois_button_id); void CheckMovementKeys( CEGUI::Key::Scan keycode, bool state ); void updateStats(void); public: OceanDemo_FrameListener(OceanDemo* main); virtual ~OceanDemo_FrameListener(); virtual bool mouseMoved ( const OIS::MouseEvent &arg ); virtual bool mousePressed ( const OIS::MouseEvent &arg, OIS::MouseButtonID id ); virtual bool mouseReleased ( const OIS::MouseEvent &arg, OIS::MouseButtonID id ); virtual bool keyPressed ( const OIS::KeyEvent &arg ); virtual bool keyReleased ( const OIS::KeyEvent &arg ); bool frameStarted(const Ogre::FrameEvent& evt); bool handleMouseMove(const CEGUI::EventArgs& e); bool handleMouseButtonUp(const CEGUI::EventArgs& e); bool handleMouseButtonDown(const CEGUI::EventArgs& e); bool handleMouseWheelEvent(const CEGUI::EventArgs& e); bool handleKeyDownEvent(const CEGUI::EventArgs& e); bool handleKeyUpEvent(const CEGUI::EventArgs& e); bool handelModelSpinChange(const CEGUI::EventArgs& e); bool handelLightSpinChange(const CEGUI::EventArgs& e); }; //--------------------------------------------------------------------------- class OceanDemo { protected: Ogre::Root* mRoot; Ogre::Camera* mCamera; Ogre::SceneManager* mSceneMgr; // the scene node of the entity Ogre::SceneNode* mMainNode; OceanDemo_FrameListener* mFrameListener; Ogre::RenderWindow* mWindow; CEGUI::OgreCEGUIRenderer* mGUIRenderer; CEGUI::System* mGUISystem; Ogre::Entity* mCurrentEntity; Ogre::Entity* mOceanSurfaceEnt; size_t mCurrentMaterial; Ogre::MaterialPtr mActiveMaterial; Ogre::Pass* mActivePass; Ogre::GpuProgramPtr mActiveFragmentProgram; Ogre::GpuProgramPtr mActiveVertexProgram; Ogre::GpuProgramParametersSharedPtr mActiveFragmentParameters; Ogre::GpuProgramParametersSharedPtr mActiveVertexParameters; typedef std::vector< ShaderControlGUIWidget > ShaderControlContainer; typedef ShaderControlContainer::iterator ShaderControlIterator; ShaderControlContainer mShaderControlContainer; MaterialControlsContainer mMaterialControlsContainer; CEGUI::Scrollbar* mVertScroll; MovementType mMouseMovement; // These internal methods package up the stages in the startup process /** Sets up the application - returns false if the user chooses to abandon configuration. */ bool setup(void); /** Configures the application - returns false if the user chooses to abandon configuration. */ bool configure(void); void chooseSceneManager(void); void createCamera(void); void createViewports(void); /// Method which will define the source of resources (other than current folder) void setupResources(void); void loadResources(void); bool setupGUI(void); void createScene(void); void createFrameListener(void); void initComboBoxes(void); void initDemoEventWiring(void); void configureShaderControls(void); void doErrorBox(const char* text); bool handleQuit(const CEGUI::EventArgs& e); bool handleShaderControl(const CEGUI::EventArgs& e); bool handleModelComboChanged(const CEGUI::EventArgs& e); bool handleShaderComboChanged(const CEGUI::EventArgs& e); bool handleScrollControlsWindow(const CEGUI::EventArgs& e); bool handleMovementTypeChange(const CEGUI::EventArgs& e); bool handleErrorBox(const CEGUI::EventArgs& e); void setShaderControlVal(const float val, const size_t index); public: OceanDemo() : mRoot(0), mFrameListener(0), mGUIRenderer(NULL), mGUISystem(0), mCurrentEntity(0), mCurrentMaterial(0), mActivePass(0), mMouseMovement(mv_CAMERA) { } ~OceanDemo(); void go(void); Ogre::Camera* getCamera(void) const { return mCamera; } Ogre::SceneManager* getSceneManager(void) const { return mSceneMgr; } Ogre::RenderWindow* getRenderWindow(void) const { return mWindow; } MovementType getMouseMovement(void) const { return mMouseMovement; } Ogre::SceneNode* getMainNode(void) const { return mMainNode; } }; #endif // end _OceanDemo_H_
OceanDemo.h
Page URL
File URL
Prev
20/35
Next
Download
( 6 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.