Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef vlWXGLCanvas_INCLUDE_ONCE
00033 #define vlWXGLCanvas_INCLUDE_ONCE
00034
00035 #include <vlWX/link_config.hpp>
00036 #include <vlGraphics/OpenGLContext.hpp>
00037 #include <vlCore/Time.hpp>
00038 #include <wx/frame.h>
00039 #include <wx/glcanvas.h>
00040 #include <wx/timer.h>
00041 #include <wx/dcclient.h>
00042 #include <wx/image.h>
00043 #include <wx/app.h>
00044
00045 #if !wxUSE_GLCANVAS
00046 #error "OpenGL required: set wxUSE_GLCANVAS to 1 and rebuild the library"
00047 #endif
00048
00049 namespace vlWX
00050 {
00052 class VLWX_EXPORT WXGLCanvas: public wxGLCanvas, public vl::OpenGLContext
00053 {
00054 public:
00055 WXGLCanvas( wxWindow *parent,
00056 const wxGLContext *shared,
00057 wxWindowID id = wxID_ANY,
00058 const wxPoint& pos = wxDefaultPosition,
00059 const wxSize& size = wxDefaultSize,
00060 long style = 0,
00061 int *attribList = 0,
00062 const wxString& name = wxT("WXGLCanvas"),
00063 const wxPalette& palette = wxNullPalette );
00064
00065 ~WXGLCanvas();
00066
00067 void OnPaint(wxPaintEvent& ev);
00068 void OnSize(wxSizeEvent& ev);
00069 void OnEraseBackground(wxEraseEvent& ev);
00070 void OnKeyDown(wxKeyEvent& ev);
00071 void OnKeyUp(wxKeyEvent& ev);
00072
00073 void OnMouseMotion(wxMouseEvent &ev);
00074 void OnMouseDown(wxMouseEvent &ev);
00075 void OnMouseUp(wxMouseEvent &ev);
00076 void OnMouseWheel( wxMouseEvent& ev );
00077 void OnMouseEnter(wxMouseEvent& ev);
00078 void OnIdle(wxIdleEvent& ev);
00079 void OnDropFiles(wxDropFilesEvent& ev);
00080
00081 bool setFullscreen(bool fullscreen);
00082 void quitApplication();
00083 void makeCurrent();
00084 void swapBuffers();
00085 void getFocus();
00086 void setMousePosition(int x, int y);
00087 void update();
00088 void setWindowTitle(const vl::String& text);
00089 void show();
00090 void hide();
00091 void setPosition(int x, int y);
00092 void setSize(int w, int h);
00093 vl::ivec2 position() const;
00094 void setMouseVisible(bool visible);
00095
00096 private:
00097 wxCursor mCursor;
00098 int mMouseCount;
00099 DECLARE_EVENT_TABLE()
00100 };
00101 }
00102
00103 #endif