.\" This is a wxWidgets manpage page generated from the XML docs .TH wxGLContext 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxGLContext \- Class to ease sharing of OpenGL data resources. .SH DESCRIPTION wxGLContext is a class for sharing OpenGL data resources, such as display lists, with another wxGLCanvas . By sharing data resources, you can prevent code duplication, save memory, and ultimately help optimize your application. As an example, let's say you want to draw a ball on two different windows that is identical on each one, but the dimensions of one is slightly different than the other one. What you would do is create your display lists in the shared context, and then translate each ball on the individual canvas's context. This way the actual data for the ball is only created once (in the shared context), and you won't have to duplicate your development efforts on the second ball. Note that some wxGLContext features are extremely platform-specific - its best to check your native platform's glcanvas header (on windows include/wx/msw/glcanvas.h) to see what features your native platform provides. .SH "PARENTS" wxObject .SH "INCLUDE FILES" wx/glcanvas.h .SH MEMBERS .SS void wxGLContext (bool isRGBwxGLCanvas* winconst wxPalette& palette = wxNullPalette) .SS void wxGLContext (bool isRGBwxGLCanvas* winconst wxPalette& palette = wxNullPaletteconst wxGLContext* other) .SS const wxWindow* GetWindow () Obtains the window that is associated with this context. .SS void SetCurrent () Sets this context as the current recipient of OpenGL calls. Each context contains an OpenGL device context that has been created during the creation of this window. So this call sets the current device context as the target device context for OpenGL operations. .SS void SetColour (const char* colour) Sets the current colour for this context, using the wxWidgets colour database to find a named colour. .SS void SwapBuffers () Displays the previous OpenGL commands on the associated window. .SH "SEE ALSO" wxObject wxGLCanvas .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.