git-svn-id: svn://db.shs.com.ru/libs@536 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-05-24 19:06:35 +00:00
parent 1082db07c6
commit 58fce3cd81
29 changed files with 394 additions and 599 deletions

View File

@@ -19,7 +19,9 @@
#include "glcamera.h"
#include "qglview.h"
__GLWidget__ * currentQGLView;
#include <QPainter>
//__GLWidget__ * currentQGLView;
QMutex globMutex;
@@ -51,7 +53,7 @@ QString findFile(const QString & file, const QStringList & pathes) {
}
void glDrawQuad(__GLShaderProgram__ * prog, QVector4D * corner_dirs, GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
void glDrawQuad(QOpenGLShaderProgram * prog, QVector4D * corner_dirs, GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
QGLCI
glResetAllTransforms();
glSetPolygonMode(GL_FILL);
@@ -72,12 +74,7 @@ void glDrawQuad(__GLShaderProgram__ * prog, QVector4D * corner_dirs, GLfloat x,
QMatrix4x4 getGLMatrix(GLenum matrix) {
GLdouble gm[16];
glGetDoublev(matrix, gm);
#if QT_VERSION < 0x050600
qreal
#else
float
#endif
qm[16];
float qm[16];
for (int i = 0; i < 16; ++i)
qm[i] = gm[i];
return QMatrix4x4(qm).transposed();
@@ -86,12 +83,7 @@ QMatrix4x4 getGLMatrix(GLenum matrix) {
void setGLMatrix(QMatrix4x4 matrix) {
GLdouble gm[16];
#if QT_VERSION < 0x050600
qreal
#else
float
#endif
qm[16];
float qm[16];
matrix.transposed().copyDataTo(qm);
for (int i = 0; i < 16; ++i)
gm[i] = qm[i];
@@ -101,12 +93,7 @@ void setGLMatrix(QMatrix4x4 matrix) {
void qglMultMatrix(const QMatrix4x4 & m) {
GLdouble gm[16];
#if QT_VERSION < 0x050600
qreal
#else
float
#endif
qm[16];
float qm[16];
m.transposed().copyDataTo(qm);
for (int i = 0; i < 16; ++i)
gm[i] = qm[i];
@@ -307,6 +294,11 @@ void QGLViewBase::setCamera(const Camera & camera) {
}
GLTextureManagerBase * QGLViewBase::textureManager() {
return m_texture_manager;
}
Box3D::Box3D(const QVector<QVector3D> & points) {
x = y = z = width = length = height = angle_z = angle_xy = angle_roll = 0.f;
if (points.isEmpty()) return;