2000-02-28 03:22:57 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/gtk/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-07-06 11:40:45 -04: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
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
|
2000-02-28 03:22:57 -05:00
|
|
|
|
2007-04-15 19:06:45 -04:00
|
|
|
// implement wxGLCanvasX11 methods
|
2007-04-10 13:38:55 -04:00
|
|
|
// --------------------------------
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual Window GetXWindow() const wxOVERRIDE;
|
2007-04-10 13:38:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
// deprecated methods
|
|
|
|
// ------------------
|
|
|
|
|
|
|
|
#if WXWIN_COMPATIBILITY_2_8
|
|
|
|
wxDEPRECATED(
|
|
|
|
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)
|
|
|
|
);
|
|
|
|
|
|
|
|
wxDEPRECATED(
|
|
|
|
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)
|
|
|
|
);
|
|
|
|
|
|
|
|
wxDEPRECATED(
|
|
|
|
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
|
2014-03-29 20:02:23 -04:00
|
|
|
void OnInternalIdle() wxOVERRIDE;
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2000-02-28 03:22:57 -05:00
|
|
|
bool m_exposed;
|
2012-06-30 16:39:06 -04:00
|
|
|
#ifdef __WXGTK3__
|
|
|
|
cairo_t* m_cairoPaintContext;
|
|
|
|
#endif
|
2002-12-04 09:11:26 -05:00
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|