Skip to content

Commit

Permalink
derive wspinnyglsl and wvumeterglsl and QOpenGLFunctions and call ini…
Browse files Browse the repository at this point in the history
…tOpenGLFunctions
  • Loading branch information
m0dB committed Sep 19, 2023
1 parent ee90380 commit 42fac9d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/widget/wspinnyglsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ void WSpinnyGLSL::paintGL() {
}

void WSpinnyGLSL::initializeGL() {
initializeOpenGLFunctions();

updateTextures();

m_pQTexture.reset(new QOpenGLTexture(QOpenGLTexture::Target2D));
Expand Down
3 changes: 2 additions & 1 deletion src/widget/wspinnyglsl.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#pragma once

#include <QOpenGLFunctions>
#include <QOpenGLTexture>

#include "shaders/textureshader.h"
#include "shaders/vinylqualityshader.h"
#include "widget/wspinnybase.h"

class WSpinnyGLSL : public WSpinnyBase {
class WSpinnyGLSL : public WSpinnyBase, private QOpenGLFunctions {
public:
WSpinnyGLSL(QWidget* parent,
const QString& group,
Expand Down
2 changes: 2 additions & 0 deletions src/widget/wvumeterglsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ void WVuMeterGLSL::draw() {
}

void WVuMeterGLSL::initializeGL() {
initializeOpenGLFunctions();

m_pTextureBack.reset(createTexture(m_pPixmapBack));
m_pTextureVu.reset(createTexture(m_pPixmapVu));
m_textureShader.init();
Expand Down
3 changes: 2 additions & 1 deletion src/widget/wvumeterglsl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <QOpenGLFunctions>
#include <QOpenGLTexture>
#include <memory>

Expand All @@ -8,7 +9,7 @@
#include "widget/wvumeterbase.h"
#include "widget/wwidget.h"

class WVuMeterGLSL : public WVuMeterBase {
class WVuMeterGLSL : public WVuMeterBase, private QOpenGLFunctions {
Q_OBJECT
public:
explicit WVuMeterGLSL(QWidget* pParent = nullptr);
Expand Down

0 comments on commit 42fac9d

Please sign in to comment.