]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/glcanvas.tex
wxGLCanvas doesn't derive from wxScrolledWindow since quite some time already despite...
[wxWidgets.git] / docs / latex / wx / glcanvas.tex
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 To switch wxGLCanvas support on under Windows, edit setup.h and set
11 {\tt wxUSE\_GLCANVAS} to $1$. You may also need to have to add
12 {\tt opengl32.lib} to the list of libraries your program is linked with. On
13 Unix, pass {\tt --with-opengl} to configure to compile using OpenGL or Mesa.
14
15 \wxheading{Derived from}
16
17 \helpref{wxWindow}{wxwindow}\\
18 \helpref{wxEvtHandler}{wxevthandler}\\
19 \helpref{wxObject}{wxobject}
20
21 \wxheading{Include files}
22
23 <wx/glcanvas.h>
24
25 \wxheading{Window styles}
26
27 There are no specific window styles for this class.
28
29 See also \helpref{window styles overview}{windowstyles}.
30
31 \latexignore{\rtfignore{\wxheading{Members}}}
32
33 \membersection{wxGLCanvas::wxGLCanvas}\label{wxglcanvasconstr}
34
35 \func{void}{wxGLCanvas}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id = -1}, \param{const wxPoint\&}{ pos},
36 \param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="GLCanvas"},
37 \param{int*}{ attribList = 0}, \param{const wxPalette\&}{ palette = wxNullPalette}}
38
39 \func{void}{wxGLCanvas}{\param{wxWindow* }{parent}, \param{wxGLCanvas* }{ sharedCanvas = NULL}, \param{wxWindowID}{ id = -1}, \param{const wxPoint\&}{ pos},
40 \param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="GLCanvas"},
41 \param{int*}{ attribList = 0}, \param{const wxPalette\&}{ palette = wxNullPalette}}
42
43 \func{void}{wxGLCanvas}{\param{wxWindow* }{parent}, \param{wxGLContext* }{ sharedContext = NULL}, \param{wxWindowID}{ id = -1}, \param{const wxPoint\&}{ pos},
44 \param{const wxSize\&}{ size}, \param{long}{ style=0}, \param{const wxString\& }{name="GLCanvas"},
45 \param{int*}{ attribList = 0}, \param{const wxPalette\&}{ palette = wxNullPalette}}
46
47 Constructor.
48
49 \membersection{wxGLCanvas::SetCurrent}\label{wxglcanvassetcurrent}
50
51 \func{void}{SetCurrent}{\void}
52
53 Sets this canvas as the current recipient of OpenGL calls.
54
55 \membersection{wxGLCanvas::SetColour}\label{wxglcanvassetcolour}
56
57 \func{void}{SetColour}{\param{const char*}{ colour}}
58
59 Sets the current colour for this window, using the wxWindows colour database to find a named colour.
60
61 \membersection{wxGLCanvas::SwapBuffers}\label{wxglcanvasswapbuffers}
62
63 \func{void}{SwapBuffers}{\void}
64
65 Displays the previous OpenGL commands on the window.
66