Go to the documentation of this file.00001 #ifndef __NYTRO_RenderWindow_H
00002 #define __NYTRO_RenderWindow_H
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "system/nyCommon.h"
00012 #include "system/nyApplication.h"
00013
00014 namespace Nytro
00015 {
00016 namespace Graphics
00017 {
00020 class NYTRO_API RenderWindowObserver : IObserver
00021 {
00022 public:
00023
00025 virtual void onWindowEvent(){};
00026 };
00027
00029 class NYTRO_API RenderWindow: public Observable<RenderWindowObserver>
00030 {
00031 public:
00032
00034 enum EWindowEvent
00035 {
00036 eWindowEvent_GotFocus,
00037 eWindowEvent_LostFocus,
00038 eWindowEvent_MouseDown,
00039 eWindowEvent_MouseUp,
00040 eWindowEvent_DoubleClick,
00041 eWindowEvent_MouseMove,
00042 eWindowEvent_WindowMove,
00043 eWindowEvent_WindowShow,
00044 eWindowEvent_WindowHide
00045 };
00046
00048 enum EMouseButton
00049 {
00050 eMouseButton_Left,
00051 eMouseButton_Right,
00052 eMouseButton_Middle
00053 };
00054
00055 RenderWindow();
00056 virtual ~RenderWindow();
00057
00059 EResult create( uint32 aIconID, int32 aLeft = INT_MAX, int32 aTop = INT_MAX,
00060 uint32 aWidth = INT_MAX, uint32 aHeight = INT_MAX,
00061 const char* pTitle = "Nytro Game Engine" );
00063 EWindowEvent getEvent();
00065 void getEventMousePosition( int32& rX, int32& rY );
00067 EMouseButton getEventMouseButton();
00069 bool isFocused();
00071 TWindowHandle getHandle();
00073 EResult getPosition( int32& rX, int32& rY );
00075 EResult getSize( uint32& rWidth, uint32& rHeight );
00077 string getTitle();
00080 bool isExternalWindow();
00082 void setEvent( EWindowEvent aValue );
00084 void setEventMousePosition( int32 aX, int32 aY );
00086 void setEventMouseButton( EMouseButton aValue );
00088 void setMousePosition( int32 aX, int32 aY, bool bRelativeToWindow = true );
00090 void setFocus();
00093 void setHandle( TWindowHandle aHandle );
00095 EResult setPosition( int32 aX, int32 aY );
00097 EResult setSize( uint32 aWidth, uint32 aHeight );
00099 EResult setTitle( const char* pTitle );
00101 EResult setBorderVisible( bool bShow );
00103 EResult setMouseVisible( bool bShow );
00105 EResult close();
00107 EResult destroy();
00108
00109 private:
00110
00112 TWindowHandle m_hWindow;
00114 bool m_bExternalWindow;
00116 EWindowEvent m_event;
00118 int32 m_eventX, m_eventY;
00120 EMouseButton m_eventMouseButton;
00121 };
00122 };
00123 };
00124
00125 #endif