QGLContext Class Reference


The QGLContext class provides an OpenGL context. More...

#include <qgl.h>

List of all member functions.

Public Members

Protected Members


Detailed Description

The QGLContext class provides an OpenGL context.

A context is.


Member Function Documentation

QGLContext::QGLContext ( const QGLFormat & format, QPaintDevice * device )

Constructs an OpenGL context for the paint device device, which must be a widget or a pixmap. The format specify several display options for this context.

The context will be invalid if the format settings cannot be satified.

See also: isValid().

QGLContext::~QGLContext () [virtual]

Destroys the OpenGL context.

bool QGLContext::create ()

Creates the GL context. Returns TRUE if it was successful in creating a context that satisfies the requested format, otherwise FALSE is returned (the context is invalid).

bool QGLContext::isValid () const

Returns TRUE if the widget was able to satisfy the specified constraints.

void QGLContext::setFormat ( const QGLFormat & format )

Sets a new OpenGL context specification format. The context is reset. Call create() to create a new context that matches this format.

    QGLContext *cx;
      ...
    QGLFormat f;
    f.setAlpha( TRUE );
    f.setStereo( TRUE );
    cx->setFormat( f );
    if ( !cx->create() )
        ; // could not create context

See also: format(), reset() and create().


This file is part of the OpenGL support for the Qt toolkit, copyright © 1992-97 Troll Tech, all rights reserved. You may use the OpenGL support classes on the same terms that you may use Qt.

It was generated from the following files:


Generated at 19:09, 1997/10/09 for Qt version 1.30 by the webmaster at Troll Tech