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  · 

QGLAttributeDescription Class

The QGLAttributeDescription class encapsulates information about an OpenGL attribute value's layout and type. More...

 #include <QGLAttributeDescription>

This class was introduced in Qt 4.8.

Public Functions

QGLAttributeDescription()
QGLAttributeDescription(QGL::VertexAttribute attribute, int tupleSize, GLenum type, int stride)
QGL::VertexAttribute attribute() const
bool isNull() const
void setAttribute(QGL::VertexAttribute attribute)
void setStride(int stride)
void setTupleSize(int tupleSize)
void setType(GLenum type)
int sizeOfType() const
int stride() const
int tupleSize() const
GLenum type() const

Detailed Description

The QGLAttributeDescription class encapsulates information about an OpenGL attribute value's layout and type.

OpenGL has many functions that take a pointer to vertex attribute values: glVertexPointer(), glNormalPointer(), glVertexAttribPointer(), etc. These functions typically take four arguments: tuple size (1, 2, 3, or 4), component type (e.g. GL_FLOAT), stride, and data pointer (glNormalPointer() does not use tuple size, assuming that it is 3). When used with vertex buffers, the data pointer may be an offset into the vertex buffer instead.

QGLAttributeDescription encapsulates the vertex attribute() kind (QGL::Position, QGL::Normal, etc) with the type(), tupleSize(), and stride() information of an attribute. The companion QGLAttributeValue class adds the data pointer.

See also QGLAttributeValue.

Member Function Documentation

QGLAttributeDescription::QGLAttributeDescription()

Constructs a null attribute description with default parameters of tupleSize() and stride() set to zero, type() set to GL_FLOAT, and attribute() set to QGL::Position.

See also isNull().

QGLAttributeDescription::QGLAttributeDescription(QGL::VertexAttribute attribute, int tupleSize, GLenum type, int stride)

Constructs an attribute description with the fields attribute, tupleSize, type, and stride.

QGL::VertexAttribute QGLAttributeDescription::attribute() const

Returns the vertex attribute that this description applies to. The default value is QGL::Position.

See also setAttribute() and type().

bool QGLAttributeDescription::isNull() const

Returns true if tupleSize() is zero, which indicates an unset attribute description; false otherwise.

void QGLAttributeDescription::setAttribute(QGL::VertexAttribute attribute)

Sets the vertex attribute that this description applies to.

See also attribute().

void QGLAttributeDescription::setStride(int stride)

Sets the stride in bytes from one vertex element to the next for this attribute description.

See also stride().

void QGLAttributeDescription::setTupleSize(int tupleSize)

Sets the tuple size of this attribute in components to tupleSize.

See also tupleSize().

void QGLAttributeDescription::setType(GLenum type)

Sets the component type for this attribute description.

See also type() and sizeOfType().

int QGLAttributeDescription::sizeOfType() const

Returns the size in bytes of type().

See also type() and tupleSize().

int QGLAttributeDescription::stride() const

Returns the stride in bytes from one vertex element to the next for this attribute description. The default value of 0 indicates that the elements are tightly packed within the data array.

See also setStride().

int QGLAttributeDescription::tupleSize() const

Returns the tuple size of this attribute in components. For example, a return value of 3 indicates a vector of 3-dimensional values. If tupleSize() is zero, then this attribute description is null.

See also setTupleSize(), isNull(), and sizeOfType().

GLenum QGLAttributeDescription::type() const

Returns the component type for this attribute description. The default value is GL_FLOAT.

See also setType(), sizeOfType(), and attribute().

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