//Конструктор QImage *imgButton = new QImage(500, 100, QImage::Format_RGBA8888); imgButton->fill(Qt::transparent); QPainter p(imgButton); p.setPen(Qt::red); p.setFont(QFont("Arial", 20)); p.drawText(10,20,"Привет, мир !"); glGenTextures(1, &imgTexture); glBindTexture(GL_TEXTURE_2D, imgTexture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, imgButton->width(), imgButton->height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, imgButton->bits()); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); float color[] = { 1.0f, 0.0f, 0.0f, 0.0f }; glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, color);void GlGui::draw(){ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, width, 0.0, height, -1.0, 1.0 ); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gl_funcs->glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, imgTexture); glBegin(GL_QUADS); glTexCoord2f(0.f, 1.f); glVertex2f( 10, 50); glTexCoord2f(1.f, 1.f); glVertex2f(510, 50); glTexCoord2f(1.f, 0.f); glVertex2f(510,150); glTexCoord2f(0.f, 0.f); glVertex2f( 10,150); glEnd();}