2000-02-28 03:22:57 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/gtk1/glcanvas.h
|
2004-05-23 10:56:36 -04:00
|
|
|
// Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWidgets and GTK
|
2000-02-28 03:22:57 -05:00
|
|
|
// Author: Robert Roebling
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/8/98
|
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2000-02-28 03:22:57 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-07-25 12:36:51 -04:00
|
|
|
#ifndef _WX_GLCANVAS_H_
|
|
|
|
#define _WX_GLCANVAS_H_
|
|
|
|
|
2007-04-15 19:06:45 -04:00
|
|
|
#include "wx/unix/glx11.h"
|
2000-02-28 03:22:57 -05:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2001-09-28 09:53:55 -04:00
|
|
|
// wxGLCanvas
|
2000-02-28 03:22:57 -05:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2007-12-11 20:35:53 -05:00
|
|
|
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasX11
|
2000-02-28 03:22:57 -05:00
|
|
|
{
|
|
|
|
public:
|
2016-02-22 18:30:49 -05:00
|
|
|
wxGLCanvas(wxWindow *parent,
|
|
|
|
const wxGLAttributes& dispAttrs,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxGLCanvasName,
|
|
|
|
const wxPalette& palette = wxNullPalette);
|
|
|
|
|
2016-08-30 04:44:32 -04:00
|
|
|
explicit // avoid implicitly converting a wxWindow* to wxGLCanvas
|
2007-04-10 13:38:55 -04:00
|
|
|
wxGLCanvas(wxWindow *parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const int *attribList = NULL,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxGLCanvasName,
|
|
|
|
const wxPalette& palette = wxNullPalette);
|
|
|
|
|
2016-02-22 18:30:49 -05:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
const wxGLAttributes& dispAttrs,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxGLCanvasName,
|
|
|
|
const wxPalette& palette = wxNullPalette);
|
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
2002-12-04 09:11:26 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxGLCanvasName,
|
2007-04-10 13:38:55 -04:00
|
|
|
const int *attribList = NULL,
|
|
|
|
const wxPalette& palette = wxNullPalette);
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2000-02-28 03:22:57 -05:00
|
|
|
|
2007-04-15 19:06:45 -04:00
|
|
|
// implement wxGLCanvasX11 methods
|
|
|
|
// -------------------------------
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2019-08-28 12:37:49 -04:00
|
|
|
virtual unsigned long GetXWindow() const;
|
2007-04-10 13:38:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
// deprecated methods
|
|
|
|
// ------------------
|
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY_2_8
|
2009-06-05 04:54:48 -04:00
|
|
|
wxDEPRECATED_CONSTRUCTOR(
|
2007-04-10 13:38:55 -04:00
|
|
|
wxGLCanvas(wxWindow *parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxGLCanvasName,
|
|
|
|
const int *attribList = NULL,
|
|
|
|
const wxPalette& palette = wxNullPalette)
|
|
|
|
);
|
|
|
|
|
2009-06-05 04:54:48 -04:00
|
|
|
wxDEPRECATED_CONSTRUCTOR(
|
2007-04-10 13:38:55 -04:00
|
|
|
wxGLCanvas(wxWindow *parent,
|
|
|
|
const wxGLContext *shared,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxGLCanvasName,
|
|
|
|
const int *attribList = NULL,
|
|
|
|
const wxPalette& palette = wxNullPalette)
|
|
|
|
);
|
|
|
|
|
2009-06-05 04:54:48 -04:00
|
|
|
wxDEPRECATED_CONSTRUCTOR(
|
2007-04-10 13:38:55 -04:00
|
|
|
wxGLCanvas(wxWindow *parent,
|
|
|
|
const wxGLCanvas *shared,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxGLCanvasName,
|
|
|
|
const int *attribList = NULL,
|
|
|
|
const wxPalette& palette = wxNullPalette)
|
|
|
|
);
|
|
|
|
|
|
|
|
// called from "realized" callback to create the implicit context if needed
|
|
|
|
void GTKInitImplicitContext();
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_8
|
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
virtual void OnInternalIdle();
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2000-02-28 03:22:57 -05:00
|
|
|
GtkWidget *m_glWidget;
|
2007-04-10 13:38:55 -04:00
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY_2_8
|
|
|
|
wxGLContext *m_sharedContext;
|
|
|
|
wxGLCanvas *m_sharedContextOf;
|
|
|
|
const bool m_createImplicitContext;
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_8
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2000-02-28 03:22:57 -05:00
|
|
|
private:
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_CLASS(wxGLCanvas);
|
2000-02-28 03:22:57 -05:00
|
|
|
};
|
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
#endif // _WX_GLCANVAS_H_
|
2000-02-28 03:22:57 -05:00
|
|
|
|