The context's format is set in the constructor or later with setFormat(). The format options that are actually set are returned by format(); the options you asked for are returned by requestedFormat(). Note that after a TQGLContext object has been constructed, the actual OpenGL context must be created by explicitly calling the create() function. The makeCurrent() function makes this context the current rendering context. You can make \fIno\fR context current using doneCurrent(). The reset() function will reset the context and make it invalid.
Constructs an OpenGL context for the paint device \fIdevice\fR, which can be a widget or a pixmap. The \fIformat\fR specifies several display options for the context.
.PP
If the underlying OpenGL/Window system cannot satisfy all the features requested in \fIformat\fR, the nearest subset of features will be used. After creation, the format() method will return the actual format obtained.
Note that after a TQGLContext object has been constructed, create() must be called explicitly to create the actual OpenGL context. The context will be invalid if it was not possible to obtain a GL context at all.
This semi-internal function is called by create(). It creates a system-dependent OpenGL handle that matches the format() of \fIshareContext\fR as closely as possible.
.PP
On Windows, it calls the virtual function choosePixelFormat(), which finds a matching pixel format identifier. On X11, it calls the virtual function chooseVisual() which finds an appropriate X visual. On other platforms it may work differently.
\fBMac only\fR: This virtual function tries to find a visual that matches the format using the given \fIdevice\fR handle, reducing the demands if the original request cannot be met.
The algorithm for reducing the demands of the format is quite simple-minded, so override this method in your subclass if your application has specific requirements on visual selection.
\fBWin32 only\fR This virtual function chooses a pixel format that matches the OpenGL format. Reimplement this function in a subclass if you need a custom context.
.PP
\fBWarning:\fR The \fIdummyPfd\fR pointer and \fIpdc\fR are used as a \fCPIXELFORMATDESCRIPTOR*\fR. We use \fCvoid\fR to avoid using Windows-specific types in our header files.
The algorithm for reducing the demands of the format is quite simple-minded, so override this method in your subclass if your application has spcific requirements on visual selection.
Creates the GL context. Returns TRUE if it was successful in creating a valid GL rendering context on the paint device specified in the constructor; otherwise returns FALSE (i.e. the context is invalid).
.PP
After successful creation, format() returns the set of features of the created GL rendering context.
If \fIshareContext\fR points to a valid TQGLContext, this method will try to establish OpenGL display list sharing between this context and the \fIshareContext\fR. Note that this may fail if the two contexts have different formats. Use isSharing() to see if sharing succeeded.
\fBWarning:\fR Implementation note: initialization of C++ class members usually takes place in the class constructor. TQGLContext is an exception because it must be simple to customize. The virtual functions chooseContext() (and chooseVisual() for X11) can be reimplemented in a subclass to select a particular context. The problem is that virtual functions are not properly called during construction (even though this is correct C++) because C++ constructs class hierarchies from the bottom up. For this reason we need a create() function.
Returns TRUE if display list sharing with another context was requested in the create() call and the GL system was able to fulfill this request; otherwise returns FALSE. Note that display list sharing might not be supported between contexts with different formats.
If this context is a valid context in an overlay plane, returns the plane's transparent color. Otherwise returns an invalid color.
.PP
The returned color's pixel value is the index of the transparent color in the colormap of the overlay plane. (Naturally, the color's RGB values are meaningless.)
The returned TQColor object will generally work as expected only when passed as the argument to TQGLWidget::qglColor() or TQGLWidget::qglClearColor(). Under certain circumstances it can also be used to draw transparent graphics with a TQPainter. See the examples/opengl/overlay_x11 example for details.
.SH "void TQGLContext::setInitialized ( bool on )\fC [protected]\fR"
If \fIon\fR is TRUE the context has been initialized, i.e. TQGLContext::setInitialized() has been called on it. If \fIon\fR is FALSE the context has not been initialized.