glClearColor(0.0f, 0.0f,0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPixelZoom(1.00010 + m_zoomSetting, (1.0000 + m_zoomSetting) * -1);
if (m_zoomSetting == 0) {
glRasterPos2f(0, m_height - 1);
glDrawPixels(m_imageWidth, m_imageHeight,GL_LUMINANCE,
GL_UNSIGNED_BYTE, m_displayPtr);
}
else {
glRasterPos2f((float)m_width/2.0, (float)m_height/2.0);
glBitmap(0,0,0,0,-(m_width * (m_zoomSetting + 1)/2.0), m_height*
(m_zoomSetting + 1)/2.0, NULL);
glDrawPixels(m_imageWidth, m_imageHeight,GL_LUMINANCE,
GL_UNSIGNED_BYTE, m_displayPtr);
}
glPointSize(5.0);
glBegin(GL_POINTS);
qglColor(Qt::red);
float rx = 0.0;
float ry = 0.0;
glVertex2f(rx, ry);
glEnd();
glPointSize(2.0);
rx = rx + 10;
ry = ry + 10;
glBegin(GL_POINTS);
for (int r = 0; r < 100; r++)
{
glVertex2f(rx, ry);
rx = rx + 10;
ry = ry + 10;
}
glEnd();
glClearColor(0.0f, 0.0f,0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPixelZoom(1.00010 + m_zoomSetting, (1.0000 + m_zoomSetting) * -1);
if (m_zoomSetting == 0) {
glRasterPos2f(0, m_height - 1);
glDrawPixels(m_imageWidth, m_imageHeight,GL_LUMINANCE,
GL_UNSIGNED_BYTE, m_displayPtr);
}
else {
glRasterPos2f((float)m_width/2.0, (float)m_height/2.0);
glBitmap(0,0,0,0,-(m_width * (m_zoomSetting + 1)/2.0), m_height*
(m_zoomSetting + 1)/2.0, NULL);
glDrawPixels(m_imageWidth, m_imageHeight,GL_LUMINANCE,
GL_UNSIGNED_BYTE, m_displayPtr);
}
glPointSize(5.0);
glBegin(GL_POINTS);
qglColor(Qt::red);
float rx = 0.0;
float ry = 0.0;
glVertex2f(rx, ry);
glEnd();
glPointSize(2.0);
rx = rx + 10;
ry = ry + 10;
glBegin(GL_POINTS);
for (int r = 0; r < 100; r++)
{
glVertex2f(rx, ry);
rx = rx + 10;
ry = ry + 10;
}
glEnd();
To copy to clipboard, switch view to plain text mode
Bookmarks