void cGLCanvas::initializeGL(){}void cGLCanvas::resizeGL(int nWidth, int nHeight){}void cGLCanvas::paintGL(){ qglClearColor(Qt::black); MainWidth = width(); MainHeight = height(); Engine->Draw(this); update();}
//void CastleFight::resizeGL(int w, int h){ glViewport(0, 0, w, h); if(h > 0) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60.0, w/(GLfloat)h, 0.1, 1000); }}
void CastleFight::paintGL(){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); draw(); glFlush();}
cGLCanvas::cGLCanvas(QWidget *parent) : QGLWidget(parent){ connect( &m_Timer, SIGNAL(timeout()), this, SLOT(onTimer())); m_Timer.start( 40);}void cGLCanvas::paintGL(){ MainWidth = width(); MainHeight = height(); Engine->Draw(this);}void cGLCanvas::onTimer(){ updateGL();}