Fixed wxUniv+OpenGL compilation for MSW; Cosmetic cleanup.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,20 +58,25 @@ class WXDLLIMPEXP_GL wxGLContext: public wxObject
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette = wxNullPalette);
|
wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette = wxNullPalette);
|
||||||
wxGLContext(
|
|
||||||
bool isRGB, wxGLCanvas *win,
|
wxGLContext( bool isRGB, wxGLCanvas *win,
|
||||||
const wxPalette& WXUNUSED(palette),
|
const wxPalette& WXUNUSED(palette),
|
||||||
const wxGLContext *other /* for sharing display lists */
|
const wxGLContext *other /* for sharing display lists */ );
|
||||||
);
|
|
||||||
~wxGLContext();
|
~wxGLContext();
|
||||||
|
|
||||||
|
|
||||||
void SetCurrent();
|
void SetCurrent();
|
||||||
|
|
||||||
void SetColour(const wxChar *colour);
|
void SetColour(const wxChar *colour);
|
||||||
|
|
||||||
void SwapBuffers();
|
void SwapBuffers();
|
||||||
|
|
||||||
|
|
||||||
inline wxWindow* GetWindow() const { return m_window; }
|
inline wxWindow* GetWindow() const { return m_window; }
|
||||||
|
|
||||||
inline WXHDC GetHDC() const { return m_hDC; }
|
inline WXHDC GetHDC() const { return m_hDC; }
|
||||||
|
|
||||||
inline HGLRC GetGLRC() const { return m_glContext; }
|
inline HGLRC GetGLRC() const { return m_glContext; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -83,47 +88,68 @@ public:
|
|||||||
class WXDLLIMPEXP_GL wxGLCanvas: public wxWindow
|
class WXDLLIMPEXP_GL wxGLCanvas: public wxWindow
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(wxGLCanvas)
|
DECLARE_CLASS(wxGLCanvas)
|
||||||
public:
|
public:
|
||||||
wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
|
wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize, long style = 0,
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette);
|
const wxString& name = wxGLCanvasName, int *attribList = 0,
|
||||||
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
|
const wxPalette& palette = wxNullPalette);
|
||||||
wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
|
|
||||||
const wxSize& size = wxDefaultSize, long style = 0, const wxString&
|
|
||||||
name = wxGLCanvasName,
|
|
||||||
int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette );
|
|
||||||
|
|
||||||
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1,
|
wxGLCanvas(wxWindow *parent,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0,
|
const wxGLContext *shared = (wxGLContext *) NULL,
|
||||||
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette );
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxGLCanvasName,
|
||||||
|
int *attribList = (int *) NULL,
|
||||||
|
const wxPalette& palette = wxNullPalette);
|
||||||
|
|
||||||
|
wxGLCanvas(wxWindow *parent,
|
||||||
|
const wxGLCanvas *shared = (wxGLCanvas *)NULL,
|
||||||
|
wxWindowID id = wxID_ANY,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxGLCanvasName,
|
||||||
|
int *attribList = 0,
|
||||||
|
const wxPalette& palette = wxNullPalette);
|
||||||
|
|
||||||
~wxGLCanvas();
|
~wxGLCanvas();
|
||||||
|
|
||||||
// Replaces wxWindow::Create functionality, since we need to use a different window class
|
// Replaces wxWindow::Create functionality, since
|
||||||
|
// we need to use a different window class
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name);
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
long style, const wxString& name);
|
||||||
|
|
||||||
void SetCurrent();
|
void SetCurrent();
|
||||||
#ifdef __WXUNIVERSAL__
|
|
||||||
virtual bool SetCurrent(bool doit = true){ return wxWindow::SetCurrent(doit); };
|
#ifdef __WXUNIVERSAL__
|
||||||
#endif
|
virtual bool SetCurrent(bool doit) { return wxWindow::SetCurrent(doit); };
|
||||||
|
#endif
|
||||||
|
|
||||||
void SetColour(const wxChar *colour);
|
void SetColour(const wxChar *colour);
|
||||||
|
|
||||||
void SwapBuffers();
|
void SwapBuffers();
|
||||||
|
|
||||||
void OnSize(wxSizeEvent& event);
|
void OnSize(wxSizeEvent& event);
|
||||||
|
|
||||||
void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
|
void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
|
||||||
|
|
||||||
void OnPaletteChanged(wxPaletteChangedEvent& event);
|
void OnPaletteChanged(wxPaletteChangedEvent& event);
|
||||||
|
|
||||||
inline wxGLContext* GetContext() const { return m_glContext; }
|
inline wxGLContext* GetContext() const { return m_glContext; }
|
||||||
|
|
||||||
inline WXHDC GetHDC() const { return m_hDC; }
|
inline WXHDC GetHDC() const { return m_hDC; }
|
||||||
void SetupPixelFormat(int *attribList = (int*) NULL);
|
|
||||||
|
void SetupPixelFormat(int *attribList = (int *) NULL);
|
||||||
|
|
||||||
void SetupPalette(const wxPalette& palette);
|
void SetupPalette(const wxPalette& palette);
|
||||||
|
|
||||||
wxPalette CreateDefaultPalette();
|
wxPalette CreateDefaultPalette();
|
||||||
|
|
||||||
inline wxPalette* GetPalette() const { return (wxPalette*) & m_palette; }
|
inline wxPalette* GetPalette() const { return (wxPalette *) &m_palette; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxGLContext* m_glContext; // this is typedef-ed ptr, in fact
|
wxGLContext* m_glContext; // this is typedef-ed ptr, in fact
|
||||||
|
Reference in New Issue
Block a user