applied wxGLApp patch (#464500)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11716 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-09-28 13:53:55 +00:00
parent b3e8d00ab0
commit a6f5aa49cf
8 changed files with 294 additions and 122 deletions

View File

@@ -32,7 +32,7 @@ class wxApp: public wxAppBase
{
public:
wxApp();
~wxApp();
virtual ~wxApp();
/* override for altering the way wxGTK intializes the GUI
* (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
@@ -75,6 +75,10 @@ public:
#endif
unsigned char *m_colorCube;
// used by the the wxGLApp and wxGLCanvas class for GL-based X visual
// selection; this is actually an XVisualInfo*
void *m_glVisualInfo;
private:
// true if we're inside an assert modal dialog
#ifdef __WXDEBUG__

View File

@@ -16,16 +16,17 @@
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include <wx/defs.h>
#include "wx/defs.h"
#if wxUSE_GLCANVAS
#include <wx/scrolwin.h>
#include "wx/scrolwin.h"
#include "wx/app.h"
extern "C" {
#include "GL/gl.h"
#include "GL/glx.h"
#include "GL/glu.h"
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glu.h>
}
//---------------------------------------------------------------------------
@@ -100,7 +101,7 @@ private:
};
//---------------------------------------------------------------------------
// wxGLContext
// wxGLCanvas
//---------------------------------------------------------------------------
class WXDLLEXPORT wxGLCanvas: public wxScrolledWindow
@@ -161,15 +162,43 @@ public:
wxGLContext *m_glContext,
*m_sharedContext;
wxGLCanvas *m_sharedContextOf;
void *m_vi;
void *m_vi; // actually an XVisualInfo*
bool m_canFreeVi;
GtkWidget *m_glWidget;
bool m_exposed;
// returns an XVisualInfo* based on desired GL attributes;
// returns NULL if an appropriate visual is not found. The
// caller is reponsible for using XFree() to deallocate
// the returned structure.
static void* ChooseGLVisual(int *attribList);
private:
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxGLCanvas)
};
//---------------------------------------------------------------------------
// wxGLApp
//---------------------------------------------------------------------------
class WXDLLEXPORT wxGLApp: public wxApp
{
public:
wxGLApp() : wxApp() { }
~wxGLApp();
// use this in the constructor of the user-derived wxGLApp class to select
// an appropriate X visual for GL. Returns TRUE if an appropriate visual
// is found - and sets m_glVisualInfo; FALSE otherwise.
bool InitGLVisual(int *attribList);
private:
DECLARE_DYNAMIC_CLASS(wxGLApp)
};
#endif
// wxUSE_GLCANVAS

View File

@@ -32,7 +32,7 @@ class wxApp: public wxAppBase
{
public:
wxApp();
~wxApp();
virtual ~wxApp();
/* override for altering the way wxGTK intializes the GUI
* (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
@@ -75,6 +75,10 @@ public:
#endif
unsigned char *m_colorCube;
// used by the the wxGLApp and wxGLCanvas class for GL-based X visual
// selection; this is actually an XVisualInfo*
void *m_glVisualInfo;
private:
// true if we're inside an assert modal dialog
#ifdef __WXDEBUG__

View File

@@ -16,16 +16,17 @@
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include <wx/defs.h>
#include "wx/defs.h"
#if wxUSE_GLCANVAS
#include <wx/scrolwin.h>
#include "wx/scrolwin.h"
#include "wx/app.h"
extern "C" {
#include "GL/gl.h"
#include "GL/glx.h"
#include "GL/glu.h"
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glu.h>
}
//---------------------------------------------------------------------------
@@ -100,7 +101,7 @@ private:
};
//---------------------------------------------------------------------------
// wxGLContext
// wxGLCanvas
//---------------------------------------------------------------------------
class WXDLLEXPORT wxGLCanvas: public wxScrolledWindow
@@ -161,15 +162,43 @@ public:
wxGLContext *m_glContext,
*m_sharedContext;
wxGLCanvas *m_sharedContextOf;
void *m_vi;
void *m_vi; // actually an XVisualInfo*
bool m_canFreeVi;
GtkWidget *m_glWidget;
bool m_exposed;
// returns an XVisualInfo* based on desired GL attributes;
// returns NULL if an appropriate visual is not found. The
// caller is reponsible for using XFree() to deallocate
// the returned structure.
static void* ChooseGLVisual(int *attribList);
private:
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxGLCanvas)
};
//---------------------------------------------------------------------------
// wxGLApp
//---------------------------------------------------------------------------
class WXDLLEXPORT wxGLApp: public wxApp
{
public:
wxGLApp() : wxApp() { }
~wxGLApp();
// use this in the constructor of the user-derived wxGLApp class to select
// an appropriate X visual for GL. Returns TRUE if an appropriate visual
// is found - and sets m_glVisualInfo; FALSE otherwise.
bool InitGLVisual(int *attribList);
private:
DECLARE_DYNAMIC_CLASS(wxGLApp)
};
#endif
// wxUSE_GLCANVAS