It is getting called. In the background of the Scene you can see one of the Axis rotating for a second. But the scene stands still. Nothing changes.
Sorry this is the first time that i use a forum. So i don't know well how to post the code.


#include "cube.hpp"
#include <QtOpenGL>
#include <QtGui>
#include <qdebug>
#define DTR 0.0174532925
Cube_test::Cube_test(QWidget *pParent) :
QGLWidget(pParent)
{
glEnable(GL_STEREO);
QGLFormat fmt;
fmt.setAlpha(true);
fmt.setStereo(true);
for(int i = 0; i < 3; ++i)
{
m_rotation[i] = 0.0f;
}
depthZ=-10;
fovy=45;
nearZ=3.0;
farZ=30.0;
screenZ = 10.0;
IOD = 0.5;
}

Cube_test::~Cube_test()
{

}

void Cube_test::initializeGL()
{
qglClearColor(Qt::black);
glShadeModel(GL_SMOOTH);
glCullFace(GL_BACK);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);

}

void Cube_test::resizeGL(int width, int height)
{
glViewport(0, 0, width, height);
aspect=double(width)/double(height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
float x = static_cast<float> (width) / static_cast<float> (height);
glFrustum(-x, +x, -1.0f, +1.0f, 4.0f, 100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
setFrustum();
}
void Cube_test::setFrustum()
{
double top=nearZ*tan(DTR*fovy/2);
double right=aspect*top;
double frustumshift=(IOD/2)*nearZ/screenZ;

leftCam.topfrustum=top;
leftCam.bottomfrustum=-top;
leftCam.leftfrustum=-right+frustumshift;
leftCam.rightfrustum=right+frustumshift;
leftCam.modeltranslation=IOD/2;

rightCam.topfrustum=top;
rightCam.bottomfrustum=-top;
rightCam.leftfrustum=-right-frustumshift;
rightCam.rightfrustum=right-frustumshift;
rightCam.modeltranslation=-IOD/2;
}
void Cube_test:aintGL()
{
glDrawBuffer(GL_BACK);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

const float camPos[3] = { 10.0f, 10.0f, 10.0f };

glRotatef(35.0f, 1.0f, 0.0f, 0.0f);
glRotatef(-45.0f, 0.0f, 1.0f, 0.0f);
glTranslatef(-camPos[0], -camPos[1], -camPos[2]);

// user cam rotation
glRotatef(m_rotation[0], 1.0f, 0.0f, 0.0f);
glRotatef(m_rotation[1], 0.0f, 1.0f, 0.0f);
glRotatef(m_rotation[2], 0.0f, 0.0f, 1.0f);

const int numIndices = 24;
const int numVertices = 8;

const int indices[numIndices] = { 3, 2, 1, 0, 2, 6, 5, 1, 2, 3, 7, 6, 4, 7, 3, 0, 5, 4, 0, 1, 7, 4, 5, 6};

const float vertices[numVertices][3] =
{
{-1.0f, -1.0f, -1.0f},
{-1.0f, -1.0f, 1.0f},
{1.0f, -1.0f, 1.0f},
{1.0f, -1.0f, -1.0f},

{-1.0f, 1.0f, -1.0f},
{-1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, -1.0f},
};

const QColor vertexColors[numVertices] =
{
Qt::red,
Qt::green,
Qt::blue,
Qt::white,
Qt::black,
Qt::yellow,
Qt::darkRed,
Qt::darkGreen
};


glDrawBuffer(GL_BACK_LEFT);

glMatrixMode(GL_PROJECTION);

glLoadIdentity();
glFrustum(leftCam.leftfrustum,leftCam.rightfrustum ,leftCam.bottomfrustum,leftCam.topfrustum,nearZ,fa rZ); // move rightward for left eye view
glTranslatef(leftCam.modeltranslation,0.0,0.0);
glMatrixMode(GL_MODELVIEW);
//glLoadIdentity();
//glPushMatrix();
{
// glTranslatef(0.0,0.0,depthZ);
drawGrid();
drawAxis();

glBegin(GL_QUADS);

for(int i = 0; i < numIndices; ++i)
{
const int currentIndex = indices[i];

qglColor(vertexColors[currentIndex]);
glVertex3f(vertices[currentIndex][0], vertices[currentIndex][1], vertices[currentIndex][2]);
}

glEnd();
}
glPopMatrix();

glDrawBuffer(GL_BACK_RIGHT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(rightCam.leftfrustum,rightCam.rightfrust um,rightCam.bottomfrustum,rightCam.topfrustum,near Z,farZ);
glTranslatef(rightCam.modeltranslation,0.0,0.0);

glMatrixMode(GL_MODELVIEW);
// glLoadIdentity();
//glPushMatrix();
{
// glTranslatef(0.0,0.0,depthZ);
drawGrid();
drawAxis();
glBegin(GL_QUADS);

for(int i = 0; i < numIndices; ++i)
{
const int currentIndex = indices[i];

qglColor(vertexColors[currentIndex]);
glVertex3f(vertices[currentIndex][0], vertices[currentIndex][1], vertices[currentIndex][2]);
}

glEnd();
}

// glPopMatrix();
swapBuffers();
}

void Cube_test::drawAxis()
{
const float axisLength = 100.0f;

glBegin(GL_LINES);

glLineWidth(5);

qglColor(Qt::yellow);
glVertex3f(-axisLength, 0.0f, 0.0f);
glVertex3f(axisLength, 0.0f, 0.0f);

qglColor(Qt::green);
glVertex3f(0.0f, -axisLength, 0.0f);
glVertex3f(0.0f, axisLength, 0.0f);

qglColor(Qt::red);
glVertex3f(0.0f, 0.0f, -axisLength);
glVertex3f(0.0f, 0.0f, axisLength);

glEnd();
}

void Cube_test::drawGrid()
{
glBegin(GL_LINES);

qglColor(Qt::gray);

const float gridLineLength = 1000.0f * 0.5f;

glLineWidth(5);

for(float pos=-100.0f; pos<100.0f; pos += 0.5f)
{
if(pos == 0.0f) // do not render Axis here
{
continue;
}

glVertex3f(-gridLineLength, 0.0f, pos);
glVertex3f(gridLineLength, 0.0f, pos);
glVertex3f(pos, 0.0f, -gridLineLength);
glVertex3f(pos, 0.0f, gridLineLength);
}
glEnd();
}

void Cube_test::mousePressEvent(QMouseEvent *pEvent)
{
m_lastMousePos = pEvent->pos();
}

void Cube_test::mouseMoveEvent(QMouseEvent *pEvent)
{
const bool leftBtnPressed = (pEvent->buttons() & Qt::LeftButton) != 0;
const bool rightBtnPressed = (pEvent->buttons() & Qt::RightButton) != 0;

if(leftBtnPressed == false && rightBtnPressed == false)
{
m_lastMousePos = pEvent->pos();
return;
}

const float rotDx = 180.0f * static_cast<float> (pEvent->x() - m_lastMousePos.x()) / static_cast<float> (width());
const float rotDy = 180.0f * static_cast<float> (pEvent->y() - m_lastMousePos.y()) / static_cast<float> (height());

m_lastMousePos = pEvent->pos();

float rotationDif[3] = { rotDy, 0.0f, 0.0f };

if(leftBtnPressed == true)
{
rotationDif[1] = rotDx;
}
else
{
rotationDif[2] = rotDx;
}

for(int i = 0; i < 3; ++i)
{
m_rotation[i] += rotationDif[i];
}
updateGL();
}