moved wxapp_install_idle_handler and g_isIdle from many cpp files into gtk/private...
[wxWidgets.git] / src / gtk / glcanvas.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/glcanvas.cpp
3 // Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWidgets and GTK
4 // Author: Robert Roebling
5 // Modified by:
6 // Created: 17/08/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
14
15 #if wxUSE_GLCANVAS
16
17 #include "wx/glcanvas.h"
18
19 #include "wx/frame.h"
20 #include "wx/colour.h"
21 #include "wx/module.h"
22 #include "wx/app.h"
23
24 extern "C"
25 {
26 #include "gtk/gtk.h"
27 #include "gdk/gdk.h"
28 #include "gdk/gdkx.h"
29 }
30
31 #include "wx/gtk/win_gtk.h"
32
33 // DLL options compatibility check:
34 #include "wx/build.h"
35 WX_CHECK_BUILD_OPTIONS("wxGL")
36
37
38 //---------------------------------------------------------------------------
39 // static variables
40 //---------------------------------------------------------------------------
41 int wxGLCanvas::m_glxVersion = 0;
42
43 //---------------------------------------------------------------------------
44 // global data
45 //---------------------------------------------------------------------------
46
47 XVisualInfo *g_vi = (XVisualInfo*) NULL;
48
49 //---------------------------------------------------------------------------
50 // wxGLContext
51 //---------------------------------------------------------------------------
52
53 IMPLEMENT_CLASS(wxGLContext,wxObject)
54
55 wxGLContext::wxGLContext( bool WXUNUSED(isRGB), wxWindow *win, const wxPalette& WXUNUSED(palette) )
56 {
57 m_window = win;
58 m_widget = win->m_wxwindow;
59
60 wxGLCanvas *gc = (wxGLCanvas*) win;
61
62 if (wxGLCanvas::GetGLXVersion() >= 13)
63 {
64 // GLX >= 1.3
65 GLXFBConfig *fbc = gc->m_fbc;
66 wxCHECK_RET( fbc, _T("invalid GLXFBConfig for OpenGl") );
67 m_glContext = glXCreateNewContext( GDK_DISPLAY(), fbc[0], GLX_RGBA_TYPE, None, GL_TRUE );
68 }
69 else
70 {
71 // GLX <= 1.2
72 XVisualInfo *vi = (XVisualInfo *) gc->m_vi;
73 wxCHECK_RET( vi, _T("invalid visual for OpenGl") );
74 m_glContext = glXCreateContext( GDK_DISPLAY(), vi, None, GL_TRUE );
75 }
76
77 wxCHECK_RET( m_glContext, _T("Couldn't create OpenGl context") );
78 }
79
80 wxGLContext::wxGLContext(
81 bool WXUNUSED(isRGB), wxWindow *win,
82 const wxPalette& WXUNUSED(palette),
83 const wxGLContext *other /* for sharing display lists */
84 )
85 {
86 m_window = win;
87 m_widget = win->m_wxwindow;
88
89 wxGLCanvas *gc = (wxGLCanvas*) win;
90
91 if (wxGLCanvas::GetGLXVersion() >= 13)
92 {
93 // GLX >= 1.3
94 GLXFBConfig *fbc = gc->m_fbc;
95 wxCHECK_RET( fbc, _T("invalid GLXFBConfig for OpenGl") );
96 m_glContext = glXCreateNewContext( GDK_DISPLAY(), fbc[0], GLX_RGBA_TYPE,
97 other ? other->m_glContext : None,
98 GL_TRUE );
99 }
100 else
101 {
102 // GLX <= 1.2
103 XVisualInfo *vi = (XVisualInfo *) gc->m_vi;
104 wxCHECK_RET( vi, _T("invalid visual for OpenGl") );
105 m_glContext = glXCreateContext( GDK_DISPLAY(), vi,
106 other ? other->m_glContext : None,
107 GL_TRUE );
108 }
109
110 if ( !m_glContext )
111 {
112 wxFAIL_MSG( _T("Couldn't create OpenGl context") );
113 }
114 }
115
116 wxGLContext::~wxGLContext()
117 {
118 if (!m_glContext) return;
119
120 if (m_glContext == glXGetCurrentContext())
121 {
122 if (wxGLCanvas::GetGLXVersion() >= 13)
123 // GLX >= 1.3
124 glXMakeContextCurrent( GDK_DISPLAY(), None, None, NULL);
125 else
126 // GLX <= 1.2
127 glXMakeCurrent( GDK_DISPLAY(), None, NULL);
128 }
129
130 glXDestroyContext( GDK_DISPLAY(), m_glContext );
131 }
132
133 void wxGLContext::SwapBuffers()
134 {
135 if (m_glContext)
136 {
137 GdkWindow *window = GTK_PIZZA(m_widget)->bin_window;
138 glXSwapBuffers( GDK_DISPLAY(), GDK_WINDOW_XWINDOW( window ) );
139 }
140 }
141
142 void wxGLContext::SetCurrent()
143 {
144 if (m_glContext)
145 {
146 GdkWindow *window = GTK_PIZZA(m_widget)->bin_window;
147
148 if (wxGLCanvas::GetGLXVersion() >= 13)
149 // GLX >= 1.3
150 glXMakeContextCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window),
151 GDK_WINDOW_XWINDOW(window), m_glContext );
152 else
153 // GLX <= 1.2
154 glXMakeCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window), m_glContext );
155 }
156 }
157
158 void wxGLContext::SetColour(const wxChar *colour)
159 {
160 wxColour col = wxTheColourDatabase->Find(colour);
161 if (col.Ok())
162 {
163 float r = (float)(col.Red()/256.0);
164 float g = (float)(col.Green()/256.0);
165 float b = (float)(col.Blue()/256.0);
166 glColor3f( r, g, b);
167 }
168 }
169
170 void wxGLContext::SetupPixelFormat()
171 {
172 }
173
174 void wxGLContext::SetupPalette( const wxPalette& WXUNUSED(palette) )
175 {
176 }
177
178 wxPalette wxGLContext::CreateDefaultPalette()
179 {
180 return wxNullPalette;
181 }
182
183 //-----------------------------------------------------------------------------
184 // "realize" from m_wxwindow
185 //-----------------------------------------------------------------------------
186
187 extern "C" {
188 static gint
189 gtk_glwindow_realized_callback( GtkWidget *WXUNUSED(widget), wxGLCanvas *win )
190 {
191 if ( !win->m_glContext )
192 {
193 wxGLContext *share = win->m_sharedContext;
194 if ( !share && win->m_sharedContextOf )
195 share = win->m_sharedContextOf->GetContext();
196
197 win->m_glContext = new wxGLContext( TRUE, win, wxNullPalette, share );
198 }
199
200 return FALSE;
201 }
202 }
203
204 //-----------------------------------------------------------------------------
205 // "map" from m_wxwindow
206 //-----------------------------------------------------------------------------
207
208 extern "C" {
209 static gint
210 gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
211 {
212 if (win->m_glContext/* && win->m_exposed*/)
213 {
214 wxPaintEvent event( win->GetId() );
215 event.SetEventObject( win );
216 win->GetEventHandler()->ProcessEvent( event );
217
218 win->m_exposed = FALSE;
219 win->GetUpdateRegion().Clear();
220 }
221
222 return FALSE;
223 }
224 }
225
226 //-----------------------------------------------------------------------------
227 // "expose_event" of m_wxwindow
228 //-----------------------------------------------------------------------------
229
230 extern "C" {
231 static void
232 gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win )
233 {
234 if (g_isIdle)
235 wxapp_install_idle_handler();
236
237 win->m_exposed = TRUE;
238
239 win->GetUpdateRegion().Union( gdk_event->area.x,
240 gdk_event->area.y,
241 gdk_event->area.width,
242 gdk_event->area.height );
243 }
244 }
245
246 //-----------------------------------------------------------------------------
247 // "size_allocate" of m_wxwindow
248 //-----------------------------------------------------------------------------
249
250 extern "C" {
251 static void
252 gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxGLCanvas *win )
253 {
254 if (g_isIdle)
255 wxapp_install_idle_handler();
256
257 if (!win->m_hasVMT)
258 return;
259
260 wxSizeEvent event( wxSize(win->m_width,win->m_height), win->GetId() );
261 event.SetEventObject( win );
262 win->GetEventHandler()->ProcessEvent( event );
263 }
264 }
265
266 //---------------------------------------------------------------------------
267 // wxGlCanvas
268 //---------------------------------------------------------------------------
269
270 IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
271
272 BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
273 EVT_SIZE(wxGLCanvas::OnSize)
274 END_EVENT_TABLE()
275
276 wxGLCanvas::wxGLCanvas( wxWindow *parent, wxWindowID id,
277 const wxPoint& pos, const wxSize& size,
278 long style, const wxString& name,
279 int *attribList,
280 const wxPalette& palette )
281 {
282 Create( parent, NULL, NULL, id, pos, size, style, name, attribList, palette );
283 }
284
285 wxGLCanvas::wxGLCanvas( wxWindow *parent,
286 const wxGLContext *shared,
287 wxWindowID id,
288 const wxPoint& pos, const wxSize& size,
289 long style, const wxString& name,
290 int *attribList,
291 const wxPalette& palette )
292 {
293 Create( parent, shared, NULL, id, pos, size, style, name, attribList, palette );
294 }
295
296 wxGLCanvas::wxGLCanvas( wxWindow *parent,
297 const wxGLCanvas *shared,
298 wxWindowID id,
299 const wxPoint& pos, const wxSize& size,
300 long style, const wxString& name,
301 int *attribList,
302 const wxPalette& palette )
303 {
304 Create( parent, NULL, shared, id, pos, size, style, name, attribList, palette );
305 }
306
307 bool wxGLCanvas::Create( wxWindow *parent,
308 const wxGLContext *shared,
309 const wxGLCanvas *shared_context_of,
310 wxWindowID id,
311 const wxPoint& pos, const wxSize& size,
312 long style, const wxString& name,
313 int *attribList,
314 const wxPalette& palette)
315 {
316 m_sharedContext = (wxGLContext*)shared; // const_cast
317 m_sharedContextOf = (wxGLCanvas*)shared_context_of; // const_cast
318 m_glContext = (wxGLContext*) NULL;
319
320 m_exposed = FALSE;
321 m_noExpose = TRUE;
322 m_nativeSizeEvent = TRUE;
323 m_fbc = NULL;
324 m_vi = NULL;
325
326 // to be sure the glx version is known
327 wxGLCanvas::QueryGLXVersion();
328
329 if (wxGLCanvas::GetGLXVersion() >= 13)
330 {
331 // GLX >= 1.3 uses a GLXFBConfig
332 GLXFBConfig * fbc = NULL;
333 if (wxTheApp->m_glFBCInfo != NULL)
334 {
335 fbc = (GLXFBConfig *) wxTheApp->m_glFBCInfo;
336 m_canFreeFBC = FALSE; // owned by wxTheApp - don't free upon destruction
337 }
338 else
339 {
340 fbc = (GLXFBConfig *) wxGLCanvas::ChooseGLFBC(attribList);
341 m_canFreeFBC = TRUE;
342 }
343 m_fbc = fbc; // save for later use
344 wxCHECK_MSG( m_fbc, FALSE, _T("required FBConfig couldn't be found") );
345 }
346
347 XVisualInfo *vi = NULL;
348 if (wxTheApp->m_glVisualInfo != NULL)
349 {
350 vi = (XVisualInfo *)wxTheApp->m_glVisualInfo;
351 m_canFreeVi = FALSE; // owned by wxTheApp - don't free upon destruction
352 }
353 else
354 {
355 if (wxGLCanvas::GetGLXVersion() >= 13)
356 // GLX >= 1.3
357 vi = glXGetVisualFromFBConfig(GDK_DISPLAY(), m_fbc[0]);
358 else
359 // GLX <= 1.2
360 vi = (XVisualInfo *) ChooseGLVisual(attribList);
361
362 m_canFreeVi = TRUE;
363 }
364
365 m_vi = vi; // save for later use
366
367 wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") );
368 GdkVisual *visual;
369 GdkColormap *colormap;
370
371 // MR: This needs a fix for lower gtk+ versions too. Might need to rethink logic (FIXME)
372 #if defined(__WXGTK20__) && GTK_CHECK_VERSION(2,2,0)
373 if (!gtk_check_version(2,2,0))
374 {
375 wxWindow::Create( parent, id, pos, size, style, name );
376
377 m_glWidget = m_wxwindow;
378
379 GdkScreen *screen = gtk_widget_get_screen( m_glWidget );
380 colormap = gdk_screen_get_default_colormap(screen);
381 visual = gdk_colormap_get_visual(colormap);
382
383 if (GDK_VISUAL_XVISUAL(visual)->visualid != vi->visualid)
384 {
385 visual = gdk_x11_screen_lookup_visual( screen, vi->visualid );
386 colormap = gdk_colormap_new(visual, FALSE);
387 }
388
389 gtk_widget_set_colormap( m_glWidget, colormap );
390 }
391 else
392 #endif
393 {
394 visual = gdkx_visual_get( vi->visualid );
395 colormap = gdk_colormap_new( visual, TRUE );
396
397 gtk_widget_push_colormap( colormap );
398
399 wxWindow::Create( parent, id, pos, size, style, name );
400 m_glWidget = m_wxwindow;
401 }
402
403 gtk_widget_set_double_buffered( m_glWidget, FALSE );
404
405 gtk_pizza_set_clear( GTK_PIZZA(m_wxwindow), FALSE );
406
407 g_signal_connect (m_wxwindow, "realize",
408 G_CALLBACK (gtk_glwindow_realized_callback),
409 this);
410 g_signal_connect (m_wxwindow, "map",
411 G_CALLBACK (gtk_glwindow_map_callback),
412 this);
413 g_signal_connect (m_wxwindow, "expose_event",
414 G_CALLBACK (gtk_glwindow_expose_callback),
415 this);
416 g_signal_connect (m_widget, "size_allocate",
417 G_CALLBACK (gtk_glcanvas_size_callback),
418 this);
419
420 if (gtk_check_version(2,2,0) != NULL)
421 {
422 gtk_widget_pop_colormap();
423 }
424
425 // if our parent window is already visible, we had been realized before we
426 // connected to the "realize" signal and hence our m_glContext hasn't been
427 // initialized yet and we have to do it now
428 if (GTK_WIDGET_REALIZED(m_wxwindow))
429 gtk_glwindow_realized_callback( m_wxwindow, this );
430
431 if (GTK_WIDGET_MAPPED(m_wxwindow))
432 gtk_glwindow_map_callback( m_wxwindow, this );
433
434 return TRUE;
435 }
436
437 wxGLCanvas::~wxGLCanvas()
438 {
439 GLXFBConfig * fbc = (GLXFBConfig *) m_fbc;
440 if (fbc && m_canFreeFBC)
441 XFree( fbc );
442
443 XVisualInfo *vi = (XVisualInfo *) m_vi;
444 if (vi && m_canFreeVi)
445 XFree( vi );
446
447 delete m_glContext;
448 }
449
450 void* wxGLCanvas::ChooseGLVisual(int *attribList)
451 {
452 int data[512];
453 GetGLAttribListFromWX( attribList, data );
454 attribList = (int*) data;
455
456 Display *dpy = GDK_DISPLAY();
457
458 return glXChooseVisual( dpy, DefaultScreen(dpy), attribList );
459 }
460
461 void* wxGLCanvas::ChooseGLFBC(int *attribList)
462 {
463 int data[512];
464 GetGLAttribListFromWX( attribList, data );
465 attribList = (int*) data;
466
467 int returned;
468 return glXChooseFBConfig( GDK_DISPLAY(), DefaultScreen(GDK_DISPLAY()),
469 attribList, &returned );
470 }
471
472
473 void wxGLCanvas::GetGLAttribListFromWX(int *wx_attribList, int *gl_attribList )
474 {
475 if (!wx_attribList)
476 {
477 if (wxGLCanvas::GetGLXVersion() >= 13)
478 // leave GLX >= 1.3 choose the default attributes
479 gl_attribList[0] = 0;
480 else
481 {
482 int i = 0;
483 // default settings if attriblist = 0
484 gl_attribList[i++] = GLX_RGBA;
485 gl_attribList[i++] = GLX_DOUBLEBUFFER;
486 gl_attribList[i++] = GLX_DEPTH_SIZE; gl_attribList[i++] = 1;
487 gl_attribList[i++] = GLX_RED_SIZE; gl_attribList[i++] = 1;
488 gl_attribList[i++] = GLX_GREEN_SIZE; gl_attribList[i++] = 1;
489 gl_attribList[i++] = GLX_BLUE_SIZE; gl_attribList[i++] = 1;
490 gl_attribList[i++] = GLX_ALPHA_SIZE; gl_attribList[i++] = 0;
491 gl_attribList[i++] = None;
492 }
493 }
494 else
495 {
496 int arg=0, p=0;
497 while( (wx_attribList[arg]!=0) && (p<510) )
498 {
499 switch( wx_attribList[arg++] )
500 {
501 case WX_GL_RGBA:
502 if (wxGLCanvas::GetGLXVersion() <= 12)
503 // for GLX >= 1.3, GLX_RGBA is useless (setting this flags will crash on most opengl implm)
504 gl_attribList[p++] = GLX_RGBA;
505 break;
506 case WX_GL_BUFFER_SIZE:
507 gl_attribList[p++] = GLX_BUFFER_SIZE;
508 gl_attribList[p++] = wx_attribList[arg++];
509 break;
510 case WX_GL_LEVEL:
511 gl_attribList[p++] = GLX_LEVEL;
512 gl_attribList[p++] = wx_attribList[arg++];
513 break;
514 case WX_GL_DOUBLEBUFFER:
515 if (wxGLCanvas::GetGLXVersion() <= 12)
516 gl_attribList[p++] = GLX_DOUBLEBUFFER;
517 else
518 // for GLX >= 1.3, GLX_DOUBLEBUFFER format is different (1 <=> True)
519 // it seems this flag is useless for some hardware opengl implementation.
520 // but for Mesa 6.2.1, this flag is used so don't ignore it.
521 gl_attribList[p++] = GLX_DOUBLEBUFFER;
522 gl_attribList[p++] = 1;
523 break;
524 case WX_GL_STEREO:
525 gl_attribList[p++] = GLX_STEREO;
526 break;
527 case WX_GL_AUX_BUFFERS:
528 gl_attribList[p++] = GLX_AUX_BUFFERS;
529 gl_attribList[p++] = wx_attribList[arg++];
530 break;
531 case WX_GL_MIN_RED:
532 gl_attribList[p++] = GLX_RED_SIZE;
533 gl_attribList[p++] = wx_attribList[arg++];
534 break;
535 case WX_GL_MIN_GREEN:
536 gl_attribList[p++] = GLX_GREEN_SIZE;
537 gl_attribList[p++] = wx_attribList[arg++];
538 break;
539 case WX_GL_MIN_BLUE:
540 gl_attribList[p++] = GLX_BLUE_SIZE;
541 gl_attribList[p++] = wx_attribList[arg++];
542 break;
543 case WX_GL_MIN_ALPHA:
544 gl_attribList[p++] = GLX_ALPHA_SIZE;
545 gl_attribList[p++] = wx_attribList[arg++];
546 break;
547 case WX_GL_DEPTH_SIZE:
548 gl_attribList[p++] = GLX_DEPTH_SIZE;
549 gl_attribList[p++] = wx_attribList[arg++];
550 break;
551 case WX_GL_STENCIL_SIZE:
552 gl_attribList[p++] = GLX_STENCIL_SIZE;
553 gl_attribList[p++] = wx_attribList[arg++];
554 break;
555 case WX_GL_MIN_ACCUM_RED:
556 gl_attribList[p++] = GLX_ACCUM_RED_SIZE;
557 gl_attribList[p++] = wx_attribList[arg++];
558 break;
559 case WX_GL_MIN_ACCUM_GREEN:
560 gl_attribList[p++] = GLX_ACCUM_GREEN_SIZE;
561 gl_attribList[p++] = wx_attribList[arg++];
562 break;
563 case WX_GL_MIN_ACCUM_BLUE:
564 gl_attribList[p++] = GLX_ACCUM_BLUE_SIZE;
565 gl_attribList[p++] = wx_attribList[arg++];
566 break;
567 case WX_GL_MIN_ACCUM_ALPHA:
568 gl_attribList[p++] = GLX_ACCUM_ALPHA_SIZE;
569 gl_attribList[p++] = wx_attribList[arg++];
570 break;
571 default:
572 break;
573 }
574 }
575
576 gl_attribList[p] = 0;
577 }
578 }
579
580 void wxGLCanvas::QueryGLXVersion()
581 {
582 if (m_glxVersion == 0)
583 {
584 // check the GLX version
585 int glxMajorVer, glxMinorVer;
586 bool ok = glXQueryVersion(GDK_DISPLAY(), &glxMajorVer, &glxMinorVer);
587 wxASSERT_MSG( ok, _T("GLX version not found") );
588 if (!ok)
589 m_glxVersion = 10; // 1.0 by default
590 else
591 m_glxVersion = glxMajorVer*10 + glxMinorVer;
592 }
593 }
594
595 int wxGLCanvas::GetGLXVersion()
596 {
597 wxASSERT_MSG( m_glxVersion>0, _T("GLX version has not been initialized with wxGLCanvas::QueryGLXVersion()") );
598 return m_glxVersion;
599 }
600
601
602 void wxGLCanvas::SwapBuffers()
603 {
604 if (m_glContext)
605 m_glContext->SwapBuffers();
606 }
607
608 void wxGLCanvas::OnSize(wxSizeEvent& WXUNUSED(event))
609 {
610 }
611
612 void wxGLCanvas::SetCurrent()
613 {
614 if (m_glContext)
615 m_glContext->SetCurrent();
616 }
617
618 void wxGLCanvas::SetColour( const wxChar *colour )
619 {
620 if (m_glContext)
621 m_glContext->SetColour( colour );
622 }
623
624 void wxGLCanvas::OnInternalIdle()
625 {
626 if (m_glContext && m_exposed)
627 {
628 wxPaintEvent event( GetId() );
629 event.SetEventObject( this );
630 GetEventHandler()->ProcessEvent( event );
631
632 m_exposed = FALSE;
633 GetUpdateRegion().Clear();
634 }
635
636 wxWindow::OnInternalIdle();
637 }
638
639
640
641 //---------------------------------------------------------------------------
642 // wxGLApp
643 //---------------------------------------------------------------------------
644
645 IMPLEMENT_CLASS(wxGLApp, wxApp)
646
647 wxGLApp::~wxGLApp()
648 {
649 if (m_glFBCInfo)
650 XFree(m_glFBCInfo);
651 if (m_glVisualInfo)
652 XFree(m_glVisualInfo);
653 }
654
655 bool wxGLApp::InitGLVisual(int *attribList)
656 {
657 wxGLCanvas::QueryGLXVersion();
658
659 if (wxGLCanvas::GetGLXVersion() >= 13)
660 {
661 // GLX >= 1.3
662 if (m_glFBCInfo)
663 XFree(m_glFBCInfo);
664 m_glFBCInfo = wxGLCanvas::ChooseGLFBC(attribList);
665
666 if (m_glFBCInfo)
667 {
668 if (m_glVisualInfo)
669 XFree(m_glVisualInfo);
670 m_glVisualInfo = glXGetVisualFromFBConfig(GDK_DISPLAY(), ((GLXFBConfig *)m_glFBCInfo)[0]);
671 }
672 return (m_glFBCInfo != NULL) && (m_glVisualInfo != NULL);
673 }
674 else
675 {
676 // GLX <= 1.2
677 if (m_glVisualInfo)
678 XFree(m_glVisualInfo);
679 m_glVisualInfo = wxGLCanvas::ChooseGLVisual(attribList);
680 return m_glVisualInfo != NULL;
681 }
682 }
683
684 #endif
685 // wxUSE_GLCANVAS