]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/gtk1/glcanvas.h
use the native wxImageList under Win32 as otherwise xUniv doesn't link currently
[wxWidgets.git] / include / wx / gtk1 / glcanvas.h
index 813e3147381437dd4e828f50c77d906760edbe6f..f78a8d8f10787b45832858cf08ba2a9dfa6b55d7 100644 (file)
 #ifndef _WX_GLCANVAS_H_
 #define _WX_GLCANVAS_H_
 
-#include <wx/defs.h>
-
-#if wxUSE_GLCANVAS
-
-#include <wx/scrolwin.h>
+#include "wx/scrolwin.h"
+#include "wx/app.h"
 
 extern "C" {
-#include "GL/gl.h"
-#include "GL/glx.h"
-#include "GL/glu.h"
+#include <GL/gl.h>
+#include <GL/glx.h>
+#include <GL/glu.h>
 }
 
 //---------------------------------------------------------------------------
@@ -100,10 +97,10 @@ private:
 };
 
 //---------------------------------------------------------------------------
-// wxGLContext
+// wxGLCanvas
 //---------------------------------------------------------------------------
 
-class WXDLLEXPORT wxGLCanvas: public wxScrolledWindow
+class WXDLLEXPORT wxGLCanvas: public wxWindow
 {
 public:
    inline wxGLCanvas() {
@@ -161,18 +158,22 @@ public:
     wxGLContext      *m_glContext,
                      *m_sharedContext;
     wxGLCanvas       *m_sharedContextOf;
-    void             *m_vi;
+    void             *m_vi; // actually an XVisualInfo*
+    bool              m_canFreeVi;
     GtkWidget        *m_glWidget;
     bool              m_exposed;
+    
+    // returns an XVisualInfo* based on desired GL attributes;
+    // returns NULL if an appropriate visual is not found. The
+    // caller is reponsible for using XFree() to deallocate 
+    // the returned structure.
+    static void* ChooseGLVisual(int *attribList);
 
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_CLASS(wxGLCanvas)
 };
 
-#endif
-    // wxUSE_GLCANVAS
-
 #endif
     // _WX_GLCANVAS_H_