2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-01-26 12:20:50 -05:00
|
|
|
// Name: wx/x11/glcanvas.h
|
2004-05-23 10:56:36 -04:00
|
|
|
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets 2.0 for Motif.
|
2002-02-05 11:34:33 -05:00
|
|
|
// Uses the GLX extension.
|
|
|
|
// Author: Julian Smart and Wolfram Gloger
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1995, 1999
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart, Wolfram Gloger
|
2006-01-26 12:20:50 -05:00
|
|
|
// Licence: wxWindows licence
|
2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-07-25 12:36:51 -04:00
|
|
|
#ifndef _WX_GLCANVAS_H_
|
|
|
|
#define _WX_GLCANVAS_H_
|
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
|
|
|
|
#include <GL/glx.h>
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
class WXDLLEXPORT wxGLContext : public wxGLContextBase
|
2002-02-05 11:34:33 -05:00
|
|
|
{
|
|
|
|
public:
|
2007-04-10 13:38:55 -04:00
|
|
|
wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxGLContext();
|
2006-01-26 12:20:50 -05:00
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
virtual void SetCurrent(const wxGLCanvas& win) const;
|
2006-01-26 12:20:50 -05:00
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
private:
|
2002-02-05 11:34:33 -05:00
|
|
|
GLXContext m_glContext;
|
2006-01-26 12:20:50 -05:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
DECLARE_CLASS(wxGLContext)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
class WXDLLEXPORT wxGLCanvas : public wxGLCanvasBase
|
2002-02-05 11:34:33 -05:00
|
|
|
{
|
|
|
|
public:
|
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);
|
|
|
|
|
|
|
|
bool Create(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);
|
2006-01-26 12:20:50 -05:00
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxGLCanvas();
|
2006-01-26 12:20:50 -05:00
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
virtual void SwapBuffers();
|
2006-01-26 12:20:50 -05:00
|
|
|
|
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// implementation
|
2007-04-10 13:38:55 -04:00
|
|
|
void *m_vi;
|
2006-01-26 12:20:50 -05:00
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
protected:
|
|
|
|
virtual int GetColourIndex(const wxColour& col);
|
2006-01-26 12:20:50 -05:00
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
DECLARE_CLASS(wxGLCanvas)
|
2002-02-05 11:34:33 -05:00
|
|
|
};
|
|
|
|
|
2007-04-10 13:38:55 -04:00
|
|
|
#endif // _WX_GLCANVAS_H_
|