mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:30:38 +02:00
Fixing new image texture use from last upstream merge
This commit is contained in:
parent
ea6f840fdb
commit
351246fac1
2 changed files with 9 additions and 9 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <GLCanvas.h>
|
#include <GLCanvas.h>
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
|
|
||||||
|
#include "gpu/GLBackend.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "CameraToolBox.h"
|
#include "CameraToolBox.h"
|
||||||
#include "FaceTracker.h"
|
#include "FaceTracker.h"
|
||||||
|
@ -74,21 +75,20 @@ void CameraToolBox::toggleMute() {
|
||||||
void CameraToolBox::render(int x, int y, bool boxed) {
|
void CameraToolBox::render(int x, int y, bool boxed) {
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
auto glCanvas = Application::getInstance()->getGLWidget();
|
if (!_enabledTexture) {
|
||||||
if (_enabledTextureId == 0) {
|
_enabledTexture = DependencyManager::get<TextureCache>()->getImageTexture(PathUtils::resourcesPath() + "images/face.svg");
|
||||||
_enabledTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/face.svg"));
|
|
||||||
}
|
}
|
||||||
if (_mutedTextureId == 0) {
|
if (!_mutedTexture) {
|
||||||
_mutedTextureId = glCanvas->bindTexture(QImage(PathUtils::resourcesPath() + "images/face-mute.svg"));
|
_mutedTexture = DependencyManager::get<TextureCache>()->getImageTexture(PathUtils::resourcesPath() + "images/face-mute.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
const int MUTE_ICON_SIZE = 24;
|
const int MUTE_ICON_SIZE = 24;
|
||||||
_iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE);
|
_iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE);
|
||||||
float iconColor = 1.0f;
|
float iconColor = 1.0f;
|
||||||
if (!Menu::getInstance()->isOptionChecked(MenuOption::MuteFaceTracking)) {
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::MuteFaceTracking)) {
|
||||||
glBindTexture(GL_TEXTURE_2D, _enabledTextureId);
|
glBindTexture(GL_TEXTURE_2D, gpu::GLBackend::getTextureID(_enabledTexture));
|
||||||
} else {
|
} else {
|
||||||
glBindTexture(GL_TEXTURE_2D, _mutedTextureId);
|
glBindTexture(GL_TEXTURE_2D, gpu::GLBackend::getTextureID(_mutedTexture));
|
||||||
|
|
||||||
// Make muted icon pulsate
|
// Make muted icon pulsate
|
||||||
static const float PULSE_MIN = 0.4f;
|
static const float PULSE_MIN = 0.4f;
|
||||||
|
|
|
@ -34,8 +34,8 @@ private slots:
|
||||||
void toggleMute();
|
void toggleMute();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLuint _enabledTextureId = 0;
|
gpu::TexturePointer _enabledTexture;
|
||||||
GLuint _mutedTextureId = 0;
|
gpu::TexturePointer _mutedTexture;
|
||||||
int _boxQuadID = GeometryCache::UNKNOWN_ID;
|
int _boxQuadID = GeometryCache::UNKNOWN_ID;
|
||||||
QRect _iconBounds;
|
QRect _iconBounds;
|
||||||
qint64 _iconPulseTimeReference = 0;
|
qint64 _iconPulseTimeReference = 0;
|
||||||
|
|
Loading…
Reference in a new issue