From: Vadim Zeitlin Date: Wed, 10 Nov 2010 13:52:04 +0000 (+0000) Subject: Fix wxGLCanvas compilation with wxUSE_PALETTE==0. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9ce5cf09c2a6236eca9c73bdded05286dd5ab12a?ds=sidebyside Fix wxGLCanvas compilation with wxUSE_PALETTE==0. This fixes compilation problems with the minimal build of wxGTK and will make removing palette support in the future simpler. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66088 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/glcanvas.h b/include/wx/glcanvas.h index 03db44017e..b3d3c5d43e 100644 --- a/include/wx/glcanvas.h +++ b/include/wx/glcanvas.h @@ -113,7 +113,9 @@ public: // check if the given attributes are supported without creating a canvas static bool IsDisplaySupported(const int *attribList); +#if wxUSE_PALETTE const wxPalette *GetPalette() const { return &m_palette; } +#endif // wxUSE_PALETTE // miscellaneous helper functions // ------------------------------ @@ -149,16 +151,18 @@ protected: // (currently only implemented in wxX11 and wxMotif ports) virtual int GetColourIndex(const wxColour& WXUNUSED(col)) { return -1; } - // create default palette if we're not using RGBA mode - // (not supported in most ports) - virtual wxPalette CreateDefaultPalette() { return wxNullPalette; } - // check if the given extension name is present in the space-separated list // of extensions supported by the current implementation such as returned // by glXQueryExtensionsString() or glGetString(GL_EXTENSIONS) static bool IsExtensionInList(const char *list, const char *extension); +#if wxUSE_PALETTE + // create default palette if we're not using RGBA mode + // (not supported in most ports) + virtual wxPalette CreateDefaultPalette() { return wxNullPalette; } + wxPalette m_palette; +#endif // wxUSE_PALETTE #if WXWIN_COMPATIBILITY_2_8 wxGLContext *m_glContext; diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index 89ffe1ba9f..1d6963ddd6 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -203,9 +203,12 @@ bool wxGLCanvas::Create(wxWindow *parent, long style, const wxString& name, const int *attribList, - const wxPalette& WXUNUSED_UNLESS_DEBUG(palette)) + const wxPalette& palette) { +#if wxUSE_PALETTE wxASSERT_MSG( !palette.IsOk(), wxT("palettes not supported") ); +#endif // wxUSE_PALETTE + wxUnusedVar(palette); // Unused when wxDEBUG_LEVEL==0 m_exposed = false; m_noExpose = true;