Qt 4.8
Classes | Macros | Variables
qglshaderprogram.cpp File Reference
#include "qglshaderprogram.h"
#include "qglextensions_p.h"
#include "qgl_p.h"
#include <QtCore/private/qobject_p.h>
#include <QtCore/qdebug.h>
#include <QtCore/qfile.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qvector.h>

Go to the source code of this file.

Classes

class  QGLShaderPrivate
 
class  QGLShaderProgramPrivate
 

Macros

#define ctx   shaderGuard.context()
 
#define ctx   d->shaderGuard.context()
 
#define ctx   programGuard.context()
 
#define ctx   d->programGuard.context()
 
#define ctx   QGLContext::currentContext()
 
#define ctx   d->programGuard.context()
 
#define GL_CURRENT_VERTEX_ATTRIB   0x8626
 
#define GL_NUM_SHADER_BINARY_FORMATS   0x8DF9
 
#define GL_SHADER_BINARY_FORMATS   0x8DF8
 
#define GL_SHADER_SOURCE_LENGTH   0x8B88
 
#define QGL_DEFINE_QUALIFIERS   1
 
#define setUniformGenericMatrix(func, colfunc, location, value, cols, rows)
 
#define setUniformGenericMatrixArray(func, colfunc, location, values, count, type, cols, rows)
 
#define setUniformMatrix(func, location, value, cols, rows)
 
#define setUniformMatrixArray(func, location, values, count, type, cols, rows)
 

Variables

static const char qualifierDefines []
 

Macro Definition Documentation

◆ ctx [1/6]

#define ctx   shaderGuard.context()

Definition at line 1012 of file qglshaderprogram.cpp.

◆ ctx [2/6]

#define ctx   d->shaderGuard.context()

Definition at line 1012 of file qglshaderprogram.cpp.

◆ ctx [3/6]

#define ctx   programGuard.context()

Definition at line 1012 of file qglshaderprogram.cpp.

◆ ctx [4/6]

#define ctx   d->programGuard.context()

Definition at line 1012 of file qglshaderprogram.cpp.

◆ ctx [5/6]

#define ctx   QGLContext::currentContext()

Definition at line 1012 of file qglshaderprogram.cpp.

◆ ctx [6/6]

#define ctx   d->programGuard.context()

Definition at line 1012 of file qglshaderprogram.cpp.

◆ GL_CURRENT_VERTEX_ATTRIB

#define GL_CURRENT_VERTEX_ATTRIB   0x8626

Definition at line 187 of file qglshaderprogram.cpp.

◆ GL_NUM_SHADER_BINARY_FORMATS

#define GL_NUM_SHADER_BINARY_FORMATS   0x8DF9

Definition at line 196 of file qglshaderprogram.cpp.

◆ GL_SHADER_BINARY_FORMATS

#define GL_SHADER_BINARY_FORMATS   0x8DF8

Definition at line 193 of file qglshaderprogram.cpp.

◆ GL_SHADER_SOURCE_LENGTH

#define GL_SHADER_SOURCE_LENGTH   0x8B88

Definition at line 190 of file qglshaderprogram.cpp.

Referenced by QGLShader::sourceCode().

◆ QGL_DEFINE_QUALIFIERS

#define QGL_DEFINE_QUALIFIERS   1

Definition at line 375 of file qglshaderprogram.cpp.

◆ setUniformGenericMatrix

#define setUniformGenericMatrix (   func,
  colfunc,
  location,
  value,
  cols,
  rows 
)
Value:
if (location == -1) \
return; \
if (sizeof(qreal) == sizeof(GLfloat)) { \
const GLfloat *data = reinterpret_cast<const GLfloat *> \
(value.constData()); \
if (func) \
func(location, 1, GL_FALSE, data); \
else \
colfunc(location, cols, data); \
} else { \
GLfloat mat[cols * rows]; \
const qreal *data = value.constData(); \
for (int i = 0; i < cols * rows; ++i) \
mat[i] = data[i]; \
if (func) \
func(location, 1, GL_FALSE, mat); \
else \
colfunc(location, cols, mat); \
}
double qreal
Definition: qglobal.h:1193
#define GL_FALSE
static const char * data(const QByteArray &arr)
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63

Definition at line 2335 of file qglshaderprogram.cpp.

Referenced by QGLShaderProgram::setUniformValue().

◆ setUniformGenericMatrixArray

#define setUniformGenericMatrixArray (   func,
  colfunc,
  location,
  values,
  count,
  type,
  cols,
  rows 
)
Value:
if (location == -1 || count <= 0) \
return; \
if (sizeof(type) == sizeof(GLfloat) * cols * rows) { \
const GLfloat *data = reinterpret_cast<const GLfloat *> \
(values[0].constData()); \
if (func) \
func(location, count, GL_FALSE, data); \
else \
colfunc(location, count * cols, data); \
} else { \
QVarLengthArray<GLfloat> temp(cols * rows * count); \
for (int index = 0; index < count; ++index) { \
for (int index2 = 0; index2 < (cols * rows); ++index2) { \
temp.data()[cols * rows * index + index2] = \
values[index].constData()[index2]; \
} \
} \
if (func) \
func(location, count, GL_FALSE, temp.constData()); \
else \
colfunc(location, count * cols, temp.constData()); \
}
int type
Definition: qmetatype.cpp:239
#define GL_FALSE
static const char * data(const QByteArray &arr)
quint16 values[128]
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63
quint16 index

Definition at line 3009 of file qglshaderprogram.cpp.

Referenced by QGLShaderProgram::setUniformValueArray().

◆ setUniformMatrix

#define setUniformMatrix (   func,
  location,
  value,
  cols,
  rows 
)
Value:
if (location == -1) \
return; \
if (sizeof(qreal) == sizeof(GLfloat)) { \
func(location, 1, GL_FALSE, \
reinterpret_cast<const GLfloat *>(value.constData())); \
} else { \
GLfloat mat[cols * rows]; \
const qreal *data = value.constData(); \
for (int i = 0; i < cols * rows; ++i) \
mat[i] = data[i]; \
func(location, 1, GL_FALSE, mat); \
}
double qreal
Definition: qglobal.h:1193
#define GL_FALSE
static const char * data(const QByteArray &arr)
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63

Definition at line 2321 of file qglshaderprogram.cpp.

Referenced by QGLShaderProgram::setUniformValue().

◆ setUniformMatrixArray

#define setUniformMatrixArray (   func,
  location,
  values,
  count,
  type,
  cols,
  rows 
)
Value:
if (location == -1 || count <= 0) \
return; \
if (sizeof(type) == sizeof(GLfloat) * cols * rows) { \
func(location, count, GL_FALSE, \
reinterpret_cast<const GLfloat *>(values[0].constData())); \
} else { \
QVarLengthArray<GLfloat> temp(cols * rows * count); \
for (int index = 0; index < count; ++index) { \
for (int index2 = 0; index2 < (cols * rows); ++index2) { \
temp.data()[cols * rows * index + index2] = \
values[index].constData()[index2]; \
} \
} \
func(location, count, GL_FALSE, temp.constData()); \
}
int type
Definition: qmetatype.cpp:239
#define GL_FALSE
quint16 values[128]
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63
quint16 index

Definition at line 2992 of file qglshaderprogram.cpp.

Referenced by QGLShaderProgram::setUniformValueArray().

Variable Documentation

◆ qualifierDefines

const char qualifierDefines[]
static
Initial value:
=
"#define lowp\n"
"#define mediump\n"
"#define highp\n"

Definition at line 376 of file qglshaderprogram.cpp.

Referenced by QGLShader::compileSourceCode().