]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/cocoa/glcanvas.h
renamed GetColHeader() to GetGridColHeader() for consistency with the other existing...
[wxWidgets.git] / include / wx / cocoa / glcanvas.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/glcanvas.h
3// Purpose: wxGLCanvas class
4// Author: David Elliott
5// Modified by:
6// Created: 2004/09/29
7// RCS-ID: $Id$
8// Copyright: (c) 2004 David Elliott
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COCOA_GLCANVAS_H__
13#define _WX_COCOA_GLCANVAS_H__
14
15#include "wx/window.h"
16
17// #include "wx/cocoa/NSOpenGLView.h"
18// Include gl.h from the OpenGL framework
19#include <OpenGL/gl.h>
20
21class WXDLLIMPEXP_FWD_GL wxGLCanvas;
22DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLContext);
23DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLView);
24
25// ========================================================================
26// wxGLContext
27// ========================================================================
28
29class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
30{
31public:
32 wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL);
33
34 virtual ~wxGLContext();
35
36 virtual void SetCurrent(const wxGLCanvas& win) const;
37
38 WX_NSOpenGLContext GetNSOpenGLContext() const
39 { return m_cocoaNSOpenGLContext; }
40
41private:
42 WX_NSOpenGLContext m_cocoaNSOpenGLContext;
43};
44
45// ========================================================================
46// wxGLCanvas
47// ========================================================================
48
49class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
50 // , protected wxCocoaNSOpenGLView
51{
52 DECLARE_DYNAMIC_CLASS(wxGLCanvas)
53// WX_DECLARE_COCOA_OWNER(NSOpenGLView,NSView,NSView)
54// ------------------------------------------------------------------------
55// initialization
56// ------------------------------------------------------------------------
57public:
58 wxGLCanvas(wxWindow *parent,
59 wxWindowID id = wxID_ANY,
60 const int *attribList = NULL,
61 const wxPoint& pos = wxDefaultPosition,
62 const wxSize& size = wxDefaultSize,
63 long style = 0,
64 const wxString& name = wxGLCanvasName,
65 const wxPalette& palette = wxNullPalette)
66 {
67 Create(parent, id, pos, size, style, name, attribList, palette);
68 }
69
70 bool Create(wxWindow *parent,
71 wxWindowID id = wxID_ANY,
72 const wxPoint& pos = wxDefaultPosition,
73 const wxSize& size = wxDefaultSize,
74 long style = 0,
75 const wxString& name = wxGLCanvasName,
76 const int *attribList = NULL,
77 const wxPalette& palette = wxNullPalette);
78
79 virtual ~wxGLCanvas();
80
81// ------------------------------------------------------------------------
82// Cocoa callbacks
83// ------------------------------------------------------------------------
84protected:
85 // NSOpenGLView cannot be enabled/disabled
86 virtual void CocoaSetEnabled(bool enable) { }
87// ------------------------------------------------------------------------
88// Implementation
89// ------------------------------------------------------------------------
90public:
91 virtual void SwapBuffers();
92
93
94 NSOpenGLView *GetNSOpenGLView() const
95 { return (NSOpenGLView *)m_cocoaNSView; }
96};
97
98#endif //ndef _WX_COCOA_GLCANVAS_H__