#include "myopengl.h"#include#includemyopenGL::myopenGL(QWindow*parent)
{
rTri= 0.0;
rQuad= 0.0;
xRot= yRot = zRot = 0.0;
}
myopenGL::~myopenGL()
{
}voidmyopenGL::loadGLTextures()
{
QImage tex, buf;if ( !buf.load( "./msbg_blue.png") )
{
qWarning("Could not read image file, using single-color instead.");
QImage dummy(128, 128, QImage::Format_RGB32 );
dummy.fill( Qt::green );
buf=dummy;
}
tex=QGLWidget::convertToGLFormat( buf );
glGenTextures(1, &texture[0] );
glBindTexture( GL_TEXTURE_2D, texture[0] );
glTexImage2D( GL_TEXTURE_2D,0, 3, tex.width(), tex.height(), 0,
GL_RGBA, GL_UNSIGNED_BYTE, tex.bits() );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );