You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
277 lines
6.0 KiB
277 lines
6.0 KiB
13 years ago
|
// This is the SIP interface definition for TQGL, TQGLContext, TQGLFormat and
|
||
|
// TQGLWidget.
|
||
13 years ago
|
//
|
||
|
// Copyright (c) 2007
|
||
|
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
|
||
|
//
|
||
13 years ago
|
// This file is part of PyTQt.
|
||
13 years ago
|
//
|
||
13 years ago
|
// This copy of PyTQt is free software; you can redistribute it and/or modify it
|
||
13 years ago
|
// under the terms of the GNU General Public License as published by the Free
|
||
|
// Software Foundation; either version 2, or (at your option) any later
|
||
|
// version.
|
||
|
//
|
||
13 years ago
|
// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
|
||
13 years ago
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
|
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
|
// details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU General Public License along with
|
||
13 years ago
|
// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
|
||
13 years ago
|
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||
|
|
||
|
|
||
|
%ExportedDoc
|
||
13 years ago
|
<Sect2><Title>TQGL</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQGL</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQGLContext</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQGLContext</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQGLFormat</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQGLFormat</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
13 years ago
|
<Sect2><Title>TQGLWidget</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQGLWidget</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
%End
|
||
|
|
||
|
|
||
13 years ago
|
const int TQGL_VERSION;
|
||
|
const char *TQGL_VERSION_STR;
|
||
13 years ago
|
|
||
|
const char *qGLVersion();
|
||
|
|
||
|
|
||
13 years ago
|
class TQGL
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqgl.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
|
enum FormatOption {
|
||
|
DoubleBuffer,
|
||
|
DepthBuffer,
|
||
|
Rgba,
|
||
|
AlphaChannel,
|
||
|
AccumBuffer,
|
||
|
StencilBuffer,
|
||
|
StereoBuffers,
|
||
|
DirectRendering,
|
||
|
HasOverlay,
|
||
|
SingleBuffer,
|
||
|
NoDepthBuffer,
|
||
|
ColorIndex,
|
||
|
NoAlphaChannel,
|
||
|
NoAccumBuffer,
|
||
|
NoStencilBuffer,
|
||
|
NoStereoBuffers,
|
||
|
IndirectRendering,
|
||
|
NoOverlay
|
||
|
};
|
||
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQGLFormat : TQGL
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqgl.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQGLFormat();
|
||
|
TQGLFormat(int,int = 0);
|
||
13 years ago
|
|
||
|
bool doubleBuffer() const;
|
||
|
void setDoubleBuffer(bool);
|
||
|
bool depth() const;
|
||
|
void setDepth(bool);
|
||
|
bool rgba() const;
|
||
|
void setRgba(bool);
|
||
|
bool alpha() const;
|
||
|
void setAlpha(bool);
|
||
|
bool accum() const;
|
||
|
void setAccum(bool);
|
||
|
bool stencil() const;
|
||
|
void setStencil(bool);
|
||
|
bool stereo() const;
|
||
|
void setStereo(bool);
|
||
|
bool directRendering() const;
|
||
|
void setDirectRendering(bool);
|
||
|
bool hasOverlay() const;
|
||
|
void setOverlay(bool);
|
||
|
|
||
|
int plane() const;
|
||
|
void setPlane(int);
|
||
|
|
||
|
void setOption(FormatOption);
|
||
|
bool testOption(FormatOption) const;
|
||
|
|
||
13 years ago
|
static TQGLFormat defaultFormat();
|
||
|
static void setDefaultFormat(const TQGLFormat &);
|
||
13 years ago
|
|
||
13 years ago
|
static TQGLFormat defaultOverlayFormat();
|
||
|
static void setDefaultOverlayFormat(const TQGLFormat &);
|
||
13 years ago
|
|
||
|
static bool hasOpenGL();
|
||
|
static bool hasOpenGLOverlays();
|
||
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQGLContext : TQGL
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqgl.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQGLContext(const TQGLFormat &,TQPaintDevice *);
|
||
|
TQGLContext(const TQGLFormat &);
|
||
13 years ago
|
|
||
13 years ago
|
virtual bool create(const TQGLContext * = 0);
|
||
13 years ago
|
bool isValid() const;
|
||
|
bool isSharing() const;
|
||
|
virtual void reset();
|
||
|
|
||
13 years ago
|
TQGLFormat format() const;
|
||
|
TQGLFormat requestedFormat() const;
|
||
|
virtual void setFormat(const TQGLFormat &);
|
||
13 years ago
|
|
||
|
virtual void makeCurrent();
|
||
|
virtual void swapBuffers() const;
|
||
|
|
||
13 years ago
|
TQPaintDevice *device() const;
|
||
13 years ago
|
|
||
13 years ago
|
TQColor overlayTransparentColor() const;
|
||
13 years ago
|
|
||
13 years ago
|
static const TQGLContext *currentContext();
|
||
13 years ago
|
|
||
|
protected:
|
||
13 years ago
|
virtual bool chooseContext(const TQGLContext * = 0);
|
||
13 years ago
|
virtual void doneCurrent();
|
||
|
|
||
|
%If (WS_X11)
|
||
13 years ago
|
virtual void *tryVisual(const TQGLFormat &,int = 1);
|
||
13 years ago
|
virtual void *chooseVisual();
|
||
|
%End
|
||
|
|
||
|
bool deviceIsPixmap() const;
|
||
|
bool windowCreated() const;
|
||
|
void setWindowCreated(bool);
|
||
|
bool initialized() const;
|
||
|
void setInitialized(bool);
|
||
13 years ago
|
void generateFontDisplayLists(const TQFont &,int);
|
||
13 years ago
|
|
||
13 years ago
|
uint colorIndex(const TQColor &) const;
|
||
13 years ago
|
void setValid(bool);
|
||
13 years ago
|
void setDevice(TQPaintDevice *);
|
||
13 years ago
|
|
||
|
private:
|
||
13 years ago
|
TQGLContext();
|
||
|
TQGLContext(const TQGLContext &);
|
||
13 years ago
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TQGLWidget : TQWidget, TQGL
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqgl.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQGLWidget(TQWidget * /TransferThis/ = 0,const char * = 0,
|
||
|
const TQGLWidget * = 0,WFlags = 0);
|
||
|
TQGLWidget(TQGLContext * /Transfer/,TQWidget * /TransferThis/ = 0,const char * = 0,
|
||
|
const TQGLWidget * = 0,WFlags = 0);
|
||
|
TQGLWidget(const TQGLFormat &,TQWidget * /TransferThis/ = 0,
|
||
|
const char * = 0,const TQGLWidget * = 0,WFlags = 0);
|
||
13 years ago
|
|
||
|
%ConvertToSubClassCode
|
||
13 years ago
|
sipClass = (sipCpp->inherits(sipName_TQGLWidget) ? sipClass_TQGLWidget : NULL);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
void qglColor(const TQColor &) const;
|
||
|
void qglClearColor(const TQColor &) const;
|
||
13 years ago
|
|
||
|
bool isValid() const;
|
||
|
bool isSharing() const;
|
||
|
virtual void makeCurrent();
|
||
|
void doneCurrent();
|
||
|
|
||
|
bool doubleBuffer() const;
|
||
|
virtual void swapBuffers();
|
||
|
|
||
13 years ago
|
TQGLFormat format() const;
|
||
13 years ago
|
|
||
13 years ago
|
const TQGLContext *context() const;
|
||
13 years ago
|
|
||
13 years ago
|
virtual TQPixmap renderPixmap(int = 0,int = 0,bool = 0);
|
||
|
virtual TQImage grabFrameBuffer(bool = 0);
|
||
13 years ago
|
|
||
|
virtual void makeOverlayCurrent();
|
||
13 years ago
|
const TQGLContext *overlayContext() const;
|
||
13 years ago
|
|
||
13 years ago
|
static TQImage convertToGLFormat(const TQImage &);
|
||
13 years ago
|
|
||
|
void setMouseTracking(bool);
|
||
|
|
||
2 years ago
|
virtual void reparent(TQWidget * /GetWrapper/,WFlags,const TQPoint &,
|
||
13 years ago
|
bool = 0);
|
||
|
%MethodCode
|
||
|
if (sipCpp -> parent() != a0)
|
||
|
if (a0)
|
||
|
sipTransferTo(sipSelf,a0Wrapper);
|
||
|
else
|
||
|
sipTransferBack(sipSelf);
|
||
|
|
||
|
Py_BEGIN_ALLOW_THREADS
|
||
13 years ago
|
sipSelfWasArg ? sipCpp->TQGLWidget::reparent(a0, a1, *a2, a3) : sipCpp->reparent(a0, a1, *a2, a3);
|
||
13 years ago
|
Py_END_ALLOW_THREADS
|
||
|
%End
|
||
|
|
||
13 years ago
|
const TQGLColormap &colormap() const;
|
||
|
void setColormap(const TQGLColormap &);
|
||
13 years ago
|
|
||
13 years ago
|
void renderText(int,int,const TQString &,const TQFont & = TQFont(),
|
||
13 years ago
|
int = 2000);
|
||
13 years ago
|
void renderText(double,double,double,const TQString &,
|
||
|
const TQFont & = TQFont(),int = 2000);
|
||
13 years ago
|
|
||
|
public slots:
|
||
|
virtual void updateGL();
|
||
|
virtual void updateOverlayGL();
|
||
|
|
||
|
protected:
|
||
|
virtual void initializeGL();
|
||
|
virtual void resizeGL(int,int);
|
||
|
virtual void paintGL();
|
||
|
|
||
|
virtual void initializeOverlayGL();
|
||
|
virtual void resizeOverlayGL(int,int);
|
||
|
virtual void paintOverlayGL();
|
||
|
|
||
|
void setAutoBufferSwap(bool);
|
||
|
bool autoBufferSwap() const;
|
||
|
|
||
13 years ago
|
void paintEvent(TQPaintEvent *);
|
||
|
void resizeEvent(TQResizeEvent *);
|
||
13 years ago
|
|
||
|
virtual void glInit();
|
||
|
virtual void glDraw();
|
||
|
|
||
|
private:
|
||
13 years ago
|
TQGLWidget(const TQGLWidget &);
|
||
13 years ago
|
};
|