Exemple #1
0
void SQPrimitives::init(QGLShaderProgram *program)
{
    _program = program;
    initializeGLFunctions();
    glGenBuffers(2, _vboIds);
    initCubeGeometry();
}
void Visualizer::paintGL()
{
    // Clear color and depth buffer
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

       texture->bind();

       // Calculate model view transformation
       QMatrix4x4 matrix;
       matrix.translate(0.0, 0.0, -5.0);
       matrix.rotate(rotation);

       // Set modelview-projection matrix
       program.setUniformValue("mvp_matrix", projection * matrix);

       // Use texture unit 0 which contains cube.png
       program.setUniformValue("texture", 0);

       // Generate 2 VBOs
       arrayBuf.create();
       indexBuf.create();

       // Initializes cube geometry and transfers it to VBOs
       initCubeGeometry();
       drawCubeGeometry(&program);


}
Exemple #3
0
void GeometryEngine::init()
{
    this->initializeOpenGLFunctions();

    // Generate 2 VBOs
    glGenBuffers(2, vboIds);


    // Initializes cube geometry and transfers it to VBOs
    initCubeGeometry();
}
void GeometryEngine::init()
{
//! [0]
    // Generate 2 VBOs
    glGenBuffers(2, vboIds);

//! [0]

    // Initializes cube geometry and transfers it to VBOs
    initCubeGeometry();
}
Exemple #5
0
//! [0]
GeometryEngine::GeometryEngine()
    : indexBuf(QOpenGLBuffer::IndexBuffer)
{
    initializeOpenGLFunctions();

    // Generate 2 VBOs
    arrayBuf.create();
    indexBuf.create();

    // Initializes cube geometry and transfers it to VBOs
    initCubeGeometry();
}
void GeometryEngine::init()
{
    initCubeGeometry();
}