1 \section{\class{wxGLCanvas
}}\label{wxglcanvas
}
3 wxGLCanvas is a class for displaying OpenGL graphics. There are
4 wrappers for OpenGL on Windows, and GTK+ and Motif.
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.
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.
15 \wxheading{Derived from
}
17 \helpref{wxWindow
}{wxwindow
}\\
18 \helpref{wxEvtHandler
}{wxevthandler
}\\
19 \helpref{wxObject
}{wxobject
}
21 \wxheading{Include files
}
25 \wxheading{Window styles
}
27 There are no specific window styles for this class.
29 See also
\helpref{window styles overview
}{windowstyles
}.
31 \latexignore{\rtfignore{\wxheading{Members
}}}
33 \membersection{wxGLCanvas::wxGLCanvas
}\label{wxglcanvasconstr
}
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
}}
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
}}
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
}}
49 \membersection{wxGLCanvas::SetCurrent
}\label{wxglcanvassetcurrent
}
51 \func{void
}{SetCurrent
}{\void}
53 Sets this canvas as the current recipient of OpenGL calls.
55 \membersection{wxGLCanvas::SetColour
}\label{wxglcanvassetcolour
}
57 \func{void
}{SetColour
}{\param{const char*
}{ colour
}}
59 Sets the current colour for this window, using the wxWindows colour database to find a named colour.
61 \membersection{wxGLCanvas::SwapBuffers
}\label{wxglcanvasswapbuffers
}
63 \func{void
}{SwapBuffers
}{\void}
65 Displays the previous OpenGL commands on the window.