Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
WindowSystem.h
Package: client.rar [view]
Upload User: wegemann
Upload Date: 2020-01-03
Package Size: 3891k
Code Size: 3k
Category:
Game Engine
Development Platform:
Visual C++
- #ifndef _WINDOW_SYSTEM_H
- #define _WINDOW_SYSTEM_H
- #include "Window/WndSysBase.h"
- #include <queue>
- #include "OIS/ois.h"
- #include "Ogre/OgreRenderWindow.h"
- #include "Ogre/OgreVector2.h"
- #define SYS_MOUSE_LEFT 0x01
- #define SYS_MOUSE_RIGHT 0x02
- #define SYS_MOUSE_MIDDLE 0x03
- #define SYS_MOUSE_BUTTON3 0x04
- #define SYS_MOUSE_BUTTON4 0x05
- #define SYS_MOUSE_BUTTON5 0x06
- #define SYS_MOUSE_BUTTON6 0x07
- #define SYS_MOUSE_BUTTON7 0x08
- class FadeSystem;
- class WindowSystem : public SingletonT<WindowSystem>
- {
- public:
- WindowSystem();
- ~WindowSystem();
- public:
- typedef std::vector<WndBase*> SingleShowControls;
- bool init(Ogre::RenderWindow* win,Ogre::SceneManager* pSceneMgr);
- void destroy();
- WndBase* getRootWindow();
- void renderStarted();
- void renderEnded();
- void process();
- void operation(float deltaTime);
- HRESULT winProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,bool& handled);
- void onWindowLost(WndBase* win);
- void activeWindow(WndBase* win);
- void unactuatedWindow(WndBase* win);
- bool getMouseOnWindow();
- void setLeftDown(bool down);
- bool getLeftDown();
- WndBase* getTopWindow();
- void clearTopWindow();
- Window* getParentWindow(WndBase* win);
- // OIS的输入处理
- bool onKeyDown(Ogre::uint key);
- bool onChar(Ogre::uint32 code);
- bool onKeyUp(Ogre::uint key);
- bool onKeyClick(Ogre::uint key);
- bool onMouseButtonDown(int button);
- bool onMouseButtonDoubleClick(int button);
- bool onMouseButtonUp(int button);
- bool onMouseMove(float delta_x, float delta_y);
- // windows消息
- bool onMouseWheel(int delta);
- void addSingleShowControl(WndBase* base);
- void removeSingleShowControl(WndBase* base);
- private:
- bool handleMouseLeftDown(); // 鼠标按下
- bool handleMouseLeftUp(); // 鼠标抬起
- bool handleMouseRightDown();
- bool handleMouseRightUp();
- bool handleMouseWheel(int delta);
- bool handleMouseMove(); // 鼠标移动
- bool onDoubleClick(); // 双击
- bool handleKeyDown(WPARAM wParam);
- bool handleKeyUp(WPARAM wParam);
- bool handleKeyClick(WPARAM wParam);
- bool handleChar(unsigned int code);
- private:
- WndBase* getTargetWindow(Point pos, bool check_handle = true);
- bool getExactnessCursorIndex(int &id);
- private:
- WndBase* m_focusWindow;
- //Window* m_focusWindowForKeyHandle;
- WndBase* m_focusWindowForKeyHandle;
- WndBase* m_mouseLeftDownWindow;
- WndBase* m_mouseRightDownWindow;
- WndBase* m_mouseOnWindow;
- WndBase* m_topWindow;
- WndBase* m_rootWindow;
- bool m_bLeftDown; // 鼠标左键在控件上按下
- bool m_bReturnDown;
- Ogre::RenderWindow* m_pWindow;
- bool m_bCursorSHow;
- SingleShowControls mSingleShowControls; // 没有父窗体的独立控件
- FadeSystem* mFadeSystem; // 淡入淡出系统
- };
- #endif // _WINDOW_SYSTEM_H