glcanvas.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/glcanvas.h
  3. // Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWidgets and GTK
  4. // Author: Robert Roebling
  5. // Modified by:
  6. // Created: 17/8/98
  7. // Copyright: (c) Robert Roebling
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_GLCANVAS_H_
  11. #define _WX_GLCANVAS_H_
  12. #include "wx/unix/glx11.h"
  13. //---------------------------------------------------------------------------
  14. // wxGLCanvas
  15. //---------------------------------------------------------------------------
  16. class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasX11
  17. {
  18. public:
  19. wxGLCanvas(wxWindow *parent,
  20. wxWindowID id = wxID_ANY,
  21. const int *attribList = NULL,
  22. const wxPoint& pos = wxDefaultPosition,
  23. const wxSize& size = wxDefaultSize,
  24. long style = 0,
  25. const wxString& name = wxGLCanvasName,
  26. const wxPalette& palette = wxNullPalette);
  27. bool Create(wxWindow *parent,
  28. wxWindowID id = wxID_ANY,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = 0,
  32. const wxString& name = wxGLCanvasName,
  33. const int *attribList = NULL,
  34. const wxPalette& palette = wxNullPalette);
  35. virtual bool SetBackgroundStyle(wxBackgroundStyle style);
  36. // implement wxGLCanvasX11 methods
  37. // --------------------------------
  38. virtual Window GetXWindow() const;
  39. // deprecated methods
  40. // ------------------
  41. #if WXWIN_COMPATIBILITY_2_8
  42. wxDEPRECATED(
  43. wxGLCanvas(wxWindow *parent,
  44. wxWindowID id = wxID_ANY,
  45. const wxPoint& pos = wxDefaultPosition,
  46. const wxSize& size = wxDefaultSize,
  47. long style = 0,
  48. const wxString& name = wxGLCanvasName,
  49. const int *attribList = NULL,
  50. const wxPalette& palette = wxNullPalette)
  51. );
  52. wxDEPRECATED(
  53. wxGLCanvas(wxWindow *parent,
  54. const wxGLContext *shared,
  55. wxWindowID id = wxID_ANY,
  56. const wxPoint& pos = wxDefaultPosition,
  57. const wxSize& size = wxDefaultSize,
  58. long style = 0,
  59. const wxString& name = wxGLCanvasName,
  60. const int *attribList = NULL,
  61. const wxPalette& palette = wxNullPalette)
  62. );
  63. wxDEPRECATED(
  64. wxGLCanvas(wxWindow *parent,
  65. const wxGLCanvas *shared,
  66. wxWindowID id = wxID_ANY,
  67. const wxPoint& pos = wxDefaultPosition,
  68. const wxSize& size = wxDefaultSize,
  69. long style = 0,
  70. const wxString& name = wxGLCanvasName,
  71. const int *attribList = NULL,
  72. const wxPalette& palette = wxNullPalette)
  73. );
  74. // called from "realized" callback to create the implicit context if needed
  75. void GTKInitImplicitContext();
  76. #endif // WXWIN_COMPATIBILITY_2_8
  77. // implementation from now on
  78. void OnInternalIdle();
  79. bool m_exposed;
  80. #ifdef __WXGTK3__
  81. cairo_t* m_cairoPaintContext;
  82. #endif
  83. #if WXWIN_COMPATIBILITY_2_8
  84. wxGLContext *m_sharedContext;
  85. wxGLCanvas *m_sharedContextOf;
  86. const bool m_createImplicitContext;
  87. #endif // WXWIN_COMPATIBILITY_2_8
  88. private:
  89. DECLARE_CLASS(wxGLCanvas)
  90. };
  91. #endif // _WX_GLCANVAS_H_