Suggest single-component texture format.
This commit is contained in:
parent
e73e1a6c0f
commit
9255d71038
2 changed files with 12 additions and 0 deletions
|
|
@ -155,4 +155,14 @@ TexturedRect Image::texturedRect(
|
|||
};
|
||||
}
|
||||
|
||||
GLint CurrentSingleComponentFormat() {
|
||||
const auto context = QOpenGLContext::currentContext();
|
||||
Assert(context != nullptr);
|
||||
|
||||
const auto format = context->format();
|
||||
return (format.renderableType() == QSurfaceFormat::OpenGLES)
|
||||
? GL_LUMINANCE
|
||||
: GL_RED;
|
||||
}
|
||||
|
||||
} // namespace Ui::GL
|
||||
|
|
|
|||
|
|
@ -134,4 +134,6 @@ private:
|
|||
|
||||
};
|
||||
|
||||
[[nodiscard]] GLint CurrentSingleComponentFormat();
|
||||
|
||||
} // namespace Ui::GL
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue