| 690 | if (isNoPowerOfTwoAllowed)
|
| 691 | strImage = QPixmap(newTex->subTexWidth, newTex->subTexHeight);
|
| 692 | else
|
| 693 | strImage = QPixmap(StelUtils::getBiggerPowerOfTwo(newTex->subTexWidth), StelUtils::getBiggerPowerOfTwo(newTex->subTexHeight));
|
| 694 | newTex->width = strImage.width();
|
| 695 | newTex->height = strImage.height();
|
| 696 | |
| 697 | strImage.fill(Qt::transparent);
|
| 698 | |
| 699 | QPainter painter(&strImage);
|
| 700 | painter.setFont(qPainter->font());
|
| 701 | painter.setRenderHints(QPainter::TextAntialiasing, true);
|
| 702 | painter.setPen(Qt::white);
|
| 703 | painter.drawText(-strRect.x(), -strRect.y(), str);
|
| 704 | |
| 705 | // Create and bind texture, and add it to the list of cached textures
|
| 706 | newTex->texture = StelPainter::glContext->bindTexture(strImage, GL_TEXTURE_2D, GL_RGBA, QGLContext::NoBindOption);
|
| 707 | |