![]() |
Stellarium 0.12.2
|
Manages OpenGL viewport. More...
#include <StelQGLViewport.hpp>
Public Member Functions | |
| StelQGLViewport (StelQGLWidget *const glWidget, QGraphicsView *const parent) | |
| Construct a StelQGLViewport using specified widget. More... | |
| ~StelQGLViewport () | |
| Destroy the StelQGLViewport. More... | |
| void | init (const bool npot, const QString &glVendor, const QString &glRenderer) |
| Initialize the viewport. More... | |
| QPaintEngine::Type | qtPaintEngineType () const |
| Get paint engine type used for Qt drawing. More... | |
| void | viewportHasBeenResized (const QSize newSize) |
| Called when viewport size changes so we can replace the FBOs. More... | |
| void | setDefaultPainter (QPainter *const painter, const QGLContext *const context) |
| Set the default painter to use when not drawing to FBO. More... | |
| QImage | screenshot () const |
| Grab a screenshot. More... | |
| QSize | getViewportSize () const |
| Return current viewport size in pixels. More... | |
| StelTextureBackend * | getViewportTextureBackend (class StelQGLRenderer *renderer) |
| Get a texture of the viewport. More... | |
| bool | useFBO () const |
| Are we using framebuffer objects? More... | |
| void | setFont (const QFont &font) |
| Set font to use for drawing text. More... | |
| void | startFrame () |
| Start using drawing calls. More... | |
| void | suspendFrame () |
| Suspend drawing, not showing the result on the screen. More... | |
| void | finishFrame (const bool swapBuffers=true) |
| Finish using draw calls. More... | |
| void | prepareToDrawViewport () |
| Code that must run before drawing the final result of the rendering to the viewport. More... | |
| void | disablePainting () |
| Disable Qt painting. More... | |
| void | enablePainting () |
| Enable Qt painting (with the current default painter, or constructing a fallback if no default). More... | |
| QPainter * | getPainter () |
| Return the painter currently used to paint, if any. More... | |
Manages OpenGL viewport.
This class handles things like framebuffers and Qt painting to the viewport.
Definition at line 84 of file StelQGLViewport.hpp.
|
inline |
Construct a StelQGLViewport using specified widget.
| glWidget | GL widget that contains the viewport. |
| parent | Parent widget of glWidget. |
Definition at line 91 of file StelQGLViewport.hpp.
|
inline |
Destroy the StelQGLViewport.
Definition at line 127 of file StelQGLViewport.hpp.
|
inline |
Disable Qt painting.
Definition at line 332 of file StelQGLViewport.hpp.
|
inline |
Enable Qt painting (with the current default painter, or constructing a fallback if no default).
Definition at line 346 of file StelQGLViewport.hpp.
|
inline |
Finish using draw calls.
Definition at line 299 of file StelQGLViewport.hpp.
|
inline |
Return the painter currently used to paint, if any.
Definition at line 354 of file StelQGLViewport.hpp.
|
inline |
Return current viewport size in pixels.
Definition at line 242 of file StelQGLViewport.hpp.
| StelTextureBackend* StelQGLViewport::getViewportTextureBackend | ( | class StelQGLRenderer * | renderer | ) |
Get a texture of the viewport.
|
inline |
Initialize the viewport.
| npot | Are non-power-of-two textures supported? |
| glVendor | The GL_VENDOR string (usually specifies the GPU driver). |
| glRenderer | The GL_RENDERER string (usually specifies the GPU). |
Definition at line 143 of file StelQGLViewport.hpp.
|
inline |
Code that must run before drawing the final result of the rendering to the viewport.
Definition at line 320 of file StelQGLViewport.hpp.
|
inline |
Get paint engine type used for Qt drawing.
Definition at line 184 of file StelQGLViewport.hpp.
|
inline |
Grab a screenshot.
Definition at line 235 of file StelQGLViewport.hpp.
|
inline |
Set the default painter to use when not drawing to FBO.
This is the only place where we might be getting a painter from outside world, so we require that it uses a GL or GL2 paint engine.
| painter | Painter to set. |
| context | GL context used by the renderer, for error checking. |
Definition at line 209 of file StelQGLViewport.hpp.
|
inline |
Set font to use for drawing text.
Can be only called when Qt painting is enabled.
Definition at line 261 of file StelQGLViewport.hpp.
|
inline |
Start using drawing calls.
Definition at line 269 of file StelQGLViewport.hpp.
|
inline |
Suspend drawing, not showing the result on the screen.
Finishes using draw calls for this frame. Drawing can continue later. Only usable with FBOs.
Definition at line 292 of file StelQGLViewport.hpp.
|
inline |
Are we using framebuffer objects?
Definition at line 252 of file StelQGLViewport.hpp.
|
inline |
Called when viewport size changes so we can replace the FBOs.
Definition at line 190 of file StelQGLViewport.hpp.
1.8.3.1