]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/glcanvas/msw/myglcanvas.h
fixed wxBase and GUI separation for sockets code
[wxWidgets.git] / wxPython / contrib / glcanvas / msw / myglcanvas.h
index 2ec721c66b6c05bc4d8be22009bb238ee11ca9ad..2fe7404e2a9e868df56204226be31f8d6a18922f 100644 (file)
 #define _WX_GLCANVAS_H_
 
 #include <wx/setup.h>
-
-
+#undef wxUSE_GLCANVAS
 #define wxUSE_GLCANVAS 1
-#if wxUSE_GLCANVAS
 
 #include <wx/palette.h>
 #include <wx/scrolwin.h>
 
 #include <windows.h>
+#include "wx/msw/winundef.h"
 
-#include "gl/gl.h"
+#include <GL/gl.h>
 
 //---------------------------------------------------------------------------
 // Constants for attriblist
@@ -71,7 +70,7 @@ public:
    ~wxGLContext();
 
    void SetCurrent();
-   void SetColour(const char *colour);
+   void SetColour(const wxChar *colour);
    void SwapBuffers();
 
 
@@ -85,21 +84,26 @@ public:
    wxWindow*        m_window;
 };
 
-class wxGLCanvas: public wxScrolledWindow
+
+extern const wxChar* wxGLCanvasName;
+
+
+class wxGLCanvas: public wxWindow
 {
    DECLARE_CLASS(wxGLCanvas)
  public:
    wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
         const wxSize& size = wxDefaultSize, long style = 0,
-        const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette);
+        const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette);
    wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
         wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
-        const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "GLCanvas",
+        const wxSize& size = wxDefaultSize, long style = 0, const wxString&
+        name = wxGLCanvasName,
         int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette );
 
    wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1,
         const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0,
-        const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette );
+        const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette );
 
    ~wxGLCanvas();
 
@@ -108,7 +112,7 @@ class wxGLCanvas: public wxScrolledWindow
           const wxPoint& pos, const wxSize& size, long style, const wxString& name);
 
    void SetCurrent();
-   void SetColour(const char *colour);
+   void SetColour(const wxChar *colour);
    void SwapBuffers();
 
    void OnSize(wxSizeEvent& event);
@@ -130,11 +134,29 @@ protected:
     wxPalette      m_palette;
     WXHDC          m_hDC;
 
-DECLARE_EVENT_TABLE()
+    DECLARE_EVENT_TABLE()
 };
 
-#endif
-    // wxUSE_GLCANVAS
+
+
+class wxGLApp : public wxApp
+{
+public:
+    wxGLApp() : wxApp() { }
+    virtual ~wxGLApp();
+
+    // use this in the constructor of the user-derived wxGLApp class to
+    // determine if an OpenGL rendering context with these attributes
+    // is available - returns TRUE if so, FALSE if not.
+    bool InitGLVisual(int *attribList);
+
+private:
+    DECLARE_DYNAMIC_CLASS(wxGLApp)
+};
+
+
+
+
 #endif
     // _WX_GLCANVAS_H_