mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 12:02:25 +02:00
Disable virtual trackpad rendering on non-Android builds
This commit is contained in:
parent
88ecfe7895
commit
9e8368e50e
2 changed files with 6 additions and 2 deletions
|
@ -23,6 +23,7 @@ const QString Basic2DWindowOpenGLDisplayPlugin::NAME("Desktop");
|
|||
static const QString FULLSCREEN = "Fullscreen";
|
||||
|
||||
void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
auto iconPath = PathUtils::resourcesPath() + "images/analog_stick.png";
|
||||
auto image = QImage(iconPath);
|
||||
if (image.format() != QImage::Format_ARGB32) {
|
||||
|
@ -61,8 +62,7 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
|||
_virtualPadStickBaseTexture->assignStoredMip(0, image.byteCount(), image.constBits());
|
||||
_virtualPadStickBaseTexture->setAutoGenerateMips(true);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Parent::customizeContext();
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,7 @@ bool Basic2DWindowOpenGLDisplayPlugin::internalActivate() {
|
|||
}
|
||||
|
||||
void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
if(virtualPadManager.getLeftVirtualPad()->isBeingTouched()) {
|
||||
// render stick base
|
||||
|
@ -115,6 +116,7 @@ void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
|||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
Parent::compositeExtra();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,8 @@ private:
|
|||
uint32_t _framerateTarget { 0 };
|
||||
int _fullscreenTarget{ -1 };
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
gpu::TexturePointer _virtualPadStickTexture;
|
||||
gpu::TexturePointer _virtualPadStickBaseTexture;
|
||||
#endif
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue