.\" This is a wxWidgets manpage page generated from the XML docs .TH wxGLCanvas 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxGLCanvas \- Canvas that you can render OpenGL calls to. .SH DESCRIPTION wxGLCanvas is a class for displaying OpenGL graphics. There are wrappers for OpenGL on Windows, and GTK+ and Motif. To use this class, create a wxGLCanvas window, call wxGLCanvas::SetCurrent to direct normal OpenGL commands to the window, and then call wxGLCanvas::SwapBuffers to show the OpenGL buffer on the window. To set up the attributes for the rendering context (number of bits for the depth buffer, number of bits for the stencil buffer and so on) you should set up the correct values of the attribList parameter. The values that should be set up and their meanings will be described below. To switch wxGLCanvas support on under Windows, edit setup.h and set wxUSE_GLCANVAS to 1. You may also need to have to add opengl32.lib to the list of libraries your program is linked with. On Unix, pass --with-opengl to configure to compile using OpenGL or Mesa. .SH "PARENTS" wxWindow wxEvtHandler wxObject .SH "INCLUDE FILES" wx/glcanvas.h .SH MEMBERS .SS void wxGLCanvas (wxWindow* parentwxWindowID id = -1const wxPoint& pos = wxDefaultPositionconst wxSize& size = wxDefaultSizelong style = 0const wxString& name = "GLCanvas"int* attribList = 0const wxPalette& palette = wxNullPalette) .SS void wxGLCanvas (wxWindow* parentwxGLContext* sharedContextwxWindowID id = -1const wxPoint& pos = wxDefaultPositionconst wxSize& size = wxDefaultSizelong style = 0const wxString& name = "GLCanvas"int* attribList = 0const wxPalette& palette = wxNullPalette) .SS void wxGLCanvas (wxWindow* parentwxGLCanvas* sharedCanvaswxWindowID id = -1const wxPoint& pos = wxDefaultPositionconst wxSize& size = wxDefaultSizelong style = 0const wxString& name = "GLCanvas"int* attribList = 0const wxPalette& palette = wxNullPalette) Constructor. attribList[index]= WX_GL_DEPTH_SIZE; attribList[index+1]=32; and so on. .SS wxGLContext* GetContext () Obtains the context that is associated with this canvas. .SS void SetCurrent () Sets this canvas as the current recipient of OpenGL calls. Each canvas 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. Note that this function may only be called after the window has been shown. .SS void SetColour (const char* colour) Sets the current colour for this window, using the wxWidgets colour database to find a named colour. .SS void SwapBuffers () Displays the previous OpenGL commands on the window. .SH "WINDOW STYLES" .SH "SEE ALSO" wxWindow wxEvtHandler wxObject wxGLContext .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.