glcanvas.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/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. // implement wxGLCanvasX11 methods
  36. // -------------------------------
  37. virtual Window GetXWindow() const;
  38. // deprecated methods
  39. // ------------------
  40. #if WXWIN_COMPATIBILITY_2_8
  41. wxDEPRECATED_CONSTRUCTOR(
  42. wxGLCanvas(wxWindow *parent,
  43. wxWindowID id = wxID_ANY,
  44. const wxPoint& pos = wxDefaultPosition,
  45. const wxSize& size = wxDefaultSize,
  46. long style = 0,
  47. const wxString& name = wxGLCanvasName,
  48. const int *attribList = NULL,
  49. const wxPalette& palette = wxNullPalette)
  50. );
  51. wxDEPRECATED_CONSTRUCTOR(
  52. wxGLCanvas(wxWindow *parent,
  53. const wxGLContext *shared,
  54. wxWindowID id = wxID_ANY,
  55. const wxPoint& pos = wxDefaultPosition,
  56. const wxSize& size = wxDefaultSize,
  57. long style = 0,
  58. const wxString& name = wxGLCanvasName,
  59. const int *attribList = NULL,
  60. const wxPalette& palette = wxNullPalette)
  61. );
  62. wxDEPRECATED_CONSTRUCTOR(
  63. wxGLCanvas(wxWindow *parent,
  64. const wxGLCanvas *shared,
  65. wxWindowID id = wxID_ANY,
  66. const wxPoint& pos = wxDefaultPosition,
  67. const wxSize& size = wxDefaultSize,
  68. long style = 0,
  69. const wxString& name = wxGLCanvasName,
  70. const int *attribList = NULL,
  71. const wxPalette& palette = wxNullPalette)
  72. );
  73. // called from "realized" callback to create the implicit context if needed
  74. void GTKInitImplicitContext();
  75. #endif // WXWIN_COMPATIBILITY_2_8
  76. // implementation from now on
  77. virtual void OnInternalIdle();
  78. GtkWidget *m_glWidget;
  79. #if WXWIN_COMPATIBILITY_2_8
  80. wxGLContext *m_sharedContext;
  81. wxGLCanvas *m_sharedContextOf;
  82. const bool m_createImplicitContext;
  83. #endif // WXWIN_COMPATIBILITY_2_8
  84. private:
  85. DECLARE_CLASS(wxGLCanvas)
  86. };
  87. #endif // _WX_GLCANVAS_H_