SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
sdrgui
gui
glshadertextured.h
Go to the documentation of this file.
1
// Copyright (C) 2016 F4EXB //
3
// written by Edouard Griffiths //
4
// //
5
// See: http://glslstudio.com/primer/#gl2frag //
6
// https://gitlab.com/pteam/korvins-qtbase/blob/5.4/examples/opengl/cube/mainwidget.cpp //
7
// //
8
// This program is free software; you can redistribute it and/or modify //
9
// it under the terms of the GNU General Public License as published by //
10
// the Free Software Foundation as version 3 of the License, or //
11
// (at your option) any later version. //
12
// //
13
// This program is distributed in the hope that it will be useful, //
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
16
// GNU General Public License V3 for more details. //
17
// //
18
// You should have received a copy of the GNU General Public License //
19
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
21
22
#ifndef INCLUDE_GUI_GLSHADERTEXTURED_H_
23
#define INCLUDE_GUI_GLSHADERTEXTURED_H_
24
25
#include <QString>
26
#include <QOpenGLTexture>
27
#include <QOpenGLFunctions>
28
29
#include "
export.h
"
30
31
class
QOpenGLShaderProgram;
32
class
QMatrix4x4;
33
class
QImage;
34
35
class
SDRGUI_API
GLShaderTextured
36
{
37
public
:
38
GLShaderTextured
();
39
~
GLShaderTextured
();
40
41
void
initializeGL();
42
void
initTexture(
const
QImage& image, QOpenGLTexture::WrapMode wrapMode = QOpenGLTexture::Repeat);
43
void
subTexture(
int
xOffset,
int
yOffset,
int
width,
int
height,
const
void
*pixels);
44
void
drawSurface(
const
QMatrix4x4& transformMatrix, GLfloat* textureCoords, GLfloat *vertices,
int
nbVertices);
45
void
cleanup();
46
47
private
:
48
void
draw(
unsigned
int
mode,
const
QMatrix4x4& transformMatrix, GLfloat *textureCoords, GLfloat *vertices,
int
nbVertices);
49
50
QOpenGLShaderProgram *
m_program
;
51
QOpenGLTexture *
m_texture
;
52
int
m_matrixLoc
;
53
int
m_textureLoc
;
54
static
const
QString
m_vertexShaderSourceTextured
;
55
static
const
QString
m_fragmentShaderSourceTextured
;
56
};
57
58
#endif
/* INCLUDE_GUI_GLSHADERTEXTURED_H_ */
export.h
GLShaderTextured::m_program
QOpenGLShaderProgram * m_program
Definition:
glshadertextured.h:50
GLShaderTextured::m_textureLoc
int m_textureLoc
Definition:
glshadertextured.h:53
GLShaderTextured
Definition:
glshadertextured.h:35
SDRGUI_API
#define SDRGUI_API
Definition:
export.h:52
GLShaderTextured::m_vertexShaderSourceTextured
static const QString m_vertexShaderSourceTextured
Definition:
glshadertextured.h:54
GLShaderTextured::m_texture
QOpenGLTexture * m_texture
Definition:
glshadertextured.h:51
GLShaderTextured::m_fragmentShaderSourceTextured
static const QString m_fragmentShaderSourceTextured
Definition:
glshadertextured.h:55
GLShaderTextured::m_matrixLoc
int m_matrixLoc
Definition:
glshadertextured.h:52
Generated on Fri Aug 2 2019 17:56:34 for SDRAngel by
1.8.13