void glsignal::resizeGL(int nWidth, int nHeight) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); GLfloat ratio=(GLfloat)nHeight/(GLfloat)nWidth; //if (nWidth>=nHeight) // glOrtho(-1.0/ratio, 1.0/ratio, -1.0, 1.0, -10.0, 1.0); // else // glOrtho(-1.0, 1.0, -1.0*ratio, 1.0*ratio, -10.0, 1.0); glOrtho(0, 1000, 255, 0, -1, 1);}
void glsignal::drawLine() { glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(2, GL_FLOAT, 0, VertexArray); glDrawArrays(GL_LINE_STRIP, 0, 20000); glDisableClientState(GL_VERTEX_ARRAY);
void glsignal::getVertexArray(QByteArray &bd){ for (int i=0; i<bd.size(); i++) { VertexArray[i][0] = i; //x VertexArray[i][1] = bd.at(i); //y }}