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