⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qglcontext.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
字号:
.TH QGLContext 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQGLContext \- Encapsulates an OpenGL rendering context<h1 align=center>QGLContext Class Reference.br<small>[ OpenGL module ]</small></h1>.br.PP\fC#include <qgl.h>\fR.PPInherits QGL..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQGLContext\fR ( const QGLFormat & " "format" ", QPaintDevice * device ) ".br.ti -1c.BI "virtual \fB~QGLContext\fR () ".br.ti -1c.BI "virtual bool \fBcreate\fR ( const QGLContext * " "shareContext" " = 0 ) ".br.ti -1c.BI "bool \fBisValid\fR () const".br.ti -1c.BI "bool \fBisSharing\fR () const".br.ti -1c.BI "virtual void \fBreset\fR () ".br.ti -1c.BI "QGLFormat \fBformat\fR () const".br.ti -1c.BI "virtual void \fBsetFormat\fR ( const QGLFormat & format ) ".br.ti -1c.BI "virtual void \fBmakeCurrent\fR () ".br.ti -1c.BI "virtual void \fBswapBuffers\fR () const".br.ti -1c.BI "QPaintDevice* \fBdevice\fR () const".br.ti -1c.BI "QColor \fBoverlayTransparentColor\fR () const".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "const QGLContext* \fBcurrentContext\fR () ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual bool \fBchooseContext\fR ( const QGLContext * " "shareContext" " = 0 ) ".br.ti -1c.BI "virtual void \fBdoneCurrent\fR () ".br.ti -1c.BI "bool \fBdeviceIsPixmap\fR () const".br.ti -1c.BI "bool \fBwindowCreated\fR () const".br.ti -1c.BI "void \fBsetWindowCreated\fR ( bool on ) ".br.ti -1c.BI "bool \fBinitialized\fR () const".br.ti -1c.BI "void \fBsetInitialized\fR ( bool on ) ".br.ti -1c.BI "uint \fBcolorIndex\fR ( const QColor & c ) const (internal)".br.in -1c.SH DESCRIPTIONThe QGLContext class encapsulates an OpenGL rendering context..PPAn OpenGL rendering context is a complete set of OpenGL state variables..SH MEMBER FUNCTION DOCUMENTATION.SH "QGLContext::QGLContext ( const QGLFormat & format, QPaintDevice * device )"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 this context..PPIf 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..PPThe context will be invalid if it was not possible to obtain a GL context at all..PPSee also format() and isValid()..SH "QGLContext::~QGLContext () \fC[virtual]\fR"Destroys the OpenGL context..SH "bool QGLContext::chooseContext ( const QGLContext * shareContext = 0 = 0 ) \fC[virtual protected]\fR"This semi-internal function is called by create(). It creates a system-dependent OpenGL handle that matches the specified format as closely as possible..PP\fBWindows\fR: Calls choosePixelFormat() which finds a matching pixel format identifier..PP\fBX11\fR: Calls chooseVisual() which finds an appropriate X visual..PPchoosePixelFormat() and chooseVisual() can be reimplemented in a subclass if you need to choose a very custom context..SH "bool QGLContext::create ( const QGLContext * shareContext = 0 ) \fC[virtual]\fR"Creates the GL context. Returns TRUE if it was successful in creating a GL rendering context on the paint device specified in the constructor, otherwise FALSE is returned (the context is invalid)..PPAfter successful creation, format() returns the set of features of the created GL rendering context..PPIf \fIshareContext\fR points to a valid QGLContext, this method will try to establish OpenGL display list sharing between this context and \fIshareContext.\fR Note that this may fail if the two contexts have different formats. Use isSharing() to test..PP\fBImplementation note:\fR Initialization of C++ class members usually takes place in the class constructor. QGLContext 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 trouble is that virtual functions are not properly called during construction (which is indeed correct C++), hence we need a create() function..PPSee also chooseContext(), format() and isValid()..SH "const QGLContext* QGLContext::currentContext () \fC[static]\fR"Returns the current context, i.e. the context to which any OpenGL commands will currently be directed to. Returns 0 if no context is current..PPSee also makeCurrent()..SH "QPaintDevice* QGLContext::device () const"Returns the paint device set for this context..PPSee also QGLContext::QGLContext()..SH "bool QGLContext::deviceIsPixmap () const \fC[protected]\fR"Returns TRUE if the paint device of this context is a pixmap, otherwise FALSE..SH "void QGLContext::doneCurrent () \fC[virtual protected]\fR"Makes no GL context the current context. Normally, you do not need to call this function, QGLContext calls it as necessary..SH "QGLFormat QGLContext::format () const"Returns the format..SH "bool QGLContext::initialized () const \fC[protected]\fR"Returns TRUE if this context has been initialized, i.e. if QGLWidget::initializeGL() has been performed on it..PPSee also setInitialized()..SH "bool QGLContext::isSharing () const"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. Note that display list sharing may possibly not be supported between contexts with different formats..SH "bool QGLContext::isValid () const"Returns TRUE if a GL rendering context has been successfully created..SH "void QGLContext::makeCurrent () \fC[virtual]\fR"Makes this context the current OpenGL rendering context. All GL functions you call operate on this context until another context is made current..SH "QColor QGLContext::overlayTransparentColor () const"If this context is a valid context in an overlay plane, returns the plane's transparent color. Otherwise returns an invalid color..PPThe returned color's pixel value is the index of the transparent color in the colormap of the overlay plane. The color's RGB values are meaningless, of course..PPThe returned QColor object will generally only work as expected when passed as the argument to QGLWidget::qglColor() or QGLWidget::qglClearColor(). Under certain circumstances it can also be used to draw transparent graphics with a QPainter; see the "overlay_x11" example for details..SH "void QGLContext::reset () \fC[virtual]\fR"Resets the context and makes it invalid..PPSee also create() and isValid()..SH "void QGLContext::setFormat ( const QGLFormat & format ) \fC[virtual]\fR"Sets a \fIformat\fR for this context. The context is reset..PPCall create() to create a new GL context that tries to match the new format..PP.nf.br    QGLContext *cx;.br      ....br    QGLFormat f;.br    f.setStereo( TRUE );.br    cx->setFormat( f );.br    if ( !cx->create() ).br        exit(); // no OpenGL support, or cannot render on specified paintdevice.br    if ( !cx->format().stereo() ).br        exit(); // could not create stereo context.fi.PPSee also format(), reset() and create()..SH "void QGLContext::setInitialized ( bool on ) \fC[protected]\fR"Tells the context whether it has been initialized, i.e. whether QGLWidget::initializeGL() has been performed on it..PPSee also initialized()..SH "void QGLContext::setWindowCreated ( bool on ) \fC[protected]\fR"Tells the context whether a window has already been created for it..PPSee also windowCreated()..SH "void QGLContext::swapBuffers () const \fC[virtual]\fR"Swaps the screen contents with an off-screen buffer. Works only if the context is in double buffer mode..PPSee also QGLFormat::setDoubleBuffer()..SH "bool QGLContext::windowCreated () const \fC[protected]\fR"Returns TRUE if a window has been created for this context, otherwise FALSE..PPSee also setWindowCreated()..SH "uint QGLContext::colorIndex ( const QColor & c ) const \fC[protected]\fR"For internal use only..SH "SEE ALSO".BR http://doc.trolltech.com/qglcontext.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -