git-svn-id: svn://db.shs.com.ru/libs@556 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-06-21 15:28:39 +00:00
parent 7eb0919657
commit cff4fbed36
8 changed files with 118 additions and 50 deletions

View File

@@ -62,11 +62,42 @@ void glDrawQuad(QOpenGLShaderProgram * prog, QVector4D * corner_dirs, GLfloat x,
locc = prog ? prog->attributeLocation("view_corner") : 0;
glBegin(GL_QUADS);
QOpenGLFunctions *glFuncs = QOpenGLContext::currentContext()->functions();
if (prog) {glFuncs->glVertexAttrib3f(loc, 1.f, 1.f, 1.f);} glColor3f(1.f, 1.f, 1.f);
if (prog) {if (corner_dirs) prog->setAttributeValue(locc, corner_dirs[0]); glFuncs->glVertexAttrib2f(loct, 0.f, 0.f); glFuncs->glVertexAttrib2f(locv, x, y);} glTexCoord2f(0.f, 0.f); glVertex2f(x, y);
if (prog) {if (corner_dirs) prog->setAttributeValue(locc, corner_dirs[1]); glFuncs->glVertexAttrib2f(loct, 1.f, 0.f); glFuncs->glVertexAttrib2f(locv, x + w, y);} glTexCoord2f(1.f, 0.f); glVertex2f(x + w, y);
if (prog) {if (corner_dirs) prog->setAttributeValue(locc, corner_dirs[2]); glFuncs->glVertexAttrib2f(loct, 1.f, 1.f); glFuncs->glVertexAttrib2f(locv, x + w, y + h);} glTexCoord2f(1.f, 1.f); glVertex2f(x + w, y + h);
if (prog) {if (corner_dirs) prog->setAttributeValue(locc, corner_dirs[3]); glFuncs->glVertexAttrib2f(loct, 0.f, 1.f); glFuncs->glVertexAttrib2f(locv, x, y + h);} glTexCoord2f(0.f, 1.f); glVertex2f(x, y + h);
if (prog) {
glFuncs->glVertexAttrib3f(loc, 1.f, 1.f, 1.f);
}
glColor3f(1.f, 1.f, 1.f);
if (prog) {
if (corner_dirs)
prog->setAttributeValue(locc, corner_dirs[0]);
glFuncs->glVertexAttrib2f(loct, 0.f, 0.f);
glFuncs->glVertexAttrib2f(locv, x, y);
}
glTexCoord2f(0.f, 0.f);
glVertex2f(x, y);
if (prog) {
if (corner_dirs)
prog->setAttributeValue(locc, corner_dirs[1]);
glFuncs->glVertexAttrib2f(loct, 1.f, 0.f);
glFuncs->glVertexAttrib2f(locv, x + w, y);
}
glTexCoord2f(1.f, 0.f);
glVertex2f(x + w, y);
if (prog) {
if (corner_dirs)
prog->setAttributeValue(locc, corner_dirs[2]);
glFuncs->glVertexAttrib2f(loct, 1.f, 1.f);
glFuncs->glVertexAttrib2f(locv, x + w, y + h);
}
glTexCoord2f(1.f, 1.f);
glVertex2f(x + w, y + h);
if (prog) {
if (corner_dirs)
prog->setAttributeValue(locc, corner_dirs[3]);
glFuncs->glVertexAttrib2f(loct, 0.f, 1.f);
glFuncs->glVertexAttrib2f(locv, x, y + h);
}
glTexCoord2f(0.f, 1.f);
glVertex2f(x, y + h);
glEnd();
}