Visualization Library 2.0.0-b3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
WXGLCanvas.cpp
Go to the documentation of this file.
1 /**************************************************************************************/
2 /* */
3 /* Visualization Library */
4 /* http://visualizationlibrary.org */
5 /* */
6 /* Copyright (c) 2005-2017, Michele Bosi */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without modification, */
10 /* are permitted provided that the following conditions are met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, this */
13 /* list of conditions and the following disclaimer. */
14 /* */
15 /* - Redistributions in binary form must reproduce the above copyright notice, this */
16 /* list of conditions and the following disclaimer in the documentation and/or */
17 /* other materials provided with the distribution. */
18 /* */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
20 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
21 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
23 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
24 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
25 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
26 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
27 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
28 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 /* */
30 /**************************************************************************************/
31 
32 #include "vlWX/WXGLCanvas.hpp"
33 
34 using namespace vlWX;
35 using namespace vl;
36 
37 //-----------------------------------------------------------------------------
38 // WXGLCanvas
39 //-----------------------------------------------------------------------------
40 BEGIN_EVENT_TABLE(WXGLCanvas, wxGLCanvas)
41  EVT_IDLE(WXGLCanvas::OnIdle)
42  EVT_SIZE(WXGLCanvas::OnSize)
43  EVT_PAINT(WXGLCanvas::OnPaint)
44  EVT_ERASE_BACKGROUND(WXGLCanvas::OnEraseBackground)
45  EVT_KEY_DOWN( WXGLCanvas::OnKeyDown )
46  EVT_KEY_UP( WXGLCanvas::OnKeyUp )
47  /*EVT_CHAR( WXGLCanvas::OnChar )*/
48  EVT_ENTER_WINDOW( WXGLCanvas::OnMouseEnter )
49  EVT_ENTER_WINDOW (WXGLCanvas::OnMouseEnter)
50  EVT_LEFT_DOWN (WXGLCanvas::OnMouseDown)
51  EVT_MIDDLE_DOWN (WXGLCanvas::OnMouseDown)
52  EVT_RIGHT_DOWN (WXGLCanvas::OnMouseDown)
53  EVT_LEFT_UP (WXGLCanvas::OnMouseUp)
54  EVT_MIDDLE_UP (WXGLCanvas::OnMouseUp)
55  EVT_RIGHT_UP (WXGLCanvas::OnMouseUp)
56  EVT_MOUSEWHEEL (WXGLCanvas::OnMouseWheel)
57  EVT_MOTION (WXGLCanvas::OnMouseMotion)
58  EVT_DROP_FILES (WXGLCanvas::OnDropFiles)
59 END_EVENT_TABLE()
60 //-----------------------------------------------------------------------------
62 {
63  dispatchDestroyEvent();
64 }
65 //-----------------------------------------------------------------------------
67  wxWindow *parent,
68  const wxGLContext *shared,
69  wxWindowID id,
70  const wxPoint& pos,
71  const wxSize& size,
72  long style,
73  int *attribList,
74  const wxString& name,
75  const wxPalette& palette):
76 wxGLCanvas(parent, shared, id, pos, size, style, name, attribList)
77 {
78  // let wxWidgets manage the deletion of this object
79  setAutomaticDelete(false);
80  mMouseCount = 0;
81  DragAcceptFiles(true);
82 }
83 //-----------------------------------------------------------------------------
84 void WXGLCanvas::OnDropFiles(wxDropFilesEvent& ev)
85 {
86  std::vector<String> files;
87  for(int i=0; i<ev.GetNumberOfFiles(); ++i)
88  {
89  wxCharBuffer chars = ev.GetFiles()[i].ToUTF8();
90  String str = String::fromUTF8(chars.data());
91  files.push_back(str);
92  }
94 }
95 //-----------------------------------------------------------------------------
96 void WXGLCanvas::OnIdle(wxIdleEvent& ev)
97 {
98  if (continuousUpdate())
99  Refresh(false);
100  /*else
101  Time::sleep(1);*/
102 }
103 //-----------------------------------------------------------------------------
104 void WXGLCanvas::OnMouseEnter( wxMouseEvent& WXUNUSED(ev) )
105 {
106  SetFocus();
107 }
108 //-----------------------------------------------------------------------------
109 void WXGLCanvas::OnMouseMotion( wxMouseEvent& ev )
110 {
111  dispatchMouseMoveEvent( ev.GetX(), ev.GetY() );
112 }
113 //-----------------------------------------------------------------------------
114 void WXGLCanvas::OnMouseWheel( wxMouseEvent& ev )
115 {
116  int d = ev.GetWheelRotation() / ev.GetWheelDelta();
118 }
119 //-----------------------------------------------------------------------------
120 void WXGLCanvas::OnMouseUp( wxMouseEvent& ev )
121 {
122  if (ev.GetButton() == wxMOUSE_BTN_NONE)
123  return;
124  switch(ev.GetButton())
125  {
126  case wxMOUSE_BTN_LEFT: dispatchMouseUpEvent(LeftButton, ev.GetX(), ev.GetY()); break;
127  case wxMOUSE_BTN_MIDDLE: dispatchMouseUpEvent(MiddleButton, ev.GetX(), ev.GetY()); break;
128  case wxMOUSE_BTN_RIGHT: dispatchMouseUpEvent(RightButton, ev.GetX(), ev.GetY()); break;
129  default:
130  case wxMOUSE_BTN_ANY: dispatchMouseUpEvent(UnknownButton, ev.GetX(), ev.GetY()); break;
131  }
132  mMouseCount--;
133  // release only once
134  if (!mMouseCount)
135  ReleaseMouse();
136  VL_CHECK(mMouseCount>=0)
137 }
138 //-----------------------------------------------------------------------------
139 void WXGLCanvas::OnMouseDown( wxMouseEvent& ev )
140 {
141  if (ev.GetButton() == wxMOUSE_BTN_NONE)
142  return;
143  switch(ev.GetButton())
144  {
145  case wxMOUSE_BTN_LEFT: dispatchMouseDownEvent(LeftButton, ev.GetX(), ev.GetY()); break;
146  case wxMOUSE_BTN_MIDDLE: dispatchMouseDownEvent(MiddleButton, ev.GetX(), ev.GetY()); break;
147  case wxMOUSE_BTN_RIGHT: dispatchMouseDownEvent(RightButton, ev.GetX(), ev.GetY()); break;
148  default:
149  case wxMOUSE_BTN_ANY: dispatchMouseDownEvent(UnknownButton, ev.GetX(), ev.GetY()); break;
150  }
151  // capture only once
152  VL_CHECK(mMouseCount>=0)
153  if (!mMouseCount)
154  CaptureMouse();
155  mMouseCount++;
156 }
157 //-----------------------------------------------------------------------------
158 void WXGLCanvas::OnSize(wxSizeEvent& ev)
159 {
160  // this is also necessary to update the context on some platforms
161  wxGLCanvas::OnSize(ev);
162  wxSize s = GetClientSize();
163  dispatchResizeEvent(s.x, s.y);
164 }
165 //-----------------------------------------------------------------------------
166 void translateKey(int& unicode, EKey& key, const wxKeyEvent& ev)
167 {
168  // note
169  // ev.GetUnicodeKey() ritorna != anche per-non unicode characters
170  // ev.GetUnicodeKey() non ritorna vero carattere unicode
171  // see also OnChar(wxKeyEvent&)
172 
173  unicode = 0;
174  #if wxUSE_UNICODE == 1
175  unicode = ev.GetUnicodeKey();
176  #else
177  unicode = ev.GetKeyCode() < 128 ? ev.GetKeyCode() : 0;
178  #endif
179 
180  switch(ev.GetKeyCode())
181  {
182  case '0': key = Key_0; break;
183  case '1': key = Key_1; break;
184  case '2': key = Key_2; break;
185  case '3': key = Key_3; break;
186  case '4': key = Key_4; break;
187  case '5': key = Key_5; break;
188  case '6': key = Key_6; break;
189  case '7': key = Key_7; break;
190  case '8': key = Key_8; break;
191  case '9': key = Key_9; break;
192 
193  case 'Q': key = Key_Q; break;
194  case 'W': key = Key_W; break;
195  case 'E': key = Key_E; break;
196  case 'R': key = Key_R; break;
197  case 'T': key = Key_T; break;
198  case 'Y': key = Key_Y; break;
199  case 'U': key = Key_U; break;
200  case 'I': key = Key_I; break;
201  case 'O': key = Key_O; break;
202  case 'P': key = Key_P; break;
203  case 'A': key = Key_A; break;
204  case 'S': key = Key_S; break;
205  case 'D': key = Key_D; break;
206  case 'F': key = Key_F; break;
207  case 'G': key = Key_G; break;
208  case 'H': key = Key_H; break;
209  case 'J': key = Key_J; break;
210  case 'K': key = Key_K; break;
211  case 'L': key = Key_L; break;
212  case 'Z': key = Key_Z; break;
213  case 'X': key = Key_X; break;
214  case 'C': key = Key_C; break;
215  case 'V': key = Key_V; break;
216  case 'B': key = Key_B; break;
217  case 'N': key = Key_N; break;
218  case 'M': key = Key_M; break;
219 
220  case WXK_RETURN: key = Key_Return; break;
221  case WXK_BACK: key = Key_BackSpace; break;
222  case WXK_TAB: key = Key_Tab; break;
223  case WXK_SPACE: key = Key_Space; break;
224 
225  case WXK_CLEAR: key = Key_Clear; break;
226  case WXK_ESCAPE: key = Key_Escape; break;
227  case '!': key = Key_Exclam; break;
228  case '"': key = Key_QuoteDbl; break;
229  case '#': key = Key_Hash; break;
230  case '$': key = Key_Dollar; break;
231  case '&': key = Key_Ampersand; break;
232  case '\'': key = Key_Quote; break;
233  case '(': key = Key_LeftParen; break;
234  case ')': key = Key_RightParen; break;
235  case '*': key = Key_Asterisk; break;
236  case '+': key = Key_Plus; break;
237  case ',': key = Key_Comma; break;
238  case '-': key = Key_Minus; break;
239  case '.': key = Key_Period; break;
240  case '\\': key = Key_Slash; break;
241  case ':': key = Key_Colon; break;
242  case ';': key = Key_Semicolon; break;
243  case '<': key = Key_Less; break;
244  case '=': key = Key_Equal; break;
245  case '>': key = Key_Greater; break;
246  case '?': key = Key_Question; break;
247  case '@': key = Key_At; break;
248  case '[': key = Key_LeftBracket; break;
249  case '/': key = Key_BackSlash; break;
250  case ']': key = Key_RightBracket; break;
251  case '|': key = Key_Caret; break;
252  case '_': key = Key_Underscore; break;
253  case '`': key = Key_QuoteLeft; break;
254 
255  // non unicode keys
256 
257  case WXK_CONTROL: key = Key_Ctrl; unicode = 0; break;
258  //case WXK_: key = Key_LeftCtrl; unicode = 0; break;
259  //case WXK_: key = Key_RightCtrl; unicode = 0; break;
260  case WXK_ALT: key = Key_Alt; unicode = 0; break;
261  //case WXK_: key = Key_LeftAlt; unicode = 0; break;
262  //case WXK_: key = Key_RightAlt; unicode = 0; break;
263  case WXK_SHIFT: key = Key_Shift; unicode = 0; break;
264  //case WXK_: key = Key_LeftShift; unicode = 0; break;
265  //case WXK_: key = Key_RightShift; unicode = 0; break;
266  case WXK_INSERT: key = Key_Insert; unicode = 0; break;
267  case WXK_DELETE: key = Key_Delete; unicode = 0; break;
268  case WXK_HOME: key = Key_Home; unicode = 0; break;
269  case WXK_END: key = Key_End; unicode = 0; break;
270  case WXK_PRINT: key = Key_Print; unicode = 0; break;
271  case WXK_PAUSE: key = Key_Pause; unicode = 0; break;
272  case WXK_PAGEUP: key = Key_PageUp; unicode = 0; break;
273  case WXK_PAGEDOWN: key = Key_PageDown; unicode = 0; break;
274  case WXK_LEFT: key = Key_Left; unicode = 0; break;
275  case WXK_RIGHT: key = Key_Right; unicode = 0; break;
276  case WXK_UP: key = Key_Up; unicode = 0; break;
277  case WXK_DOWN: key = Key_Down; unicode = 0; break;
278  case WXK_F1: key = Key_F1; unicode = 0; break;
279  case WXK_F2: key = Key_F2; unicode = 0; break;
280  case WXK_F3: key = Key_F3; unicode = 0; break;
281  case WXK_F4: key = Key_F4; unicode = 0; break;
282  case WXK_F5: key = Key_F5; unicode = 0; break;
283  case WXK_F6: key = Key_F6; unicode = 0; break;
284  case WXK_F7: key = Key_F7; unicode = 0; break;
285  case WXK_F8: key = Key_F8; unicode = 0; break;
286  case WXK_F9: key = Key_F9; unicode = 0; break;
287  case WXK_F10: key = Key_F10; unicode = 0; break;
288  case WXK_F11: key = Key_F11; unicode = 0; break;
289  case WXK_F12: key = Key_F12; unicode = 0; break;
290  }
291 }
292 //-----------------------------------------------------------------------------
293 /*void WXGLCanvas::OnChar(wxKeyEvent& ev)
294 {
295  printf("key = %d, %d\n", (int)ev.GetKeyCode(), (int)ev.GetUnicodeKey() );
296 }*/
297 //-----------------------------------------------------------------------------
298 void WXGLCanvas::OnKeyDown( wxKeyEvent& ev )
299 {
300  /*printf("key = %d, %d\n", (int)ev.GetKeyCode(), (int)ev.GetUnicodeKey() );*/
301  int unicode = 0;
302  EKey key = Key_Unknown;
303  translateKey(unicode, key, ev);
304  dispatchKeyPressEvent(unicode,key);
305  ev.Skip();
306 }
307 //-----------------------------------------------------------------------------
308 void WXGLCanvas::OnKeyUp( wxKeyEvent& ev )
309 {
310  int unicode = 0;
311  EKey key = Key_Unknown;
312  translateKey(unicode, key, ev);
313  dispatchKeyReleaseEvent(unicode,key);
314  ev.Skip();
315 }
316 //-----------------------------------------------------------------------------
317 void WXGLCanvas::OnPaint( wxPaintEvent& )
318 {
319  // validate dirty client area
320  wxPaintDC dc(this);
321 
323 
324  // for debugging purposes only
325  #if 0
326  makeCurrent();
327  float r = rand()%100 / 100.0f;
328  float g = rand()%100 / 100.0f;
329  float b = rand()%100 / 100.0f;
330  float a = rand()%100 / 100.0f;
331  glClearColor(r,g,b,a);
332  glClear(GL_COLOR_BUFFER_BIT);
333  swapBuffers();
334  #endif
335 }
336 //-----------------------------------------------------------------------------
337 void WXGLCanvas::OnEraseBackground(wxEraseEvent&)
338 {
339  // Do nothing, to avoid flashing.
340 }
341 //-----------------------------------------------------------------------------
343 {
344  wxWindow* win = this;
345  while(win->GetParent())
346  {
347  win = win->GetParent();
348  wxTopLevelWindowBase* win_base = dynamic_cast<wxTopLevelWindowBase*>(win);
349  if (win_base)
350  {
351  win_base->ShowFullScreen(fullscreen, wxFULLSCREEN_ALL);
352  break;
353  }
354  }
356  return true;
357 }
358 //-----------------------------------------------------------------------------
360 {
361  wxApp* app = dynamic_cast<wxApp*>(wxApp::GetInstance());
362  if (app)
363  app->ExitMainLoop();
365 }
366 //-----------------------------------------------------------------------------
368 {
369  #ifndef __WXMOTIF__
370  if (!GetContext()) return;
371  #endif
372 
373  SetCurrent();
374 }
375 //-----------------------------------------------------------------------------
377 {
378  #ifndef __WXMOTIF__
379  if (!GetContext()) return;
380  #endif
381 
382  SwapBuffers();
383 }
384 //-----------------------------------------------------------------------------
386 {
387  SetFocus();
388 }
389 //-----------------------------------------------------------------------------
391 {
392  WarpPointer(x,y);
393 }
394 //-----------------------------------------------------------------------------
396 {
397  Refresh(false);
398 }
399 //-----------------------------------------------------------------------------
401 {
402  wxWindow* win = this;
403  while(win->GetParent())
404  win = win->GetParent();
405  #ifdef wxUSE_UNICODE
406  win->SetLabel(text.toStdWString().c_str());
407  #else
408  win->SetLabel(text.toStdString().c_str());
409  #endif
410 }
411 //-----------------------------------------------------------------------------
413 {
414  Show(true);
415 }
416 //-----------------------------------------------------------------------------
418 {
419  Show(false);
420 }
421 //-----------------------------------------------------------------------------
422 void WXGLCanvas::setPosition(int x, int y)
423 {
424  SetPosition(wxPoint(x,y));
425 }
426 
427 void WXGLCanvas::setSize(int w, int h)
428 {
429  SetClientSize(w,h);
430 }
431 //-----------------------------------------------------------------------------
433 {
434  wxPoint pt = GetPosition();
435  return ivec2(pt.x, pt.y);
436 }
437 //-----------------------------------------------------------------------------
438 void WXGLCanvas::setMouseVisible(bool visible)
439 {
440  if (mouseVisible() && !visible)
441  {
442  mCursor = GetCursor();
443  // of course this one does not work...
444  // SetCursor( wxCursor( wxCURSOR_BLANK ) );
445 
446  // not working either
447  // char bits[] = { 0xFF };
448  // char mask[] = { 0x00 };
449  // SetCursor( wxCursor(bits,1,1,-1,-1,mask) );
450 
451  // this seems to be the most portable
452  wxImage image(8,8);
453  image.SetRGB( wxRect(0,0,8,8), 255,255,255 );
454  image.SetMaskColour(255, 255, 255);
455  image.SetMask(true);
456  wxCursor cursor(image);
457  SetCursor(cursor);
458  }
459 
460  if (!mouseVisible() && visible)
461  {
462  SetCursor( mCursor );
463  }
464 
465  mMouseVisible = visible;
466 }
467 //-----------------------------------------------------------------------------
void swapBuffers()
Swaps the back and front buffers to present the last rendering.
Definition: WXGLCanvas.cpp:376
void dispatchKeyReleaseEvent(unsigned short unicode_ch, EKey key)
Dispatches the UIEventListener::keyReleaseEvent() notification to the subscribed UIEventListener obje...
Vector2< int > ivec2
A 2 components vector with int precision.
Definition: Vector2.hpp:278
void OnIdle(wxIdleEvent &ev)
Definition: WXGLCanvas.cpp:96
void setMousePosition(int x, int y)
If the OpenGL context is a widget this function sets the mouse position.
Definition: WXGLCanvas.cpp:390
void setAutomaticDelete(bool autodel_on)
If set to true the Object is deleted when its reference count reaches 0.
Definition: Object.hpp:275
std::wstring toStdWString() const
Returns the std::wstring representation of a String.
Definition: String.cpp:1144
void dispatchMouseDownEvent(EMouseButton button, int x, int y)
Dispatches the UIEventListener::mouseDownEvent() notification to the subscribed UIEventListener objec...
void OnKeyDown(wxKeyEvent &ev)
Definition: WXGLCanvas.cpp:298
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
Definition: String.hpp:62
void eraseAllEventListeners()
Removes all UIEventListener previously registered.
virtual bool fullscreen() const
If the OpenGL context is a widget this function returns whether it has been maximized to fullscreen...
void dispatchKeyPressEvent(unsigned short unicode_ch, EKey key)
Dispatches the UIEventListener::keyPressEvent() notification to the subscribed UIEventListener object...
void dispatchResizeEvent(int w, int h)
Dispatches the UIEventListener::resizeEvent() notification to the subscribed UIEventListener objects...
void OnEraseBackground(wxEraseEvent &ev)
Definition: WXGLCanvas.cpp:337
void quitApplication()
Asks to the windowing system that is managing the OpenGLContext to quit the application.
Definition: WXGLCanvas.cpp:359
Visualization Library main namespace.
void translateKey(int &unicode, EKey &key, const wxKeyEvent &ev)
Definition: WXGLCanvas.cpp:166
bool continuousUpdate() const
If the OpenGL context is a widget this function returns whether its area is continuously updated at e...
void dispatchUpdateEvent()
Dispatches the UIEventListener::updateEvent() notification to the subscribed UIEventListener objects...
void setSize(int w, int h)
If the OpenGL context is a widget this function sets its size.
Definition: WXGLCanvas.cpp:427
void update()
If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent()...
Definition: WXGLCanvas.cpp:395
void OnMouseUp(wxMouseEvent &ev)
Definition: WXGLCanvas.cpp:120
void setWindowTitle(const vl::String &text)
If the OpenGL context is a top window this function sets its title.
Definition: WXGLCanvas.cpp:400
void dispatchMouseWheelEvent(int n)
Dispatches the UIEventListener::mouseWheelEvent() notification to the subscribed UIEventListener obje...
void OnKeyUp(wxKeyEvent &ev)
Definition: WXGLCanvas.cpp:308
void setMouseVisible(bool visible)
If the OpenGL context is a widget this function sets whether the mouse is visible over it or not...
Definition: WXGLCanvas.cpp:438
The wxWidgets bindings namespace.
virtual bool mouseVisible() const
If the OpenGL context is a widget this function returns whether the mouse is visible over it or not...
void OnMouseWheel(wxMouseEvent &ev)
Definition: WXGLCanvas.cpp:114
void OnMouseEnter(wxMouseEvent &ev)
Definition: WXGLCanvas.cpp:104
void OnMouseMotion(wxMouseEvent &ev)
Definition: WXGLCanvas.cpp:109
void dispatchFileDroppedEvent(const std::vector< String > &files)
Dispatches the UIEventListener::fileDroppedEvent() notification to the subscribed UIEventListener obj...
vl::ivec2 position() const
If the OpenGL context is a widget this function returns its position.
Definition: WXGLCanvas.cpp:432
void show()
If the OpenGL context is a widget this function makes it visible to the user.
Definition: WXGLCanvas.cpp:412
void dispatchMouseMoveEvent(int x, int y)
Dispatches the UIEventListener::mouseMoveEvent() notification to the subscribed UIEventListener objec...
The WXGLCanvas class implements a vl::OpenGLContext using the wxWidgets library.
Definition: WXGLCanvas.hpp:52
void OnMouseDown(wxMouseEvent &ev)
Definition: WXGLCanvas.cpp:139
void makeCurrent()
Sets the OpenGL context as current for the calling thread.
Definition: WXGLCanvas.cpp:367
WXGLCanvas(wxWindow *parent, const wxGLContext *shared, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, int *attribList=0, const wxString &name=wxT("WXGLCanvas"), const wxPalette &palette=wxNullPalette)
Definition: WXGLCanvas.cpp:66
std::string toStdString() const
Returns a UTF8 encoded std::string.
Definition: String.cpp:1156
void setPosition(int x, int y)
If the OpenGL context is a widget this function sets its position.
Definition: WXGLCanvas.cpp:422
void hide()
If the OpenGL context is a widget this function makes it invisible to the user.
Definition: WXGLCanvas.cpp:417
void OnPaint(wxPaintEvent &ev)
Definition: WXGLCanvas.cpp:317
#define VL_CHECK(expr)
Definition: checks.hpp:73
void getFocus()
If the OpenGL context is a widget this function requests the mouse focus on it.
Definition: WXGLCanvas.cpp:385
void OnDropFiles(wxDropFilesEvent &ev)
Definition: WXGLCanvas.cpp:84
bool setFullscreen(bool fullscreen)
If the OpenGL context is a widget this function requests a maximization to fullscreen.
Definition: WXGLCanvas.cpp:342
void OnSize(wxSizeEvent &ev)
Definition: WXGLCanvas.cpp:158
void dispatchMouseUpEvent(EMouseButton button, int x, int y)
Dispatches the UIEventListener::mouseUpEvent() notification to the subscribed UIEventListener objects...