Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

RenderState Class

(QSGMaterialShader::RenderState)

The QSGMaterialShader::RenderState encapsulates the current rendering state during a call to QSGMaterialShader::updateState(). More...

 #include <QSGMaterialShader>

Public Types

enum DirtyState { DirtyMatrix, DirtyOpacity }
flags DirtyStates

Public Functions

QMatrix4x4 combinedMatrix() const
QOpenGLContext * context() const
float determinant() const
QRect deviceRect() const
DirtyStates dirtyStates() const
bool isMatrixDirty() const
bool isOpacityDirty() const
QMatrix4x4 modelViewMatrix() const
float opacity() const
QRect viewportRect() const

Detailed Description

The QSGMaterialShader::RenderState encapsulates the current rendering state during a call to QSGMaterialShader::updateState().

The render state contains a number of accessors that the shader needs to respect in order to conform to the current state of the scene graph.

The instance is only valid inside a call to QSGMaterialShader::updateState() and should not be used outisde this function.

Member Type Documentation

enum RenderState::DirtyState
flags RenderState::DirtyStates

ConstantValueDescription
QSGMaterialShader::RenderState::DirtyMatrix0x0001Used to indicate that the matrix has changed and must be updated.
QSGMaterialShader::RenderState::DirtyOpacity0x0002Used to indicate that the opacity has changed and must be updated.

The DirtyStates type is a typedef for QFlags<DirtyState>. It stores an OR combination of DirtyState values.

Member Function Documentation

QMatrix4x4 RenderState::combinedMatrix() const

Returns the matrix combined of modelview matrix and project matrix.

QOpenGLContext * RenderState::context() const

Returns the QOpenGLContext that is being used for rendering

float RenderState::determinant() const

Returns the modelview determinant to be used for rendering

QRect RenderState::deviceRect() const

Returns the device rect of the surface being rendered to

DirtyStates RenderState::dirtyStates() const

Returns which rendering states that have changed and needs to be updated for geometry rendered with this material to conform to the current rendering state.

bool RenderState::isMatrixDirty() const

Convenience function to check if the dirtyStates() indicates that the matrix needs to be updated.

bool RenderState::isOpacityDirty() const

Conveience function to check if the dirtyStates() indicates that the opacity needs to be updated.

QMatrix4x4 RenderState::modelViewMatrix() const

Returns the model view matrix.

If the material has the RequiresFullMatrix flag set, this is guaranteed to be the complete transform matrix calculated from the scenegraph.

However, if this flag is not set, the renderer may choose to alter this matrix. For example, it may pre-transform vertices on the CPU and set this matrix to identity.

In a situation such as the above, it is still possible to retrieve the actual matrix determinant by setting the RequiresDeterminant flag in the material and calling the determinant() accessor.

float RenderState::opacity() const

Returns the accumulated opacity to be used for rendering

QRect RenderState::viewportRect() const

Returns the viewport rect of the surface being rendered to.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web