1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6
7%Module( name=wx._glcanvas,
8         keyword_arguments="All",
9         use_argument_names=True,
10         all_raise_py_exception=True,
11         language="C++")
12{
13    %AutoPyName(remove_leading="wx")
14};
15
16%Copying
17    Copyright: (c) 2018 by Total Control Software
18    License:   wxWindows License
19%End
20
21%DefaultDocstringFormat(name="deindented")
22
23%Extract(id=pycode_glcanvas, order=5)
24# This file is generated by wxPython's SIP generator.  Do not edit by hand.
25#
26# Copyright: (c) 2018 by Total Control Software
27# License:   wxWindows License
28
29"""
30These classes enable viewing and interacting with an OpenGL context in a wx.Window.
31"""
32
33from ._glcanvas import *
34
35%End
36
37//---------------------------------------------------------------------------
38
39%ModuleHeaderCode
40#include <wxPython/wxpy_api.h>
41#include <wx/glcanvas.h>
42#if !wxUSE_GLCANVAS
43class wxGLContext;
44class wxGLCanvas;
45
46enum  {
47    WX_GL_RGBA,
48    WX_GL_BUFFER_SIZE,
49    WX_GL_LEVEL,
50    WX_GL_DOUBLEBUFFER,
51    WX_GL_STEREO,
52    WX_GL_AUX_BUFFERS,
53    WX_GL_MIN_RED,
54    WX_GL_MIN_GREEN,
55    WX_GL_MIN_BLUE,
56    WX_GL_MIN_ALPHA,
57    WX_GL_DEPTH_SIZE,
58    WX_GL_STENCIL_SIZE,
59    WX_GL_MIN_ACCUM_RED,
60    WX_GL_MIN_ACCUM_GREEN,
61    WX_GL_MIN_ACCUM_BLUE,
62    WX_GL_MIN_ACCUM_ALPHA,
63    WX_GL_SAMPLE_BUFFERS,
64    WX_GL_SAMPLES,
65    WX_GL_CORE_PROFILE,
66    WX_GL_MAJOR_VERSION,
67    WX_GL_MINOR_VERSION,
68};
69
70class wxGLContext : public wxObject {
71public:
72    wxGLContext(wxGLCanvas *win, const wxGLContext *other=NULL)
73        { wxPyRaiseNotImplemented(); }
74
75    virtual bool SetCurrent(const wxGLCanvas &win) const
76        { return false; }
77
78};
79
80class wxGLCanvas : public wxWindow {
81public:
82    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="GLCanvas", const wxPalette &palette=wxNullPalette)
83        { wxPyRaiseNotImplemented(); }
84
85    bool SetColour(const wxString &colour)
86        { return false; }
87
88    bool SetCurrent(const wxGLContext &context) const
89        { return false; }
90
91    virtual bool SwapBuffers()
92        { return false; }
93
94    static bool IsDisplaySupported(const int *attribList)
95        { wxPyRaiseNotImplemented(); return false; }
96
97    static bool IsExtensionSupported(const char *extension)
98        { wxPyRaiseNotImplemented(); return false; }
99
100};
101#endif //!wxUSE_GLCANVAS
102
103%End
104
105%Import _core.sip
106
107
108//---------------------------------------------------------------------------
109
110enum
111{
112    WX_GL_RGBA,
113    WX_GL_BUFFER_SIZE,
114    WX_GL_LEVEL,
115    WX_GL_DOUBLEBUFFER,
116    WX_GL_STEREO,
117    WX_GL_AUX_BUFFERS,
118    WX_GL_MIN_RED,
119    WX_GL_MIN_GREEN,
120    WX_GL_MIN_BLUE,
121    WX_GL_MIN_ALPHA,
122    WX_GL_DEPTH_SIZE,
123    WX_GL_STENCIL_SIZE,
124    WX_GL_MIN_ACCUM_RED,
125    WX_GL_MIN_ACCUM_GREEN,
126    WX_GL_MIN_ACCUM_BLUE,
127    WX_GL_MIN_ACCUM_ALPHA,
128    WX_GL_SAMPLE_BUFFERS,
129    WX_GL_SAMPLES,
130    WX_GL_CORE_PROFILE,
131    WX_GL_MAJOR_VERSION,
132    WX_GL_MINOR_VERSION
133};
134
135class wxGLContext : wxObject
136{
137    %Docstring
138        GLContext(win, other=None)
139
140        An instance of a wxGLContext represents the state of an OpenGL state
141        machine and the connection between OpenGL and the system.
142    %End
143    %TypeHeaderCode
144        #include <wx/glcanvas.h>
145    %End
146
147public:
148    wxGLContext(
149        wxGLCanvas * win,
150        const wxGLContext * other = NULL
151    );
152    %PreMethodCode
153        if (!wxPyCheckForApp()) return NULL;
154    %End
155
156    virtual
157    bool SetCurrent(
158        const wxGLCanvas & win
159    ) const;
160    %Docstring
161        SetCurrent(win) -> bool
162
163        Makes the OpenGL state that is represented by this rendering context
164        current with the wxGLCanvas win.
165    %End
166
167    private:
168        wxGLContext(const wxGLContext&);
169
170
171    public:
172
173
174};  // end of class wxGLContext
175
176
177class wxGLCanvas : wxWindow
178{
179    %Docstring
180        GLCanvas(parent, id=wx.ID_ANY, attribList=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name='GLCanvas', palette=wx.NullPalette)
181
182        wxGLCanvas is a class for displaying OpenGL graphics.
183    %End
184    %TypeHeaderCode
185        #include <wx/glcanvas.h>
186    %End
187
188public:
189    wxGLCanvas(
190             wxWindow* parent, wxWindowID id=wxID_ANY, wxArrayInt* attribList=NULL,
191             const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize,
192             long style=0, const wxString& name="GLCanvas",
193             const wxPalette& palette=wxNullPalette) [ (
194             wxWindow* parent, wxWindowID id=wxID_ANY, const int* attribList=NULL,
195             const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize,
196             long style=0, const wxString& name="GLCanvas",
197             const wxPalette& palette=wxNullPalette) ];
198    %MethodCode
199        const int* attribPtr = NULL;
200        if (attribList) {
201            attribList->push_back(0); // ensure it is zero-terminated
202            attribPtr = &attribList->front();
203        }
204        sipCpp = new sipwxGLCanvas(parent, id, attribPtr, *pos, *size, style, *name, *palette);
205    %End
206
207    bool SetColour(
208        const wxString & colour
209    );
210    %Docstring
211        SetColour(colour) -> bool
212
213        Sets the current colour for this window (using glcolor3f()), using the
214        wxWidgets colour database to find a named colour.
215    %End
216
217    bool SetCurrent(
218        const wxGLContext & context
219    ) const;
220    %Docstring
221        SetCurrent(context) -> bool
222
223        Makes the OpenGL state that is represented by the OpenGL rendering
224        context context current, i.e.
225    %End
226
227    bool SwapBuffers();
228    %Docstring
229        SwapBuffers() -> bool
230
231        Swaps the double-buffer of this window, making the back-buffer the
232        front-buffer and vice versa, so that the output of the previous OpenGL
233        commands is displayed on the window.
234    %End
235
236    static
237    bool IsDisplaySupported(
238        wxArrayInt* attribList
239    );
240    %Docstring
241        IsDisplaySupported(attribList) -> bool
242
243        Determines if a canvas having the specified attributes is available.
244    %End
245    %MethodCode
246        const int* attribPtr = NULL;
247        if (attribList) {
248            attribList->push_back(0); // ensure it is zero-terminated
249            attribPtr = &attribList->front();
250        }
251        sipRes = wxGLCanvas::IsDisplaySupported(attribPtr);
252    %End
253
254    static
255    bool IsExtensionSupported(
256        const char * extension
257    );
258    %Docstring
259        IsExtensionSupported(extension) -> bool
260
261        Returns true if the extension with given name is supported.
262    %End
263
264    public:
265    virtual wxPoint GetClientAreaOrigin() const;
266    virtual bool Validate();
267    virtual bool TransferDataToWindow();
268    virtual bool TransferDataFromWindow();
269    virtual void InitDialog();
270    virtual bool AcceptsFocus() const;
271    virtual bool AcceptsFocusRecursively() const;
272    virtual bool AcceptsFocusFromKeyboard() const;
273    virtual void AddChild( wxWindowBase *child );
274    virtual void RemoveChild( wxWindowBase *child );
275    virtual void InheritAttributes();
276    virtual bool ShouldInheritColours() const;
277    virtual void OnInternalIdle();
278    virtual wxWindow *GetMainWindowOfCompositeControl();
279    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
280    virtual void SetCanFocus(bool canFocus);
281    virtual bool Destroy();
282    virtual void SetValidator( const wxValidator &validator );
283    virtual wxValidator* GetValidator();
284
285
286    protected:
287    virtual bool ProcessEvent(wxEvent & event);
288    virtual void DoEnable(bool enable);
289    virtual void DoGetPosition(int *x, int *y) const;
290    virtual void DoGetSize(int *width, int *height) const;
291    virtual void DoGetClientSize(int *width, int *height) const;
292    virtual wxSize DoGetBestSize() const;
293    virtual wxSize DoGetBestClientSize() const;
294    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
295    virtual void DoSetClientSize(int width, int height);
296    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
297    virtual wxSize DoGetBorderSize() const;
298    virtual void DoMoveWindow(int x, int y, int width, int height);
299    virtual void DoSetWindowVariant( wxWindowVariant variant);
300    virtual wxBorder GetDefaultBorder() const;
301    virtual wxBorder GetDefaultBorderForControl() const;
302    virtual void DoFreeze();
303    virtual void DoThaw();
304    virtual bool HasTransparentBackground();
305    virtual bool TryBefore(wxEvent& event);
306    virtual bool TryAfter(wxEvent& event);
307
308
309    public:
310
311
312    static
313    wxVisualAttributes GetClassDefaultAttributes(
314        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
315    );
316    %Docstring
317        GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
318    %End
319    %PreMethodCode
320        if (!wxPyCheckForApp()) return NULL;
321    %End
322
323    public:
324
325
326};  // end of class wxGLCanvas
327
328
329%Extract(id=pycode_glcanvas, order=10)
330import wx
331
332%End
333
334const int wxUSE_GLCANVAS;
335
336//---------------------------------------------------------------------------
337
338