]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/glcontext.tex
Patches-1851591 ] dataview sample is crashing (under MSW)
[wxWidgets.git] / docs / latex / wx / glcontext.tex
CommitLineData
38fc80ae
RN
1\section{\class{wxGLContext}}\label{wxglcontext}
2
b7ea712c 3An instance of a wxGLContext represents the state of an OpenGL state machine and the connection between OpenGL and the system.
38fc80ae 4
b7ea712c
RR
5The OpenGL state includes everything that can be set with the OpenGL API: colors, rendering variables, display lists, texture objects, etc.
6Although it is possible to have multiple rendering contexts share display lists in order to save resources,
7this method is hardly used today any more, because display lists are only a tiny fraction of the overall state.
38fc80ae 8
b7ea712c
RR
9Therefore, one rendering context is usually used with or bound to multiple output windows in turn,
10so that the application has access to the \emph{complete and identical} state while rendering into each window.
11
12Binding (making current) a rendering context with another instance of a wxGLCanvas however works only
13if the other wxGLCanvas was created with the same attributes as the wxGLCanvas from which the wxGLContext
14was initialized. (This applies to sharing display lists among contexts analogously.)
38fc80ae
RN
15
16Note 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.
17
a7af285d
VZ
18\wxheading{Library}
19
20\helpref{wxGl}{librarieslist}
21
38fc80ae
RN
22\wxheading{Derived from}
23
24\helpref{wxObject}{wxobject}
25
26\wxheading{Include files}
27
f2ac0386
RN
28<wx/glcanvas.h>
29
30\wxheading{See also}
38fc80ae
RN
31
32\helpref{wxGLCanvas}{wxglcanvas}
33
34\latexignore{\rtfignore{\wxheading{Members}}}
35
38fc80ae 36
b7ea712c 37\membersection{wxGLContext::wxGLContext}\label{wxglcontextconstr}
38fc80ae 38
b7ea712c 39\func{ }{wxGLContext}{ \param{wxGLCanvas*}{ win}, \param{const wxGLContext*}{ other=NULL} }
38fc80ae 40
b7ea712c 41Constructor.
38fc80ae 42
b7ea712c
RR
43\docparam{win}{The canvas that is used to initialize this context. This parameter is needed only temporarily,
44and the caller may do anything with it (e.g. destroy the window) after the constructor returned.
38fc80ae 45
b7ea712c
RR
46It will be possible to bind (make current) this context to any other wxGLCanvas that has been created
47with equivalent attributes as {\it win}.}
38fc80ae 48
b7ea712c 49\docparam{other}{Context to share display lists with or NULL (the default) for no sharing.}
38fc80ae 50
38fc80ae
RN
51
52\membersection{wxGLContext::SetCurrent}\label{wxglcontextsetcurrent}
53
e9793aef 54\func{void}{SetCurrent}{\param{const wxGLCanvas\&}{ win}}
058a62b1 55
b7ea712c
RR
56Makes the OpenGL state that is represented by this rendering context current with the wxGLCanvas {\it win}.
57Note that {\it win} can be a different wxGLCanvas window than the one that was passed to the constructor of this rendering context.
b67a86d5 58If { \it RC } is an object of type wxGLContext, the statements {\it RC.SetCurrent(win);} and {\it win.SetCurrent(RC);} are equivalent,
659f4d76 59see \helpref{wxGLCanvas::SetCurrent}{wxglcanvassetcurrent}.
b67a86d5 60