]>
Commit | Line | Data |
---|---|---|
1 | \section{\class{wxGLCanvas}}\label{wxglcanvas} | |
2 | ||
3 | wxGLCanvas is a class for displaying OpenGL graphics. There are | |
4 | wrappers for OpenGL on Windows, and GTK+ and Motif. | |
5 | ||
6 | To use this class, create a wxGLCanvas window, call \helpref{wxGLCanvas::SetCurrent}{wxglcanvassetcurrent} | |
7 | to direct normal OpenGL commands to the window, and then call \helpref{wxGLCanvas::SwapBuffers}{wxglcanvasswapbuffers} | |
8 | to show the OpenGL buffer on the window. | |
9 | ||
10 | Please note that despite deriving from wxScrolledWindow, scrolling is not enabled for this class under | |
11 | Windows. | |
12 | ||
13 | To switch wxGLCanvas support on under Windows, edit setup.h and set wxUSE\_GLCANVAS to 1. On Unix, | |
14 | pass --with-opengl to configure to compile using OpenGL or Mesa. | |
15 | ||
16 | \wxheading{Derived from} | |
17 | ||
18 | \helpref{wxScrolledWindow}{wxscrolledwindow}\\ | |
19 | \helpref{wxWindow}{wxwindow}\\ | |
20 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
21 | \helpref{wxObject}{wxobject} | |
22 | ||
23 | \wxheading{Include files} | |
24 | ||
25 | <wx/glcanvas.h> | |
26 | ||
27 | \wxheading{Window styles} | |
28 | ||
29 | There are no specific window styles for this class. | |
30 | ||
31 | See also \helpref{window styles overview}{windowstyles}. | |
32 | ||
33 | \latexignore{\rtfignore{\wxheading{Members}}} | |
34 | ||
35 | \membersection{wxGLCanvas::wxGLCanvas}\label{wxglcanvasconstr} | |
36 | ||
37 | \func{void}{wxGLCanvas}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id = -1}, \param{const wxPoint\&}{ pos}, | |
38 | \param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="GLCanvas"}, | |
39 | \param{int*}{ attribList = 0}, \param{const wxPalette\&}{ palette = wxNullPalette}} | |
40 | ||
41 | \func{void}{wxGLCanvas}{\param{wxWindow* }{parent}, \param{wxGLCanvas* }{ sharedCanvas = NULL}, \param{wxWindowID}{ id = -1}, \param{const wxPoint\&}{ pos}, | |
42 | \param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="GLCanvas"}, | |
43 | \param{int*}{ attribList = 0}, \param{const wxPalette\&}{ palette = wxNullPalette}} | |
44 | ||
45 | \func{void}{wxGLCanvas}{\param{wxWindow* }{parent}, \param{wxGLContext* }{ sharedContext = NULL}, \param{wxWindowID}{ id = -1}, \param{const wxPoint\&}{ pos}, | |
46 | \param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="GLCanvas"}, | |
47 | \param{int*}{ attribList = 0}, \param{const wxPalette\&}{ palette = wxNullPalette}} | |
48 | ||
49 | Constructor. | |
50 | ||
51 | \membersection{wxGLCanvas::SetCurrent}\label{wxglcanvassetcurrent} | |
52 | ||
53 | \func{void}{SetCurrent}{\void} | |
54 | ||
55 | Sets this canvas as the current recipient of OpenGL calls. | |
56 | ||
57 | \membersection{wxGLCanvas::SetColour}\label{wxglcanvassetcolour} | |
58 | ||
59 | \func{void}{SetColour}{\param{const char*}{ colour}} | |
60 | ||
61 | Sets the current colour for this window, using the wxWindows colour database to find a named colour. | |
62 | ||
63 | \membersection{wxGLCanvas::SwapBuffers}\label{wxglcanvasswapbuffers} | |
64 | ||
65 | \func{void}{SwapBuffers}{\void} | |
66 | ||
67 | Displays the previous OpenGL commands on the window. | |
68 |