Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual
Page 197

KTD-S0057-I
Page 193 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
GLWidget::~GLWidget ()
{
makeCurrent
();
glDeleteLists (gear1, 1);
glDeleteLists (gear2, 1);
glDeleteLists (gear3, 1);
}
void GLWidget::setXRotation (int angle)
{
normalizeAngle
(&angle);
if (angle != xRot)
{
xRot = angle;
emit xRotationChanged (angle);
updateGL
();
}
}
void GLWidget::setYRotation (int angle)
{
normalizeAngle
(&angle);
if (angle != yRot)
{
yRot = angle;
emit yRotationChanged (angle);
updateGL
();
}
}
void GLWidget::setZRotation (int angle)
{
normalizeAngle
(&angle);
if (angle != zRot)
{
zRot = angle;
emit zRotationChanged (angle);
updateGL
();
}
}
void GLWidget::initializeGL ()
{
static const GLfloat lightPos[4] = { 5.0f, 5.0f, 10.0f, 1.0f };
static const GLfloat reflectance1[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
static const GLfloat reflectance2[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
static const GLfloat reflectance3[4] = { 0.2f, 0.2f, 1.0f, 1.0f };