Beispiel #1
0
void GLSceneNode::draw()
{
    QListIterator<Renderable*> it(this->objects);
    while(it.hasNext()) {
        Renderable *r = it.next();
        r->render();
    }
}
Beispiel #2
0
    void displayHandler() {
       glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

       drawAxes();
       drawSpiral();
       drawTangents();

       glPushMatrix();
       glTranslated(moveV.x, moveV.y, moveV.z);
       glRotated(angleDeg, os.x, os.y, os.z);
       r.render();

       glPopMatrix();
       glutSwapBuffers();
    }
Beispiel #3
0
void CRenderList::render()
{
    m_target->bind();

    for (std::vector<SNodeList>::const_iterator iter = m_draw.begin(); iter < m_draw.end(); ++iter)
    {
        Renderable* item = (*iter)._draw;
        if (!item)
        {
            continue;
        }

        ASSERT(item->getRenderJob(), "Invalid Render job");
        item->getRenderJob()->setRenderTarget((*iter)._targetIndex);

        item->render();
    }

    m_target->unbind();
}
Beispiel #4
0
void Engine::render() {
    int width, height;
    glfwGetWindowSize(window, &width, &height);

    float aspect_ratio = width / (float) height;
    camera.set_aspect_ratio(aspect_ratio); // TODO check if changed?

    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glClearDepth(1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glm::mat4 view = camera.view_matrix();
    glm::mat4 proj = camera.projection_matrix();

    for(std::vector<Renderable*>::iterator it = renderables.begin();
            it != renderables.end(); ++it) {
        Renderable* torender = *it;
        torender->render(proj, view);
    }

    glfwSwapBuffers(window);
}