contents up previous next

wxglcontext

an instance of a wxglcontext represents the state of an opengl state machine and the connection between opengl and the system.

the opengl state includes everything that can be set with the opengl api: colors, rendering variables, display lists, texture objects, etc. although it is possible to have multiple rendering contexts share display lists in order to save resources, this method is hardly used today any more, because display lists are only a tiny fraction of the overall state.

therefore, one rendering context is usually used with or bound to multiple output windows in turn, so that the application has access to the complete and identical state while rendering into each window.

binding (making current) a rendering context with another instance of a wxglcanvas however works only if the other wxglcanvas was created with the same attributes as the wxglcanvas from which the wxglcontext was initialized. (this applies to sharing display lists among contexts analogously.)

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.

derived from

wxobject

include files

<wx/glcanvas.h>

see also

wxglcanvas

members

wxglcontext::wxglcontext
wxglcontext::setcurrent


wxglcontext::wxglcontext

wxglcontext( wxglcanvas* win, const wxglcontext* other=null )

constructor.

win

other


wxglcontext::setcurrent

void setcurrent(const wxglcanvas win)

makes the opengl state that is represented by this rendering context current with the wxglcanvas win. note that win can be a different wxglcanvas window than the one that was passed to the constructor of this rendering context. if rc is an object of type wxglcontext, the statements rc.setcurrent(win); and win.setcurrent(rc); are equivalent, see wxglcanvas::setcurrent.