コード例 #1
0
ファイル: mposditem.cpp プロジェクト: akhilo/cmplayer
	void begin() {
		bind();
		enableAttributeArray(vPosition);
		enableAttributeArray(vCoord);
		setAttributeArray(vCoord, m_vCoords.data(), 2);
		setAttributeArray(vPosition, m_vPositions.data(), 2);
		if (m_hasColor) {
			enableAttributeArray(vColor);
			setAttributeArray(vColor, OGL::UInt8, m_vColors.data(), 4);
		}
	}
コード例 #2
0
 void
 GLImageShader2D::setTexCoords(const GLfloat *offset,
                               int            tupleSize,
                               int            stride)
 {
   setAttributeArray(attr_texcoords, offset, tupleSize, stride);
 }
コード例 #3
0
 void
 GLLineShader2D::setColour(const GLfloat *offset,
                           int            tupleSize,
                           int            stride)
 {
   setAttributeArray(attr_colour, offset, tupleSize, stride);
 }
コード例 #4
0
void KWDFile::stopRecording()
{
    Array<uint32> samples;
    String path = String("/recordings/")+String(recordingNumber)+String("/data");
    recdata->getRowXPositions(samples);

    CHECK_ERROR(setAttributeArray(U32,samples.getRawDataPointer(),samples.size(),path,"valid_samples"));
    //ScopedPointer does the deletion and destructors the closings
    recdata = nullptr;
	tsData = nullptr;
}
コード例 #5
0
ファイル: glesrenderer.cpp プロジェクト: gnuty/qmlqles
/**
  * Enables Vertex, normal, color or texCoord arrays and sets start adresses of arrays
  * Type may be: VERTEX_LOCATION, COLOR_LOCATION
  */
bool GLESRenderer::activateAttributeArray (AttributeLocation arrayLocation, const QVector4D * values, int stride )
{
    int location = -1;
    switch(arrayLocation){
      case VERTEX_LOCATION: location = location_aVertex; break;
      case COLOR_LOCATION : location = location_aColor; break;
      default: return false;
    }

    if(values && (location != -1))
    {
        enableAttributeArray(location);
        setAttributeArray(location, GL_FLOAT, values, 3, stride);
        activeAttributeLocations.append(location);
        return true;
    }
    else return false;
}
コード例 #6
0
ファイル: glesrenderer.cpp プロジェクト: gnuty/qmlqles
/**
  * Enables Vertex, normal, color or texCoord arrays and sets start adresses of arrays
  * Type may be: VERTEX_LOCATION, NORMAL_LOCATION, COLOR_LOCATION, TEXCOORD_LOCATION
  */
bool GLESRenderer::activateAttributeArray (AttributeLocation arrayLocation, const QVector3D * values, int stride )
{
    int location = -1;
    int elements = 3;
    switch(arrayLocation){
      case VERTEX_LOCATION: location = location_aVertex; break;
      case NORMAL_LOCATION: location = location_aNormal; break;
      case COLOR_LOCATION : {
                                location = location_aColor;
                                elements = 4; //RGBA colors
                             }break;
      case TEXCOORD_LOCATION : location = location_aTexCoord; break;
      default: return false;
    }

    if(values && (location != -1))
    {
        enableAttributeArray(location);
        setAttributeArray(location, GL_FLOAT, values, elements, stride);
        activeAttributeLocations.append(location);
        return true;
    }
    else return false;
}