mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-03 13:47:50 -04:00
OpenGL modernization: GLSpectrum moved to QOpenGLWidget
This commit is contained in:
parent
271b95d0d8
commit
2b5fca79a6
@ -21,7 +21,7 @@
|
|||||||
#ifndef INCLUDE_GLSPECTRUM_H
|
#ifndef INCLUDE_GLSPECTRUM_H
|
||||||
#define INCLUDE_GLSPECTRUM_H
|
#define INCLUDE_GLSPECTRUM_H
|
||||||
|
|
||||||
#include <QGLWidget>
|
#include <QOpenGLWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QOpenGLBuffer>
|
#include <QOpenGLBuffer>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
class QOpenGLShaderProgram;
|
class QOpenGLShaderProgram;
|
||||||
|
|
||||||
class SDRANGEL_API GLSpectrum : public QGLWidget {
|
class SDRANGEL_API GLSpectrum : public QOpenGLWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB. //
|
|
||||||
// //
|
|
||||||
// This is a header file to help migrate to GL ES 2.0 //
|
|
||||||
// //
|
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
|
||||||
// it under the terms of the GNU General Public License as published by //
|
|
||||||
// the Free Software Foundation as version 3 of the License, or //
|
|
||||||
// //
|
|
||||||
// This program is distributed in the hope that it will be useful, //
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
||||||
// GNU General Public License V3 for more details. //
|
|
||||||
// //
|
|
||||||
// You should have received a copy of the GNU General Public License //
|
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef INCLUDE_UTIL_GLESHELP_H_
|
|
||||||
#define INCLUDE_UTIL_GLESHELP_H_
|
|
||||||
|
|
||||||
#define GL_VERTEX_ARRAY 0 // We like submitting vertices on stream 0 for no special reason (GL: 0x8074)
|
|
||||||
#define GL_NORMAL_ARRAY 1 // We like submitting normals on stream 1 for no special reason (GL: 0x8075)
|
|
||||||
#define GL_TEXTURE_COORD_ARRAY 2 // We like submitting texcoords on stream 2 for no special reason (GL: 0x8078)
|
|
||||||
|
|
||||||
#define glColor4fv(a) glColor4f(a[0], a[1], a[2], a[3])
|
|
||||||
#define glColor3fv(a) glColor4f(a[0], a[1], a[2], 1.0f)
|
|
||||||
#define glColor3f(a,b,c) glColor4f(a, b, c, 1.0f)
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* INCLUDE_UTIL_GLESHELP_H_ */
|
|
@ -22,16 +22,12 @@
|
|||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
#include <QOpenGLFunctions>
|
#include <QOpenGLFunctions>
|
||||||
|
#include <QPainter>
|
||||||
#include "gui/glspectrum.h"
|
#include "gui/glspectrum.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#ifdef GL_ANDROID
|
|
||||||
#include "util/gleshelp.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
GLSpectrum::GLSpectrum(QWidget* parent) :
|
GLSpectrum::GLSpectrum(QWidget* parent) :
|
||||||
QGLWidget(parent),
|
|
||||||
m_cursorState(CSNormal),
|
m_cursorState(CSNormal),
|
||||||
m_mouseInside(false),
|
m_mouseInside(false),
|
||||||
m_changesPending(true),
|
m_changesPending(true),
|
||||||
@ -2223,14 +2219,14 @@ void GLSpectrum::enterEvent(QEvent* event)
|
|||||||
{
|
{
|
||||||
m_mouseInside = true;
|
m_mouseInside = true;
|
||||||
update();
|
update();
|
||||||
QGLWidget::enterEvent(event);
|
QOpenGLWidget::enterEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSpectrum::leaveEvent(QEvent* event)
|
void GLSpectrum::leaveEvent(QEvent* event)
|
||||||
{
|
{
|
||||||
m_mouseInside = false;
|
m_mouseInside = false;
|
||||||
update();
|
update();
|
||||||
QGLWidget::enterEvent(event);
|
QOpenGLWidget::enterEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSpectrum::tick()
|
void GLSpectrum::tick()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user